fsl.scripts.imglob

This module defines the imglob application, which identifies unique NIFTI image files.

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

List of supported image file extensions.

fsl.scripts.imglob.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.imglob.imglob(paths, output=None)[source]

Given a list of file names, identifies and returns the unique NIFTI/ANALYZE image files that exist.

Parameters:
  • paths – Sequence of paths/prefixes to glob.

  • output

    One of 'prefix' (the default), 'all', or 'primary':

    • 'prefix': Returns the files without extensions.

    • 'all': Returns all files that match (e.g. both

      .img and .hdr files will be returned).

    • 'primary': Returns only the primary file of each

      matching file group, e.g. only the .hdr file would be returned from an .img/.hdr pair.

Returns:

A sequence of resolved path names, in the form specified by the output parameter.

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

The imglob application. Given a list of file names, identifies and prints the unique NIFTI image files.