How to display volume rendering of large volume Images

Hello, I have been learning VTK for one year. This is my first question. I met some questions about the visualization of large capacity images, about 50GB,100GB,500GB,1TB. These are some TIFF microscopic images, so the images is very large. Now i tried to display these images in volume rendering. but it seems that the performance of the GPU card is insufficient, causing the driver to report an error, as shown in the following figure.
system: win 10 x64
CPU:Intel Xeon E5-2680 v4 @ 2.40GHz (X2)
Memory: 256GB
GPU: NVIDIA RTX A4000

So how can I solve this problem? Thanks a lot.

@Timothee_Chabat

Hello @tong_yang ,

Most likely the image is given entirely to the GPU , causing it to crash because it cannot fit the too big image. What are the mappers / actors / render view classes that you are using ? Some mappers allows for image streaming and this feature may solve your issue.

Thank you for your reply. I use these classes, such as vtkSmartVolumeMapper,vtkVolume,vtkVolumeProperty,vtkRenderer。And i found suggestions on NVIDIA’s official website, https://nvidia.custhelp.com/app/answers/detail/a_id/3633。I know that this is really caused by the insufficient performance of the GPU, but I still want to know whether there are other ways to optimize and improve this situation, such as using VTK in other ways.

There are a few things that come to my mind for improving peformance without changing the size of the image :

  • disable the Shade option → vtkVolumeProperty::SetShade(bool), if it was enabled
  • check https://vtk.org/doc/nightly/html/classvtkOpenGLGPUVolumeRayCastMapper.html#ab3fe2913f0a5282d3aa7550f22acbd98 for partitioning the volume into smaller volume
  • Disable the option AutoAdjustSampleDistances on the mapper and set the sample distance by hand with SetSampleDistance(float) : greater is faster (but rendering might look bad)
  • If you already know what part of the image you want to render, you can use the Cropping options of the mapper.
  • Use directly vtkOpenGLGPUVolumeRayCastMapper instead of vtkSmartMapper to avoid some overhead and to have more control over the rendering

Hello @Timothee_Chabat ,

Thank you again for your reply, I tried these methods according to your suggestions, which helped a little, but it was not big. There was no error when the mouse interacted, but the jamming was very serious. So I want to ask:

  1. Whether vtk supports volume rendering of such large images during design, development and testing
  2. Have you tried to display such a large image? How about the situation and the software and hardware configuration
  3. Are there any open source software specially designed to display such large images

Hello @tong_yang ,

VTK per se is not the kind of software you’re looking for because your problem basically boils down to : image is very big but you want to visualize the whole image anyway. What you may want to try instead :

  • use OSPRay in VTK : for datasets this big it can sometimes help to use the CPU instead of the GPU (that is if you have lots of RAM and a good CPU)
  • use ParaView : this is a software that uses VTK under the hood but that has a client / server architecture and allows multiple server. So for example if you have multiple computers with a good graphic card available, run a pvserver on each of them and use paraview to visualize the image. ParaView will split evenly the image so each GPU has to do less works, and compose the image afterwards.

[EDIT]

ParaView can also work if you have multiple GPUs on a single computer, just spawn as many pvserver as GPU available and assign a single GPU per server.
You may want to read https://docs.paraview.org/en/latest/ReferenceManual/parallelDataVisualization.html

Hello @Timothee_Chabat ,
In these months, i tested OSPRay, I found that if the CPU power is sufficient, it can meet the image rendering below 500GB. Although the interactive speed is only 1-2 FPS, it can at least run normally, which has met my needs·. But I found several problems about OSPRay:

  1. Setting vtkOSPRayVolumeMapper:: SetBlendModeToMaximumIntensity has no effect
  2. Multiple instances cannot be displayed in one window, or I use them incorrectly
  3. The transform function is not normal and has no effect, such as translation, rotation and scaling

Finally, thank you for your reply, which gave me a lot of help.

Hello @tong_yang ,

I’m glad that you’re happy with the OSPray solution ! :slightly_smiling_face:

According to OSPray documentation there is no such API for volume so I believe it is not supported by OSPRay itself. Intel OSPRay Documentation

I can confirm that when displaying multiple volumes in ParaView there is some issues. It displays but rendering is incorrect and crash in some situation.

I can confirm that it doesn’t work either with ParaView for volumes (it works for surfaces). I’m not sure whether this is a limit of VTK or OSPRay.

For point 1 and 3 maybe @Dave_DeMarle may have more infos ?

Also, do not hesitate to open issues on VTK gitlab https://gitlab.kitware.com/vtk/vtk/-/issues/ if your compfortable with it :slightly_smiling_face:

FYI @sankhesh

Hello @Timothee_Chabat,
Thank you for your reply. Now I already know that the performance of a single machine can’t do this work well, i want to try VTK MPI Distributed randering, can it use the resources of multiple machines to complete the rendering work?

If so, this is also a good method to solve my problem. I known that the ParaView can do this, but ParaView is too complex and huge for me. I hope to find a simplified example to test and realize the visualization of large-capacity images by VTK distributed rendering.

Finally, thank you for your reply, which gave me a lot of help.

Hi @tong_yang,

Glad that the answers @Timothee_Chabat gave you were helpful!

The OSPRay solution should work in a distributed context (multiple communicating MPI nodes each holding part of the data set in memory).

Be forewarned however, when using ray tracing in parallel some artifacts may pop up in the rendering: https://gitlab.kitware.com/paraview/paraview/-/issues/21353. This mostly seems to be related to the fact that each MPI node renders the data it has on hand without consideration for the data on other nodes I believe. To my knowledge, this kind of issue has not yet been tackled and can be relatively difficult to solve. I could be wrong on this point.

Best of luck!