Hi Eric,<br><br>Try removing all points and modifying the same color transfer function, instead of creating a new one... It seems to work for us.<br><br>Shash<br><br><div class="gmail_quote">On Tue, Dec 21, 2010 at 6:33 AM, Eric Foo <span dir="ltr">&lt;<a href="mailto:foo@iastate.edu">foo@iastate.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi all,<br>
<br>
Does anyone know how I can update the color transfer function for a vtkOpenGLGPUVolumeRayCastMapper type volume?<br>
<br>
The volume is constructed like so:<br>
<br>
_volumeProperty = vtkVolumeProperty::New();<br>
_volumeProperty-&gt;SetColor(_color);<br>
_volumeProperty-&gt;SetScalarOpacity(_opacity);<br>
_volumeProperty-&gt;SetInterpolationTypeToLinear();<br>
_volumeProperty-&gt;ShadeOff();<br>
<br>
_gpuVolumeMapper = vtkOpenGLGPUVolumeRayCastMapper::New();<br>
_gpuVolumeMapper-&gt;SetImageSampleDistance(_imageSampleDistance);<br>
_gpuVolumeMapper-&gt;SetSampleDistance(_sampleDistance);<br>
_gpuVolumeMapper-&gt;AutoAdjustSampleDistancesOff();<br>
_gpuVolumeMapper-&gt;SetInput(_voxels);<br>
<br>
_volume = vtkVolume::New();<br>
_volume-&gt;SetProperty(_volumeProperty);<br>
_volume-&gt;SetMapper(_gpuVolumeMapper);<br>
<br>
To swap between different predefined color transfer functions, I call:<br>
<br>
_volumeProperty-&gt;SetColor(someNewColor);<br>
<br>
This is where the problem starts. The only way the volume will update to the new color is if I delete the current volume mapper and then recreate it with the new color transfer function, which is bad for performance. I&#39;ve tried calling _volume-&gt;Update() and _gpuVolumeMapper-&gt;Update(), which doesn&#39;t seem to work.<br>

<br>
Any help or ideas would be appreciated. Thanks in advance!<br>
<br>
eric<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br>