[Insight-users] Generic Image Reader

Andinet Enquobahrie andinet.enqu at kitware.com
Wed Jan 2 10:31:29 EST 2008


Hi Sumit,

Take a look at

http://insight-journal.org/midas/handle.php?handle=1926/495

The IO classes contributed along with this paper demonstrate  how you can
determine the pixel type and then instantiate the appropriate
type of reader.  For you purpose, you will need to extend the classes to
handle color pixel types.

HTH,
-Andinet

>Hello
>I have a question regarding Image File reading. For
>simplicity I would like to read a 2D image (grayscale
>or color), but it can very well extend to
>multi-dimensional images.
>
>Is there a way in itk to template this operation,
>rather that writing two specific instances ?
>
>For example,
>
>typedef float PixelType;
>typedef itk::RGBPixel<PixelType> RGBPixelType;
>typedef itk::Image< RGBPixelType, 2 >                 
>CImageType2D; 
>typedef itk::ImageFileReader<CImageType2D> readerC;
>
>would be one such example for reading a 2D RGB image.
>Similarly, I can write something for a grayscale
>image;
>
>For example,
>typedef itk::Image< PixelType, 2 >GImageType2D;
>typedef itk::ImageFileReader<GImageType2D> readerG;
>
>Now, is there a way to "generalize" this process via
>templates ? Or is there a way in itk to automatically
>determine what type of image is being read ? Or are we
>resigned to using a default RGBPixel for reading the
>image, no matter what type of input is being read
>(something similar to QImage in Qt).
>
>Your inputs will be greatly appreciated.
>Sincerely
>Sumit
>
>
>      Looking for the perfect gift? Give the gift of Flickr! 
>
>http://www.flickr.com/gift/
>
>_______________________________________________
>Insight-users mailing list
>Insight-users at itk.org
>http://www.itk.org/mailman/listinfo/insight-users
>
>  
>


-- 
==========================================================
Andinet A. Enquobahrie, PhD
R&D Engineer
Kitware Inc.

28 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-371-3971 x124
www.kitware.com




More information about the Insight-users mailing list