[Insight-developers] Streamable Image IO: Does itkImageFileWriter::GetDimensions() return same or different size than GetImageIORegion?

kent williams norman-k-williams at uiowa.edu
Mon Jul 30 14:41:32 EDT 2007


I'm trying to straighten out NiftiImageIO and run into something that is
confusing me:

In WriteImageInformation, I build a NIfTI file header.  Should I be calling
itk::ImageIOBase::GetIORegion() to find out the image size to write to the
header?  Or should I do what I used to do, which is call
itk::ImageIOBase::GetDimensions()?

BTW NIfTI is a lousy candidate for streamable writing for a couple of
reasons: 

1) It doesn't work to seek to an offset in a compressed file and write.
Sequential writing only.

2) A NIfTI file with vector pixels is written out
{ all pixel[0] } { all pixel[1] } { all pixel[2] } etc -- i.e. The
individual scalars in each vector pixel are not adjacent on disk.
So you can't EG write out a time series one 3D volume at a time.

This is because of their conceptual idea that NIfTI images dimensions should
always be by convention  X,Y,Z,T,V -- x fastest moving, T always the 4th
dimension.  You therefore are never going to be able to write a subregion on
disk, because to do so requires too much data rearrangement, and restriction
#1 above.



More information about the Insight-developers mailing list