[Insight-users] casting question
smythek at u.washington.edu
smythek at u.washington.edu
Wed May 24 11:10:55 EDT 2006
Thank you for your advice. I found out that the RGBToLuminanceImageFilter does what I wanted (convert RGBPixel to a grayscale value of type float).
Kathy
On Wed, 24 May 2006, Martin Urschler wrote:
>
> hi
>
> If you want to cast a vector pixel type (RGB color is a vector entity with 3
> entries, one for red, one for green, one for blue, each of these entries being
> unsigned char) to a scalar pixel type like float you have to somehow provide a
> casting method since (I hope) there are no default ways how a vector is cast to
> a float
>
> however you will have the problem how to define this cast... how do you combine
> 3 unsigned char values to form a single float?
>
> perhaps you should explain in more detail what you intend to do in your
> application...
>
> greetings,
> Martin
>
> smythek at u.washington.edu wrote:
>> Hi,
>>
>> I have 2 color images that are 24bpp each, so I believe they are of type
>> RGB. I read in the images as InputPixelType=RGBPixel<unsigned char>, then
>> recast it to just PixelType=float so I can run the PasteImageFilter.
>
>
>
More information about the Insight-users
mailing list