Drawing shapes in volume rendering

This is my first post on this forum, and I am new to Slicer. Hopefully you will be tolerant :slight_smile:
I want to create a shape, which would be visible in VR - the best approach would be to use Fiducials (as they are easy to move once placed) and possibly connect them by lines to draw a shape. I need to draw a triangle. I suppose. it could be a segment in 3D.
Any ideas what would be the best and easiest approach?

If you went to draw a point and a triangle line, the best method is “CurveMaker” module.

1 Like

Thanks for your input. I have tested the functionality - it is on the right path to the destination :slight_smile:
My intention is to have a plane/area (surface?) between the dots.

Curve is on the left, and I want to have an area like on the right.
Any insights how this could be achieved?

Ok, I managed to get it to work. I found a plugin markup to model and it had a function “closed surface”.
Now I can generate such model:

Now I have additional question - if I try to make it transparent, it disappears - despite the skull having no visible voxels in the clipping ROI, it does not show model in it with transparency - any ideas how it could be solved?

Note that there is already a Segment Editor effect (“Surface cut”), available in SegmentEditorExtraEffects extension, which uses MarkupsToModel module to create segments. I would recommend using this effect and tune it as needed, instead of redeveloping this effect from scratch.

To show semitransparent models correctly, you need to enable depth peeling in the 3D view:


1 Like

Ok, I followed your advice - I can easily segment a triangle shape surface (which is perfect), however, I still can’t achieve to have semi-transparency in 3D rending whatever I do. Any ideas?

It looks good. To adjust opacity, move the opacity slider in Display section / 3D row.

If I subtract any amount (ex 10%) it instantly disappears completely:

If I make some other projection where are no structures behind the segmented region, it appears translucent. But if there is any structure behind it, it does not appear at all. It seems that the shape instantly goes to the background and only appears if are are no other structures in the same projection.

On certain graphics cards, depth peeling does not work well in Slicer-4.8.1 and you need to use latest nightly version (not older than a couple of days).

I’ve just noticed that you may use volume rendering. The title of the post was just “VR” instead of volume rendering, and I assumed that this is a project about virtual reality. Nowadays, it is better not to use the VR acronym.

Compositing of volume rendering and transparent surfaces may not be correct. However, these should work:

  • Option A: show volume rendering and opaque surface models
  • Option B: segment your volume using Segment Editor and show transparent surfaces
  • Option C: edit your volume, for example, using Mask Volume effect in Segment Editor. Requires installation of SegmentEditorExtraEffects extension.
  • Option D: show volume rendering and show surface models as wireframe (Models module / Display / Representation)
1 Like

yes, I am talking about volume rendering. I have into it deeper - I tried 4.9.0 nighly, but with it I have a problem, it does not save segmentations.

What do you do? What do you expect to happen? What happens instead? What operating system? Any related error in the log?

I go to segmentations, create a segment (surface cut), mark the fiducials (as I did in 4.8.1), click “Apply”. When I click to return to Segmentations view the newly segmented triangle disappears.

I do have errors in error log:

void __cdecl qSlicerSegmentationsModuleWidget::onEditSelectedSegment(void) : MRMLNodeComboBox_Segmentation is not found in Segment Editor module

Traceback (most recent call last):

  File "C:/Users/Jonas/AppData/Roaming/NA-MIC/Extensions-26909/SegmentEditorExtraEffects/lib/Slicer-4.9/qt-scripted-modules/SegmentEditorSurfaceCutLib/SegmentEditorEffect.py", line 255, in onApply
    self.logic.cutSurfaceWithModel(self.segmentMarkupNode, self.segmentModel)
  File "C:/Users/Jonas/AppData/Roaming/NA-MIC/Extensions-26909/SegmentEditorExtraEffects/lib/Slicer-4.9/qt-scripted-modules/SegmentEditorSurfaceCutLib/SegmentEditorEffect.py", line 455, in cutSurfaceWithModel
    modMode = slicer.qSlicerSegmentEditorAbstractEffect.ModificationModeAdd
AttributeError: 'module' object has no attribute 'qSlicerSegmentEditorAbstractEffect'

In 4.8.1 I installed firstly Markups to Model and then SegmentEditorExtraEffects. In 4.9.0 nightly I installed instantly SegmentEditorExtraEffects and Markups to Model was installed together as a dependency.

Standard segmentations (draw, paint) works just fine.
Operating system: Windows 10 64 bit.

P.S. Thanks for fixing the markup - I will get used to using them.

I’ve pushed a fix, the surface cut effect should work correctly in tomorrow’s nightly version.

1 Like

@jcfr did some investigation and it turned out that mixing transparent surfaces with volume rendering is supported in recent VTK versions; and updated Slicer to take advantage of this option. The feature will be available in the nightly builds from tomorrow. Thanks a lot Jc!

Great. Thanks for guiding me all this way step by step. I will test the new

Best regards