[Insight-developers] Questions about itk::ImageIOBase::IOPixelType and Reading/Writing

kent williams norman-k-williams at uiowa.edu
Thu Mar 12 13:23:59 EDT 2009


I noticed this debugging a new itkNiftiImageIO test.

The test was failing with an exception, having to do with trying to convert
pixel types between a vector of 6 floats and a scalar float.

It turns out that the itkImageIOBase::m_PixelType was scalar, but I was
trying to read in an image with vector pixel types.

So is this the rule?

When you write a file itkImageFileWriter will set the PixelType for the
itkImageIO instance, but when you read the itkImageIO instance needs to set
the PixelType, and the itkImageFileReader then does whatever conversions it
can to return an image of the requested type.



Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.



More information about the Insight-developers mailing list