[Insight-users] Reading an mhd file with unknown pixel type

David Doria daviddoria at gmail.com
Wed Dec 1 08:37:24 EST 2010


Recently mhd has been my goto file format for writing non-standard-RGB
type images. For example, I may write a

itk::Image<float, 4>

or a

itk::Image<float, 5>

To successfully read these files, I need to know ahead of time what
type of pixel they contain so I can do:

typedef itk::ImageFileReader<itk::Image<float, 5> > ReaderType;

Is there a better way to read these files where the reader will adapt
and give me back an image of the correct type without me having to
specify the type before hand?

Thanks,

David


More information about the Insight-users mailing list