Fwd: Re: [vtkusers] Image plane widget + color transfer function?

T.R.Shashwath trshash at gmail.com
Wed Jan 30 22:39:59 EST 2008


On Wednesday 30 Jan 2008 7:36:30 pm Paul Melis wrote:
> Hello,
>
> Is there any way to accomplish the following:
> 1. Given a structured points set of integers (cell counts generated by a
> simulation, in this case)
> 2. Define a color transfer function based on threshold values (i.e.
> 0..999 cells - red, 1000-99999 green, etc).
> 3. Use a vtkImagePlaneWidget to slice through the volume using the above
> c.t.f.
>
> I can't seem to get it done without a lot of hoops to jump through. The
> problem lies in the fact that the vtkImagePlaneWidget can not use a
> c.t.f., only a vtkLookupTable.
> For this dataset the scalar values have a range of roughly [0,1500000]
> requiring a large lookup-table if done with vtkLookupTable, which feels
> like I'm abusing the class.
>
> Thanks in advance for any help,
> Paul
>

Hi Paul,

You can do it by using GetColorMap on the widget - which returns a 
vtkImageMapToColors instance that the widget uses internally - and use this 
one's SetLookupTable method.

ie, planeWidget->GetColorMap()->SetLookupTable(colorTransferFunction);

HTH,

Shash



More information about the vtkusers mailing list