[vtkusers] Re: problems with LookupTable

xiong fei xfpku at yahoo.com.sg
Tue Jun 12 09:44:21 EDT 2001


Hello, Christina

    I am now encountering the same problem as yours.
My data is a long series of historical security info,
and the x, y,z is date, close price and volume
respectively. I calculate the return of each day and
make it as the scalar. A lookup table is built to map
the scalar into hue, and the source code is:

  vtkLookupTable *Luptable = vtkLookupTable::New();
    Luptable->SetTableRange(Minscalar, Maxscalar);
    Luptable->SetNumberOfColors(256);
    Luptable->SetHueRange(0.0, 0.667);
    Luptable->Build();

    scalar value changes from -0.09 to 0.13. However,
the result comes to be a lot of red stripes. Am I
wrong in the mapping or is there anything special for
vtkLookupTable? All advices are cordially appreciated.

Best regards
Xiong Fei, Peter

--- "Chr. Rossmanith" <cr at neuro.ma.uni-heidelberg.de>
wrote: > 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
> 
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at:
> <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers


__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send dad a Father's Day Card!
http://greetings.yahoo.com.sg/




More information about the vtkusers mailing list