fsl.scripts.imtest

The imtest script can be used to test whether an image file exists or not, without having to know the file suffix (.nii, .nii.gz, etc).

fsl.scripts.imtest.exts = ['.nii.gz', '.nii', '.nii.zst', '.nii.bz2', '.img', '.hdr', '.img.gz', '.hdr.gz', '.img.zst', '.hdr.zst', '.img.bz2', '.hdr.bz2', '.mnc', '.mnc.gz']

List of file extensions that are supported by imtest.

fsl.scripts.imtest.groups = [('.hdr', '.img'), ('.hdr.gz', '.img.gz'), ('.hdr.zst', '.img.zst'), ('.hdr.bz2', '.img.bz2')]

List of known image file groups (image/header file pairs).

fsl.scripts.imtest.imtest(path)[source]

Returns True if the given image path exists, False otherwise.

fsl.scripts.imtest.main(argv=None)[source]

Test if an image path exists, and prints '1' if it does or '0' if it doesn’t.