Is it possible to overlay two raycast volumes in the same render window?

Hi everybody,
I would like to render two different volumes using two different color maps in the same renderer. I can’t tell if this is currently possible in VTK. This post makes me think it is not yet possible:

However, the VTK-based Slicer does appear to have a module that can do this. See the beautiful CT-PET overlay example on this page:
https://www.slicer.org/w/index.php/Modules:VolumeRendering-Documentation-3.6

Any wisdom would be appreciated.
-Merps

That multi-volume renderer was a custom implementation developed 10 years ago. VTK changed a lot since then, so there would be no chance of bringing that back to life.

Fortunately, multi-volume renderer has been added to VTK recently, so custom implementations should not be needed anymore. However, this multi-volume renderer is not usable for much yet, as it does not do any shading. We spent a little time trying to add this feature, but ran into problems (volume rendering succeeding/failing randomly) that we did not have enough time to understand and fix.

We are so close to having multi-volume rendering capability in VTK… I hope Kitware will get a contract soon that would allow them to finish it up. We could contribute by a few k$ towards this goal. If a couple of other groups could make a pledge, too, then something might happen.

1 Like

Thanks (as always) Andras.
It vtkMultiVolume (https://vtk.org/doc/nightly/html/classvtkMultiVolume.html) the functionality you’re referring to?

Yes, that’s it.

Here are the changes that (almost) make multi-volume rendering work with shading:

Gracias.

Hello everyone,

does anyone know if this issue is solved or if any progress have been made in the latest VTK Version 9.xx regarding the multi-volume render?

Thank you very!
Miss Mac.

In my this post, I have tested multi-volume rendering with the latesst VTK. There are two vtkVolume objects in a vtkRenderer and rendering result seems not bad. But if you want to manipulate one of them, such as setVisibility or setUserMatrix, some problems will occur. You can find some ways used in 3D Slicer. Hope it helps you.

Thank you Harrison for your quick answer.

I am using VTK 8 and did the rendering of two volumes similar to yours mentioned in the post.
The rendering indeed looks OK, but I am not able to apply any light settings i.e. Ambient, Diffusion, Specular it was mentioned in the post as well.

Is this now supported in VTK 9.
I am considering upgrading to VTK9 but only if it is supported in the new version.

Thanks in advance!

I only use some general functions of volume property to set shading, and it seems to be OK.

multiVolume->GetProperty()->ShadeOn();
multiVolume->GetProperty()->SetInterpolationTypeToLinear();
multiVolume->GetProperty()->SetAmbient(0.2);
multiVolume->GetProperty()->SetDiffuse(1.0);
multiVolume->GetProperty()->SetSpecular(0.0);
multiVolume->GetProperty()->SetSpecularPower(1.0);
multiVolume->GetProperty()->SetScalarOpacityUnitDistance(0.8919);