Consultation on the feasibility of developing an extension for 3DSlicer

I’m new to 3DSlicer, I’d like to ask a few questions about the feasibility of developing an extension/module for calculating the volume proportion of the confocal region in volume rendering.

The measurement of confocal regions is of great interest to many biologists.
Therefore, the main functions/features of the extension/module I’m going to develop are:

  1. The image data is visualized in volume rendering.
  2. The proportion of the volume of the confocal region can be calculated. For example, if the image data displayed in volume rendering contains red and green channels, the confocal region(overlapping region) will be displayed in yellow. Then, this extension/module will help us to calculate the volume percentage of the yellow region. In other words, to achieve the proportion calculation of the intersecting region of multiple volumes.
  3. In addition, another feature I’d like to achieve is that the above functions can be integrated into VR so that users can complete the measurement of the volume of the confocal region in VR mode.

So my question is:

  1. Are the volume rendering and multi-volume rendering of 3Dslicer developed based on VTK?
  2. Is it possible for me to complete this extension/module development with python and VTK? Could you please describe the feasibility of developing this extension/module? And to develop it, where should I start? (I noticed that the Segment Statistics module of 3DSlicer seems can already generate specific volume values.)
    Thank you so much!

Best Regards,

Yes, Slicer uses the CPU and GPU implementations from VTK for Volume Rendering. In addition, there is the SlicerPRISM extension for customizing the rendering at the shader level.

Yes, this sounds quite doable in python. You can learn how to do by following the tutorials.

Hello Pieper,
Thank you for your kind reply!
I’ll dive into the material you provide to learn the module development.
And another thing is that I’ve tested the VR mode(SlicerVR) on my local laptop, but it seems that I can’t do anything beyond moving/rotating/scaling. In the VR scene, I can only see the image data itself but not the GUI panel. Is this normal? In other words, if all the user interfaces in 3D Slicer for a normal flat screen can also be used in VR or not? For example, can I make segmentation in the VR scene?
Thank you so much!

I know that @cpinter has plans for that, using this class but I don’t know when it will be available exactly.

Hello Pieper,
Ok, maybe I can also check with @cpinter later.
One more thing is that the loadable module ‘volume rendering’ and the extension ‘SlicerVR’ are both written in C++. Therefore, is it possible to develop an extension based on them in python? Or the development must/better be in C++?
Thank you!

Those are both written in C++ because they involve some hardware access and have performance requirements, but they expose rich APIs to Python, for most use cases I can think of Python gives you more than enough control and performance. Good luck!

So that’s means I can develop any features I want in python and add them to 3D Slicer?
You mentioned that both of them expose APIs to Python, could you please provide the link?
Thank you so much!

There’s a lot of good material in the developer tutorials that should get you going. It’s very powerful once you get familiar with it.

Thank you for your kind help and prompt reply!
I’ll learn from those materials first.
Although for now I’m a beginner and have very limited project development and programming experience, and even I’m not totally clear with the specific feasibility, through communicating with you and the materials you provided, I can feel that I can get a lot of references and help from this community to develop a new module/extension.

Now, I’m learning the basic knowledge of VTK development and Python from some online tutorials.
At first, I think I need to get familiar with how to achieve volume rendering with VTK and python, and after that, I will try to find a way to combine these experiences to develop new features in 3D Slicer. Even the first step is challenging for me… But I’ll try my best to be familiar with python and VTK development for future extension/module development.
What do you think? If you have any suggestions, please let me know. Thank you so much!