[vtkusers] custom colormap

fred fredantispam at free.fr
Thu Apr 27 10:52:40 EDT 2006


Amy Squillacote a écrit :
> Hi Fred,
> 
> You can either manually set the values in a vtkLookupTable (using
> methods like SetTableValue):
> http://www.vtk.org/doc/nightly/html/classvtkLookupTable.html, or you can
> try using a vtkColorTransferFunction:
> http://www.vtk.org/doc/nightly/html/classvtkColorTransferFunction.html.
> vtkColorTransferFunction lets you set colors for specific scalar values
> and then interpolates between them.
Ok, let's see VolumeRenderWithBoxWidget.py.

I guess the interesting part tpo create my lut is

  ctfun = vtk.vtkColorTransferFunction()
  ctfun.AddRGBPoint(0.0, 0.5, 0.0, 0.0)
  .../...
  ctfun.AddRGBPoint(4095.0, 0.5, 0.5, 0.5)

  .../...

  volumeProperty.SetColor(ctfun)

How can I save it to a file than I can load into mayavi ?

Cheers,

-- 
Fred.



More information about the vtkusers mailing list