How to change volume'color ?

@Lee wants to know how to replicated ParaView’s volume rendering result in VTK, so it is appropriate for this forum.

You’ll need to set the color transfer function and opacity function to match what is in ParaView. Here is an example of how to set up such functions: https://lorensen.github.io/VTKExamples/site/Cxx/VolumeRendering/SimpleRayCast/.

Then, you’ll need to translate the transfer function settings from ParaView to code like in the example. Look at the values in the color table and opacity table in the Color Map Editor in ParaView (these are advanced settings, so click the gear icon to show them). Here’s a screenshot showing what I mean:

The gear button is on the right side near the middle of the image, and the values and colors are shown in the tables below that. Note that the color space is important.

Good luck!

1 Like