# How to disable automatic switch to master volume with Segment editor

**URL:** <https://discourse.slicer.org/t/how-to-disable-automatic-switch-to-master-volume-with-segment-editor/21259>\
**Category:** Support\
**Tags:** segmentation\
**Created:** [December 29, 2021, 9:33am UTC](https://discourse.slicer.org/t/how-to-disable-automatic-switch-to-master-volume-with-segment-editor/21259 "2021-12-29T09:33:57Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 16, 2023, 12:52pm UTC](https://discourse.slicer.org/t/how-to-disable-automatic-switch-to-master-volume-with-segment-editor/21259/4 "2023-07-16T12:52:37Z")

</div>

I was wondering if it was possible for someone to figure it out that this option existed, so I have typed the subject title of this topic into bing chat and it provided a quite useful answer:

> [You can disable automatic showing of the master volume in slice views by turning off `autoShowMasterVolumeNode` property of the segment editor widget](https://apidocs.slicer.org/master/classqMRMLSegmentEditorWidget.html)[1](https://apidocs.slicer.org/master/classqMRMLSegmentEditorWidget.html).
> 
> I hope that helps. Let me know if you have any other questions.

It did not tell how to get the segment editor widget, so I asked `how to disable automatic switching of source volume in Segment Editor in 3D Slicer by Python scripting?`

For this it provided a complete answer, although with a few lines of extra code (that did not do any harm but was not necessary).

* * *

You can disable automatic switching of source volume in Segment Editor in 3D Slicer by Python scripting. You can turn off autoShowMasterVolumeNode property of the segment editor widget to disable automatic showing of the matter volume in slice views. The new master volume is only shown in those views where the segmentation node is visible (based on view node IDs set in the segmentation’display node)¹.

Here is an example of how to disable automatic switching of source volume in Segment Editor in 3D Slicer by Python scripting:

```python
segmentEditorWidget = slicer.modules.segmenteditor.widgetRepresentation().self().editor
segmentEditorWidget.setMRMLScene(slicer.mrmlScene)
segmentEditorNode = slicer.vtkMRMLSegmentEditorNode()
slicer.mrmlScene.AddNode(segmentEditorNode)
segmentEditorWidget.setMRMLSegmentEditorNode(segmentEditorNode)
segmentEditorWidget.setAutoShowMasterVolumeNode(False)

```

I hope this helps! Let me know if you have any other questions.

¹: [Setting segmentation in SegmentEditor without changing volumes in slice views - Support - 3D Slicer Community](https://discourse.slicer.org/t/setting-segmentation-in-segmenteditor-without-changing-volumes-in-slice-views/22977)

Source: Conversation with Bing, 7/16/2023  
(1) Setting segmentation in SegmentEditor without … - 3D Slicer Community. [Setting segmentation in SegmentEditor without changing volumes in slice views](https://discourse.slicer.org/t/setting-segmentation-in-segmenteditor-without-changing-volumes-in-slice-views/22977).  
(2) Segmentations — 3D Slicer documentation - Read the Docs. [Segmentations — 3D Slicer documentation](https://slicer.readthedocs.io/en/latest/user_guide/modules/segmentations.html).  
(3) Slicer/segmenteditor.md at main · Slicer/Slicer · GitHub. [https://github.com/Slicer/Slicer/blob/main/Docs/user\_guide/modules/segmenteditor.md](https://github.com/Slicer/Slicer/blob/main/Docs/user_guide/modules/segmenteditor.md).  
(4) Segment editor — 3D Slicer documentation - Read the Docs. [Segment editor — 3D Slicer documentation](https://slicer.readthedocs.io/en/latest/user_guide/modules/segmenteditor.html).  
(5) How to disable automatic switch to master volume with Segment editor … [How to disable automatic switch to master volume with Segment editor](https://discourse.slicer.org/t/how-to-disable-automatic-switch-to-master-volume-with-segment-editor/21259).

* * *

---

_[View the full topic](https://discourse.slicer.org/t/how-to-disable-automatic-switch-to-master-volume-with-segment-editor/21259)._
