FSL and NIfTI-1.1
FSL has supported input and output of NIfTI-1 files since the release of version 3.3 in April 2006. This is the second release of FSL that supports NIfTI-1, and more features are implemented that in the previous release, although not every feature is currently fully implemented.
In order to maintain backward compatibility the current version of FSL (3.3) also supports Analyze input and output. As NIfTI-1 allows voxel coordinates to be mapped onto real-world (mm) coordinates with a transformation (qform or sform) that either preserves left-right orientation of the coordinate system (positive determinant) or reverses left-right orientation (negative determinant) it was necessary to assume that all Analyze files and any NIfTI file which did not specify either qform or sform, had a reversed left-right orientation (also called "radiological convention" in the FSL help pages). This was done in order to be consistent with the avg152T1 standard image.
Reading
Filenames:
FSL will read compressed or uncompressed image files. The
filenames must end with one of the following valid extensions:
.nii .nii.gz .hdr .hdr.gz .img .img.gz.
In the case of the two file format, either
file may or may not be compressed. FSL command lines will
also accept a basename without extension, and will look for
files with the above valid extensions. If there is more than
one possible match, the program typically terminates, giving
an error message that indicates that several matches were found
and that a unique file could not be determined. Therefore it is
important to avoid multiple files in different formats that
share the same extension.
Unsupported information:
The current version of FSL (3.3) will read, but does not
use or store the following information from the NIfTI-1 file:
- statistical codes
- slice ordering
- any extensions
Orientation information (sform and qform):
FSL version 3.3 uses both sform and qform information.
When only one is left unset, currently FSL writes all output
images so that both are set and equal to each other (as much
as possible). This feature is currently implemented to assist
interoperability with software that only supports one of the
sform or qform matrices.
However, at present only negative determinant transformations are recommended - which is the default if the orientation information is absent (in Analyze or because the intent codes for qform and sform are both set to UNKNOWN). Although most processing works fine for images with positive determinant mappings (and mixtures of images with both negative and positive determinant mappings) some bugs exist in coordinate lookup routines for images with positive determinant mappings. Consequently the use of images with positive determinant mappings is strongly discouraged in the current version of FSL and users are encouraged to swap the storage (shifting the intensity data around and changing the left-right orientation of the voxel coordinate system) on all input images before using FSL. This can be easily achieved using tools provided by FSL and information on the FSL FAQ.
Orientation in FSLView:
FSLView always shows images in such a way that they can be
rotated to match the avg152 standard images which has a right-handed
coordinate system.
In a canonical, axially-sliced orientation the images with A-P and S-I
oriented as for the avg152 images, the views are in radiological
convention. For other slicings and orientations the behaviour may
seem unintuitive, although it is intended as the
"correct" behaviour. Whenever the sform or qform information is set, labels for the various axes in FSLView are displayed (i.e. "L", "R", "S", "I", "A" or "P"). However, this is a tricky issue and
for more details see the
FSL FAQ entry on this topic.
Writing
By default, FSL programs output compressed, single-file NIfTI-1
datasets. This behaviour can be changed by setting
the environment variable FSLOUTPUTTYPE to the desired output type.
In addition, FSL supports conversion to and from NIfTI-1 and Analyze (using default values for fields when necessary) with the program avwchfiletype. This also allows converts single/dual files and compressed/uncompressed files.
Unsupported information:
The current version of FSL (3.3) will not write the
following information into a NIfTI-1 file:
- datatypes except the DT_SIGNED_SHORT, DT_UNSIGNED_CHAR, DT_SIGNED_INT, DT_FLOAT and DT_DOUBLE (and very limited support for DT_COMPLEX)
- slice ordering
- any extensions
Note that FSL version 3.3 does write statistical codes but does not use the voxel-wise statistical information storage mechanism.
Future Plans:
- Deal seamlessly with the left-handed and right-handed images (and arbitrary mixtures) within an analysis pipeline.
- Support the NIfTI-1.1 statistical codes.
- Support voxel-dependent statistical parameters.
- Support 5D datasets.