[vtk-developers] A NIFTI Reader for VTK

David Gobbi david.gobbi at gmail.com
Tue Feb 19 12:20:52 EST 2013


Hi All,

I've pushed a topic with a reader/writer for the NIFTI file format:
http://review.source.kitware.com/#/t/2160/

Overall, it's made to be similar to the ITK NIFTI-IO, so it is
quite different from the paraview NIFTI classes.  The main
thing is how it deals with dimensions:

1) It does not filter (i.e. re-order) the x,y,z dimensions.  Instead,
it provides a matrix to to convert the raw image coordinates
into NIFTI coordinates (RAS coordinates).  Actually it provides
two such matrices: one for the NIFTI qform, and another for
the NIFTI sform.

2) Multi-dimensional NIFTI images are read as multi-component
VTK images.  So a NIFTI vector image becomes a VTK image
with 3 components.  A NIFTI tensor image becomes a VTK image
with 6 (or 9) components.  It's up to the application to determine
the intent of the data.

3) The time dimension is ignored unless a specific flag
"TimeAsVector" is set.  If that flag is set, then subsequent
time points are read into subsequent scalar components. In other
words, a time image becomes a vector image.  This is a trick
that I've been using for years to deal with 4D images in VTK.

4) There isn't much support for NIFTI metadata yet.

I'd be glad to hear feedback from anyone who is familiar with
NIFTI.

 - David



More information about the vtk-developers mailing list