[vtkusers] How to create volume with color in vtkLookupTable?

Andrej Gluhov realandron at gmail.com
Mon Aug 29 09:10:33 EDT 2011


Hello!

I create vtkImageData with vtkLookupTable. How I can create vtkVolume with
the same colors?

_lookupTable = new vtkLookupTable();
_doseColorMap = new vtkImageMapToColors();

double[] doseRange = (_source.GetScalarRange());
_lookupTable.SetNumberOfTableValues(100);
_lookupTable.SetHueRange(0.83, 0);
_lookupTable.SetTableRange(doseRange[0], doseRange[1]);//min dose,max dose
_lookupTable.Build();

_doseColorMap.SetInput(_source);
_doseColorMap.SetOutputFormatToRGBA();
_doseColorMap.SetLookupTable(_lookupTable);
_doseColorMap.Update();

then I create volume:

_volumeMapper = new vtkVolumeTextureMapper3D();
_volumeMapper.SetInput(doseColorMap.GetOutput());

_volume = new vtkVolume();
_volume.SetMapper(_volumeMapper);

But volume is black.

-- 
С Уважением,
Андрей.
Best regards, Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110829/d400ff5e/attachment.htm>


More information about the vtkusers mailing list