[vtkusers] Setting specific colors to vtkPolyData

Miri Trope miritrope at gmail.com
Sat Jan 7 12:29:33 EST 2012


Hi All,

I'm new to vtk and would like to represent some specific colors on my
vtkPolyData by vtkFloatArray.
Until now, I managed to do that in the following way but more colors have
been represented than I wanted (actually, four colors).

//calculating my vtkFloatArray
  myVtkFloatArray->
SetNumberOfComponents(1);
  myVtkFloatArray->SetNumberOfValues(numPoints);
  myVtkFloatArray->SetValue(ind, someVal);

//setting this array on mySurface scalars
mySurface->GetPointData()->SetScalars(myVtkFloatArray);

In that way I visualize the colored surface on the 3d window (of Mitk)
without the need to use the vtkRendererWindow.
Now, I'd like to set a specific color for each range of values from
myVtkFloatArray and represent less colors then are being represented now
(remove one color from the middle so it will be represented just three
colors, not four).

I searched in web and found out that look up table can satisfy my needs,
but I haven't found a method without the use of vtkRendererWindow (which I
don't need, I already have a window, as I mentioned above).

How should I do that?

Any help would be very appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120107/722c737d/attachment.htm>


More information about the vtkusers mailing list