[Insight-users] How does ITK covert color image into grayscaleimage?

Chris Farmer cfarmer at scitegic.com
Wed Nov 30 02:36:51 EST 2005



Hi Albert,

Check out the itk::RGBPixel type.  If you use RGBPixel as the template type of your itk::Image, then you'll get access to the R, G, and B channels in your image.  There are some good sections on this early in the ITK software guide.  You're right that many ITK operations are not available to RGB images.  You could flatten your images to a scalar pixel type with the RGBToLuminanceImageFilter or treat it as a vector image with the RGBToVectorImageAdaptor.  There are at least a few messages in the very recent past from the list that mention these classes, and there are some examples in the ITK source distribution that show how you can work with RGB images.


Chris




 
-----Original Message-----
From: Albert Chitemyan [mailto:abbs_c at yahoo.com] 
Sent: Tuesday, November 29, 2005 11:26 PM
To: insight-users at itk.org
Subject: [Insight-users] How does ITK covert color image into grayscaleimage?

Hi all,
 
As far as I know ITK's most classes are dealing with grayscale images.
How does ImageFileReader read pixel values from color image?. 
Does it take only one component(e.g. red) of RGB, or copmute pixel value using those 3 components?(grayscale pixel value = R*a + G*b + B*c).
 
Thanks.
 
Albert
 
 

Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
Click here to report this email as spam.


More information about the Insight-users mailing list