<DIV>Hi Chris,</DIV>  <DIV>&nbsp;</DIV>  <DIV>I didn't&nbsp;mean that.</DIV>  <DIV>I mean, I have got code</DIV>  <DIV>&nbsp;</DIV>  <DIV>typedef itk::Image&lt;unsigned char, 2&gt; ImageType;</DIV>  <DIV>typedef itk::ImageFileReader&lt;ImageType&gt; ReaderType;</DIV>  <DIV>ReaderType::Pointer reader = ReaderType::New();</DIV>  <DIV>&nbsp;</DIV>  <DIV>reader-&gt;SetFileName("d:\\image.bmp");//color image</DIV>  <DIV>reader-&gt;Update();</DIV>  <DIV>&nbsp;</DIV>  <DIV>unsigned char* buffer&nbsp;= reader-&gt;GetOutput()-&gt;<FONT size=2>GetBufferPointer()</FONT>;</DIV>  <DIV>&nbsp;</DIV>  <DIV>what does contain buffer? Is its elements RED(or GREEN or BLUE) channel of color image?</DIV>  <DIV>As I know it isn't so. In that case how is obtained these values?</DIV>  <DIV>&nbsp;</DIV>  <DIV>&nbsp;</DIV>  <DIV>Albert</DIV>  <DIV>&nbsp;</DIV>  <DIV>&nbsp;</DIV>  <DIV>&nbsp;</DIV>  <DIV>&nbsp;</DIV>  <DIV><BR><BR><B><I>Chris Farmer &lt;cfarmer@scitegic.com&gt;</I></B> wrote:</DIV>  <BLOCKQUOTE
 class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid"><BR><BR>Hi Albert,<BR><BR>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.<BR><BR><BR>Chris<BR><BR><BR><BR><BR>&nbsp;<BR>-----Original Message-----<BR>From: Albert Chitemyan [mailto:abbs_c@yahoo.com] <BR>Sent: Tuesday, November 29, 2005 11:26 PM<BR>To: insight-users@itk.org<BR>Subject:
 [Insight-users] How does ITK covert color image into grayscaleimage?<BR><BR>Hi all,<BR>&nbsp;<BR>As far as I know ITK's most classes are dealing with grayscale images.<BR>How does&nbsp;ImageFileReader read pixel values from color image?. <BR>Does&nbsp;it take only one component(e.g. red)&nbsp;of RGB, or&nbsp;copmute pixel value&nbsp;using those 3 components?(grayscale pixel&nbsp;value = R*a + G*b + B*c).<BR>&nbsp;<BR>Thanks.<BR>&nbsp;<BR>Albert<BR>&nbsp;<BR>&nbsp;<BR><BR>Yahoo! Music Unlimited - Access over 1 million songs. Try it free.<BR>Click here to report this email as spam.<BR></BLOCKQUOTE>  <DIV><BR></DIV><p>
                <hr size=1> <a href="http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=36035/*http://music.yahoo.com/unlimited/">Yahoo! Music Unlimited - Access over 1 million songs. Try it free.</a>