Hi!
I’m trying to apply a transfer function to my volume-rendering. I have a custom vtkMRMLColorTableNode
, but GetScalarsToColors()
always returns a vtkLookupTable
. Is there a way to get a vtkTransferFunction
out of this?
Thanks!
Hi!
I’m trying to apply a transfer function to my volume-rendering. I have a custom vtkMRMLColorTableNode
, but GetScalarsToColors()
always returns a vtkLookupTable
. Is there a way to get a vtkTransferFunction
out of this?
Thanks!
Transfer functions are stored in volume rendering property nodes.
If you just want the colors in your table to be transferred for volume rendering, you can just click the “Sync with Volumes” checkbox in the properties in the Volume Rendering module. Then uncheck it and you can set the opacities, etc.
Thanks to you two, I managed to find the correct function in the source code!
The way I did it was as follows:
volume_rendering_logic = slicer.modules.volumerendering.logic()
.volume_rendering_node = volume_rendering_logic.CreateDefaultVolumeRenderingNodes(volume_node)
.volume_logic.CopyDisplayToVolumeRenderingDisplayNode(volume_rendering_node)
.Thanks again!