[vtk-developers] LookupTable madness

David Gobbi dgobbi at irus.rri.on.ca
Tue May 22 13:43:00 EDT 2001


Hi Prabhu, I've moved this back to the developers list.

On Tue, 22 May 2001, Prabhu Ramachandran wrote:

>     DG> Fixing the code is easy, the only problem is that a huge
>     DG> number of regression test images will have to be re-done.
>
> So I guess that the fix involves removing the sinusoidal mapping, is
> it worth all that effort?

I consider the lookup table code incorrect, because if a person does
'SetValueRange(0,1)' they expect a linear value ramp from 0 to 1, not
a sinusoidal S-curve.  But as much as my fingers itch to fix the code,
I don't think that doing so would be a good idea.

Instead, I'll add new methods 'SetRampToLinear' and 'SetRampToSinusoidal'
and leave sinusoidal as the default (at least for now).  This isn't
ideal, because a sinusoidal lookup table should apply the sine function
to the scalar values before they are mapped to the color table (the way
the vtkLogLookupTable work), it shouldn't set up the table values
themselves in a sinusoidal ramp because this results in
uneccesarily duplicated color-table values.

Following this line of thought, there shouldn't be a separate
vtkLogLookupTable class at all ... vtkScalarsToColors should
have a method to allow the user to specify a function (i.e. log,
sin, etc) to apply to the scalar values after they have been
reduced to the range [0,1] via the TableRange, but before they
are used to index into the table.

There should also be an option in vtkScalarsToColors to specify
colors to use for scalars that are over/under the TableRange,
rather than simply using the min/max table values.

I'll make the color tables my next VTK mini-project, the changes
will be straightforward & won't break backwards compatibility
(at least in the first iteration).

 - David





More information about the vtk-developers mailing list