User guide: Supported file formats

File formats

Image file formats

In general image file formats are automatically recognized when reading the image. When writing images the file format is determined from the extension of the file name (e.g. the file name test.nii causes the image to be written in NIFTI format). Also, all binary file formats (NIFTI, Analyze and GIPL) can be read and written in compressed gz format (simply specify the .gz file extension when reading or writing file formats, e.g. test.nii.gz).

Note that images can be converted using the convert tool.

NIFTI

The recommended file format is NIFTI as it contains information about the image dimensions, size (voxels), origin and orientation. Normally, this information should be populated when converting DICOM to NIFTI. This means that NIFTI images will be correctly displayed in rview (i.e. the images can be displayed correctly according to neurological or radiological convention). Most other software packages such as SPM or FSL will be able read or write NIFTI image files. For more information on the definition of the NIFTI file format see http://nifti.nimh.nih.gov/

Analyze

The Analyze 7.5 image file format consists of a pair of files with the extensions .hdr & .img. This file format is a very common file format, however its use the Image Registration Toolkit is discouraged, mainly because the Analyze header is not always correctly set (e.g. the origin information often missing or incorrect). Also, IRTK will flip the image in the y-directions when the image is read and written (for historical reasons). This means that the coordinate system which IRTK uses for Analyze images is different from that used by other software packages such as SPM or FSL. If you have Analyze files please consider converting them to NIFTI using the convert tool. See http://www.mayo.edu/bir/PDF/ANALYZE75.pdf for more informaton on this file format.

GIPL

The GIPL (Guy's Image Processing Lab) file format. It is not widely used and its usage is not recommened.

VTK

The VTK Structured Points file format contains information about the image dimensions, size (voxels), origin. Note that this file format does not allow the storage of the image orientation, thus you should only use this file format when the image axes are aligned with the Cartesian coordinate axes. See http://www.vtk.org/pdf/file-formats.pdf for more information.

PGM

The PGM file format is a lowest common denominator grayscale file format for 2D images. It is designed to be extremely easy to learn and write programs for. It does not allow the storage of information such as image size (voxels), origin and orientation. For more information see http://netpbm.sourceforge.net/doc/pgm.html

Transformation file formats

DOF transformation file format

The DOF file format can store rigid, affine and non-rigid transformations. The file format is a binary file format and its definition depends on the type of transformation stored in the file. A more detailed description of the file format will follow soon. If you need access to the deformation field defined by a DOF file you can use the dof2image tool to convert a DOF file into three displacement images.

FSL transformation file format

The FSL software library's affine registration tool flirt uses a simple matrix text file format to store affine transformation matrices. Transformation files in DOF format can be converted to the FSL format using the dof2flirt tool. Transformation files in FSL format can be converted into a DOF file using the flirt2dof tool. For more information on the FSL file format see http://www.fmrib.ox.ac.uk/fsl/flirt/