[vtkusers] SetScalarRange
Prabhu Ramachandran
prabhu at aero.iitm.ernet.in
Thu Jun 28 03:52:21 EDT 2001
>>>>> "MK" == Marta Kersten <8mak2 at qlink.queensu.ca> writes:
MK> I'm using PolyDataReader and PolyDataMapper to read in a vtk
MK> file which has a lookup table with 3 colour values. The only
MK> way I've been able to display the object correctly to use the
MK> three colour values is to use SetScalarRange(0,3). However, I
MK> can't use this call because I will need to use the same method
MK> to open different files that may have more than 3 colours.
MK> Any suggestions?
Cant you do something like the following?
pdr = vtkPolyDataReader()
# <setup the reader>
pdm = vtkPolyDataMapper()
# <setup the mapper and the pipeline>
r = pdr.GetPointData().GetScalars().GetRange()
pdm.SetScalarRange(r)
Ofcourse, replace PointData with CellData if that is what is
appropriate. I am also assuming that your lookup table is appropriate
for your data.
prabhu
More information about the vtkusers
mailing list