[Insight-developers] image data type
kent williams
norman-k-williams at uiowa.edu
Tue Mar 13 12:43:12 EST 2007
When you read a file with ImageIO, it will handle pixel type conversion from
the pixel type of the image file and the image type you specify when you
instantiate the ImageFileReader.
If you look at the ImageFileReader header, there is a default
ConvertPixelTraits template parameter, which does the 'normal' thing to
convert between common pixel types. You can specify your own
ConvertPixelTraits class if you want to do something different than the
default.
When you write a file with itkImageFileWriter, the ImageFileWriter will
attempt to write an image with the pixel type for the ImageType you give at
instantiation. If you attempt to write out an image with a pixel type
unsupported by the selected file format, the ImageIO for that file format
will either throw an exception or return an error.
On 3/13/07 10:33 AM, "Leila Baghdadi" <baghdadi at sickkids.ca> wrote:
> Hi guys,
>
> I am just wondering about the following,
>
> so far whenever I read an image, I made sure I knew the data type of the
> image in advance and used itkImage with the correct data type.
>
> so the question is if I did not want to bother with checking image data
> type in advance and just want to read the image, is there a way to make
> the code deal with data type. or should the image factory be changed.
>
> any thoughts
>
> Leila
>
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers
More information about the Insight-developers
mailing list