[Insight-users] Re: accessing the component of an RGBPixel

Luis Ibanez luis.ibanez@kitware.com
Tue, 07 Jan 2003 10:03:30 -0500


Hi Zein,


The syntax you are using is fine.

The SetRed() method should accept your expression

     pixel.SetRed( value + 20 );

Could you give us more details on the problem you find ?
Is this a compiler error ?

It could be just a type casting problem...

    Please let us know

      Thanks


       Luis


------------------------------------------------
Zein Salah wrote:
> Hi Luis,
> 
>  
> 
> I need to access the individual components of an RGBPixel. Mainly, I 
> want to increase the red component of some pixels in the image.
> 
> I habe written a code like this:
>  
>    typedef itk::RGBPixel<unsigned char> ColorPixelType;
> 
>    ColorPixelType m_Pixel;
>       m_Pixel.SetRed( m );
> 
> But I could not write something like
>  
>      m_Pixel.SetRed( m +20 );
> 
> What is the right syntax to increase the red value??
>  
> Many thanks,
> 
> Zein
> 
>  
> 
>  
> 
> ->8<------------->8<------------->8<------------->8<------------->8<------------->8<-
> Zein I. Salah
> Universität Tübingen, WSI-GRIS, Sand 14, 72076 Tübingen
> Email: salah@gris.uni-tuebingen.de <mailto:salah@gris.uni-tuebingen.de>  
> / zeinsalah@hotmail.com <mailto:zeinsalah@hotmail.com>
> Tel.: (07071) 29 75465 (GRIS) , (07071) 25 69 43 (privat)
> Fax: (07071) 29 54 66
>