[vtkusers] Problem mapping scalars to colors using a vtkLookupTable

Peter Kok peter.kok at gmail.com
Mon May 21 11:06:45 EDT 2007


Hi there,

I am trying to map certain specific scalars to colors using a
vtkLookupTable. Let's say I want to map the scalar 5 to red, 10 to green,
100 to blue and the rest to black. So what I need to do is similar to a
vtkColorTransferFunction, which I cannot use, because I want to use it for a
vtkImagePlaneWidget, which only accepts vtkLookupTables.

One option seemed to be to extend vtkLookupTable and reimplement
GetIndex(float) -> int, which I expected to map the scalar to an index in
the table values. This didn't work, but I am not sure if it is supposed to
work.

What are my options?

Regards,
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070521/f3e71cbe/attachment.htm>


More information about the vtkusers mailing list