[vtkusers] Re: problems with LookupTable

Chr. Rossmanith cr at neuro.ma.uni-heidelberg.de
Mon Jun 11 10:26:12 EDT 2001


Hi,

my problem was a testimage with stripes being rendered in shades of gray instead of shades of red as indicated by the lookup table. This could be solved with a call to "SetColorModeToMapScalars" (thanks to Will). Next I encountered the problem that only one stripe get the correct color, the others get all the same color:

> This helps, but only for the first stripe. The others appear bright red, though they should increase in brightness from left to right.
>
> grey level       red intensity
> 0               ->  0.2
> 63             ->  0.4
> 127           ->  0.6
> 191            -> 0.8
> 255            -> 1.0

This problem could be solved by adjusting the scalar range of the input data using "SetScalarRange 0 255". Now all stripes appear in a different shade of red.

Will suggested:

> > Another observation: you are rendering an image with vtkDataSetMapper. This is very slow, since vtkDataSetMapper does the dumb thing and creates a polygon per pixel. Instead, you probably want to use the image as a texture map in combination with a plane source. (This combined functionality is performed by vtkImageActor).

And my problem with this is:

> Then I have some kind of image reader and the image actor. But where could I call SetLookupTable. I've got it working already but still in grey (but indeed it's much faster  :-)  ).

This is still unsolved. Any hints are welcome...


Christina





More information about the vtkusers mailing list