[Insight-users] RGB Input to ImageFileReader defined with 'unsigned char' type ?

Bradley Lowekamp blowekamp at mail.nih.gov
Wed Jul 8 15:32:07 EDT 2009


Hello Sharath,

This conversion is done through with itk::ConvertPixelBuffer:
http://www.itk.org/Doxygen/html/classitk_1_1ConvertPixelBuffer.html

This class is responsible for doing all the conversions that occur  
when reading an image from a file into your itk::Image. When the types  
don't match it auto-magically converts the types. This enable one to  
read a file of chars into an itk::Image of floats with out any problems.

For you particular case it computes the luminance based on the RGB  
values to get "grey" pixels. The RGBToLuminance filter should give  
simular results as well.

Brad

On Jul 8, 2009, at 3:19 PM, Sharath Venkatesha wrote:

>
> Hi,
>
> I observed that it works, if I give RGB input image to a  
> ImageFileReader defined with 'unsigned char' type.
> Is the behaviour defined?Are there many approximations involved?
>
> I generally use  itkRGBToLuminanceImageFilter to convert RGB input  
> images to grayscale, before performing registration.
>
>
> Thanks,
> Sharath
>
>
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users

========================================================
Bradley Lowekamp
Lockheed Martin Contractor for
Office of High Performance Computing and Communications
National Library of Medicine
blowekamp at mail.nih.gov


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090708/48c6121e/attachment-0001.htm>


More information about the Insight-users mailing list