Re: Colour Maps

New Message Reply Date view Thread view Subject view Author view

Robert Grzeszczuk (rg)
Wed, 21 Jul 1999 10:27:01 -0700 (PDT)


Chris,

Both your conclusions are right. FLOAT texels need to fall within <0,1> in
order to be interpreted correctly (any values outside this range will be
clamped as they pass through the pixel path, consult the Red Book for details).
 Therefore you do need to scale your data accordingly. This is exactly the
reason why voAppearanceActions::dataScaleRange() action was provided. But as
luck might have it, there is a bug in release 1.1 that prevents FLOAT data from
being scaled correctly. This problem was fixed with patch3696.

Incidently, you are better off not using FLOAT data type for efficiency's sake.
 Your data will not only take more space (4 bytes per channel vs. 2 bytes for
ushort with no gain in precision due to hardware limitations) but also some
operations will take more time due to internal conversions (e.g., download rate
may be slower for FLOATS).

-rg

On Jul 21, 3:29pm, C I Knowles wrote:
> Subject: Colour Maps
>
> I wondered if anyone could explain the following:
>
> I might be being stupid and its only a small mistake but....
>
> I've been experimenting with using a look up table with datasets of
> different types and have some strange results (voRenderingMode is
> MONOCHROME). When using voDataType of BYTE there are no problems - the
> CT.Head.Small.char.tif dataset is displayed correctly with the look up
> table disabled and enabled.
>
> However, to extend my code I want it to be able to cope with data of
> different types. Hence I used the same dataset (CT.Head.Small.char.tif)
> and changed it to float, before copying into the bricks. My code
> actually receives a pointer to the data which is in memory already -
> I've written a routine to copy it into the bricks.
>
> So the data which I'm sticking in the bricks is of type FLOAT and is
> between 256 and 0 as all I've done is cast it. The following occurs...
>
> With the lookuptable disabled I get a mess.... the head is just about
> there but there are obvious problems with grey level values. What seems
> to be happening is grey levels are assigned for 0 to 1 properly but not
> for values greater than 1. This should be expected I believe. To check
> this I cast the data to type float as before and also scaled it to
> between 0 and 1 manually before reading into the bricks, the head is
> then displayed correctly. Hence when using voDataType float it works if
> values are between 0 and 1.
>
> So I thought I should now be able to load the float data into the bricks
> with values between 0 and 256, scale it to between 0 and 1 using the
> 'voAppearanceActions::dataScaleRange' method and get the same results.
> But I don't......(see attached pic1.gif). It looks as though the grey
> levels are assigned before the data is scaled to between 0 and 1, like
> before. If this is the case what is the use of the
> 'voAppearanceActions::dataScaleRange' method? Or am I making a mistake?
>
>
> Thanks,
>
> Chris
>
> [ Attachment (image/gif): "pic1.gif" 51091 bytes
> Encoded with "base64" ]
>-- End of excerpt from C I Knowles


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Nov 01 1999 - 14:11:14 PST