Show specific tissue on vtkVolume

I have a vtkVolume on a vtkRenderer, with AddRGBPoint call and AddPoint call for vtkColorTransferFunction and vtkPiecewiseFunction used for vtkVolumeProperty.
Is there any possibility to color in a solid color (red or something) just specific tissue, let say, a nerve canal, which, theoretically, I know hounsfield unit ?

Except very dense and sparse materials (such as bone, metal, air, and some contrast agents), you cannot simply visualize a structure in a CT image by specifying an intensity range. The result is typically extremely noisy and you pick up all kinds of other structures with similar intensity. You can play with transfer functions in 3D Slicer Volume Rendering module or Paraview image visualization settings to see it for yourself how well it works on your images.

Usually you segment the structures that you are interested in, with segmentation methods that are based on a combination of image intensity, gradient, etc. constrained with spatial smoothness, continuity, shape models, etc.

1 Like

In order to solve this task quickly, is there any method to draw a irregular line inside of the vtkVolume ? In this way, user can virtually draw itself this nerve canal, with a red or blue thick line … can you help me a little bit ?

Yes, you can “draw” the nerve canal in an image. This is not a VTK-level but an application-level feature, because you need multiple views, effective ways to position and orient slice views, review and adjust point placement, etc. See for example how it can be done using 3D Slicer:

1 Like

I am pushing my luck if I ask you where is the specific code for application-level code for drawing line ? I am thinking to study a little bit, maybe I can d a similar thing in my VTK app.

3D Slicer is open-source, without any restrictions, so you can copy paste any code from it: https://github.com/Slicer/Slicer

Of course your time is much better spent on customizing/extending Slicer instead of copy-pasting it piece by piece, as by building on Slicer you get tons of features, free maintenance and support, testing by thousands of users on multiple operating systems, etc.