[vtkusers] lookup tables

Sergio Andres sergio at unizar.es
Thu Sep 9 13:08:36 EDT 2004


Hi all,

My problem with vtkLookupTable is the following:

First, I have a vtkImagePlaneWidget object and
some vtkImageViewer2 objects to show 2D images.

I would like to have a unique vtkLookupTable so that the imagePlaneWidget
and the viewers can share it, and display the images with the same colors.

So I created a vtkLookupTable and defined all the table values (256).
Then I called vtkImagePlaneWidget::SetLookupTable(myLUT) and
imageViewer2->GetWindowLevel()->SetLookupTable(myLUT).

On execution time, the window width and window level values are 
modified, and
these values define the range of the LUT: vtkLookupTable::SetRange(min, 
max).

But the imageViewer2 seemed to ignore the LUT, and I decided to call also
vtkImageViewer2::SetColorWindow() and SetColorLevel()...
and the colors change in this way... but they are not the same as those 
in the vtkImagePlaneWidget..
because I think vtkImageMapToWindowLevelColor (defined inside 
vtkImageViewer2 to
generate unsigned char images..) works in a different way ...

So.. how could I display the images with the same colors in
both vtkImagePlaneWidget and vtkImageViewer2??

Thanks in advance.
Sergio




More information about the vtkusers mailing list