[vtk-developers] VTK reader/writer for NIFTI-1 and NIFTI-2

David Gobbi david.gobbi at gmail.com
Mon Mar 3 12:34:05 EST 2014

Hi All,

I've pushed classes for reading/writing NIFTI files to gerrit, and am
looking for reviewers.


The classes are named vtkNIFTIImageReader and vtkNIFTIImageWriter,
and there is a vtkNIFTIImageHeader class that allows inspection and
modification of header info.  There are two reasons for having "Image"
in the names of the classes: it avoids conflict with the
vtkNIfTIReader that already exists in ParaView, and also there is
precedent with the vtkMINCImageReader and vtkDICOMImageReader.

Both the original nifti-1 and the new 64-bit nifti-2 formats are
supported. Also, Analyze 7.5 files can be read (but unlike nifti-1 and
nifti-2, analyze files cannot be written).

Unlike the nifti reader that comes as a paraview plugin, the
vtkNIFTIImageReader does not permute the data according to the
orientation in the header.  Instead, it has two methods called
GetSFormMatrix() and GetQFormMatrix() that return the orientation
and offset as 4x4 matrices (it provides two matrices because the
NIFTI header contains two matrices.)

 - David

More information about the vtk-developers mailing list