# 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:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michele\_Bailo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/michele_bailo/32/67234_2.png) [@Michele\_Bailo](https://discourse.slicer.org/u/Michele_Bailo)\
**Post date:** [December 29, 2021, 9:33am UTC](https://discourse.slicer.org/t/how-to-disable-automatic-switch-to-master-volume-with-segment-editor/21259/1 "2021-12-29T09:33:57Z")

</div>

[ichele\_Bailo](https://discourse.slicer.org/u/Michele_Bailo)[MickyB](https://discourse.slicer.org/u/Michele_Bailo)

[1m](https://discourse.slicer.org/t/how-to-disable-the-automatic-switch-to-master-volume-with-segment-editor/21258?u=michele_bailo)

Hi there,  
I’m working with segmentations to be checked on multiple (eight) coregistered volumes that are simultaneously displayed in the layout. However, every time I change the master volume or I change the segmentation node it reset all the layout forcing me to reposition and relink over and over again all the different imaging series displayed. Is there a way to disable this automatic switch to the master volume? Would it perhaps be possible to easily select/deselect this option in the “Segment editor” module or in the “Application settings” panel?

Thank you very much for all you efforts and kindness!

---

<div class="post-metadata">

**Author:** ![Michele\_Bailo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/michele_bailo/32/67234_2.png) [@Michele\_Bailo](https://discourse.slicer.org/u/Michele_Bailo)\
**Post date:** [July 16, 2023, 8:31am UTC](https://discourse.slicer.org/t/how-to-disable-automatic-switch-to-master-volume-with-segment-editor/21259/2 "2023-07-16T08:31:22Z")

</div>

Hi, I’m still struggling with this problem (which make me waste sooooo much time every time I use Slicer) since I wasn’t able to solve it by myself.  
Do you have any suggestion on how to disable the autoshow of master volume node when you enter in the segment editor?  
thank you very much

---

<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:36pm UTC](https://discourse.slicer.org/t/how-to-disable-automatic-switch-to-master-volume-with-segment-editor/21259/3 "2023-07-16T12:36:20Z")

</div>

Automatic showing of the source volume is optional, but it is not commonly requested, so no graphical user interface was added for it. You can type this line into the Python console (or for changing it permanently, add it to the [application startup file](https://slicer.readthedocs.io/en/latest/user_guide/settings.html#application-startup-file)):

```python
slicer.util.getModuleWidget('SegmentEditor').editor.autoShowSourceVolumeNode = False

```

---

<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).

* * *

---

<div class="post-metadata">

**Author:** ![Michele\_Bailo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/michele_bailo/32/67234_2.png) [@Michele\_Bailo](https://discourse.slicer.org/u/Michele_Bailo)\
**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/5 "2023-07-16T12:52:45Z")

</div>

Thank you very, very much for your help. As a neurosurgeon I work a lot with multiple coregistered volumes, displaying them simultaneously, especially when planning procedures. Unfortunately every time I switched back to the segment editor my dataset view was reset back to the master volume, so I had to recreate my ideal view again and again again, losing a lot of time.

Thank you again a lot  
MB

---

<div class="post-metadata">

**Author:** ![Michele\_Bailo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/michele_bailo/32/67234_2.png) [@Michele\_Bailo](https://discourse.slicer.org/u/Michele_Bailo)\
**Post date:** [December 12, 2024, 3:45pm UTC](https://discourse.slicer.org/t/how-to-disable-automatic-switch-to-master-volume-with-segment-editor/21259/6 "2024-12-12T15:45:34Z")

</div>

Hi,  
I have the same problem when a new scalar volume is added. In my clinical and research practice I regularly use 3D slicer to monitor brain diseases at different time-points. Unfortunately, every time I add (or create) a new scalar volume to the scene, Slicer resets all the layouts to display the new volume, forcing me to reposition and relink over and over again all the different imaging series displayed.  
Is there a simple way to disable the behavior of automatically switching layouts when a new scalar volume is loaded?  
Many many thanks for all you help.

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [December 12, 2024, 7:47pm UTC](https://discourse.slicer.org/t/how-to-disable-automatic-switch-to-master-volume-with-segment-editor/21259/7 "2024-12-12T19:47:08Z")

</div>

> [@Michele\_Bailo](#):
>
> when a new scalar volume is loaded

If you are loading from a file, in the ‘`Load data`’ dialog, the ‘`Show`’ option can be unchecked.

 ![load_data_options](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/1/514d880353f4e247e2f9089831f470ad0b1ae070.png)

‘`slicer.util.loadVolume()`’ does this in Python.  
Type ‘`help(loadVolume)`’ in the Python console for a description of this function.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [December 12, 2024, 8:05pm UTC](https://discourse.slicer.org/t/how-to-disable-automatic-switch-to-master-volume-with-segment-editor/21259/8 "2024-12-12T20:05:40Z")

</div>

Also you may find unchecking the options to reset field of view / reset origin helpful when comparing different MR contrasts. Right click on the ‘eye’ icon in the data module.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/0/c0f48ee485f2e5706a485ae7b58426855b65496c.png)

---

<div class="post-metadata">

**Author:** ![Michele\_Bailo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/michele_bailo/32/67234_2.png) [@Michele\_Bailo](https://discourse.slicer.org/u/Michele_Bailo)\
**Post date:** [December 17, 2024, 12:29pm UTC](https://discourse.slicer.org/t/how-to-disable-automatic-switch-to-master-volume-with-segment-editor/21259/9 "2024-12-17T12:29:59Z")

</div>

Many thanks for your help.  
Unfortunately, I usually import scalar volume from DICOM files, after directly retrieving them for my hospital’s PACS network system, and I don’t see that option there.  
I also tried the Python string you suggested but it did not seem to solve the issue (perhaps I am doing something incorrectly)

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [December 17, 2024, 6:35pm UTC](https://discourse.slicer.org/t/how-to-disable-automatic-switch-to-master-volume-with-segment-editor/21259/10 "2024-12-17T18:35:36Z")

</div>

What I would typically do is load all the series of interest from the dicom module, and then use the Data module (with the orientation and field of view options unchecked) to switch between MR contrasts. I also like to use the CompareVolumes module to create linked view layouts and also setting foreground/background settings for cross-fades.

---

<div class="post-metadata">

**Author:** ![Michele\_Bailo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/michele_bailo/32/67234_2.png) [@Michele\_Bailo](https://discourse.slicer.org/u/Michele_Bailo)\
**Post date:** [December 18, 2024, 1:09pm UTC](https://discourse.slicer.org/t/how-to-disable-automatic-switch-to-master-volume-with-segment-editor/21259/11 "2024-12-18T13:09:07Z")

</div>

Thanks for the advice, I did not know about the possibility of unchecking orientation and field of view options, that certainly helps. However, it does not solve my problem completely, because if I have to import a new DICOM series of an MRI performed after 6 months of follow up in a pre-existing dataset of a patient, it will keep replacing all the existing layouts.

I used to be enthusiastic of the CompareModule feature, but I had to stop using it because it permanently engulfed the working memory and processing units once used in a specific Slicer dataset, as described in this previous post ( [“Compare Volumes” module - display order - Support / Feature requests - 3D Slicer Community](https://discourse.slicer.org/t/compare-volumes-module-display-order/31261/6))

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [December 18, 2024, 1:39pm UTC](https://discourse.slicer.org/t/how-to-disable-automatic-switch-to-master-volume-with-segment-editor/21259/12 "2024-12-18T13:39:44Z")

</div>

@Michele_Bailo It appears your Slicer issue (linked below) about the Compare module was closed after not receiving a response from you. Can you provide further information there? The issue could then be re-opened.

> <https://github.com/Slicer/Slicer/issues/7522>
>
> I'm not a computer expert (I'm a clinician and medical researcher). I posted the… issue in Slicer community forum first (https://discourse.slicer.org/t/compare-volumes-module-display-order/31261/5) and was suggested to report the issue also here. I apologize if, perhaps, I'm not doing it in right way.
> 
> I have been using the “compare volumes” a lot in the last months (with different Slicer versions, including the latest updates).
> 
> Unfortunately, I noticed that in those datasets where I used this module at least once, things start to go extremely slow thereafter: even scrolling a single series in the Red view alone shows extreme “lagging”. The problem persists even if save and close the scene, reboot the pc (which is an incredibly powerful workstation with 128 GB DDR RAM and 12th Gen Intel Core i9-12900F, 2400 Mhz, 16 Cores, 24 Logical Processors; Windows 11 Pro) and reload the saved scene.
> 
> On the contrary, this problem does not occur when I “manually” set the same number of panels, such as a “4 by 3” or even “7 by 3” scenes, without using the “compare volumes” module.
> 
> My impression is that once the “compare volumes” module is utilized to display multiple views, it somehow keeps occupying a huge amount of resources, even if the additional view-panels are not shown anymore. It gets better again if I manually delete all the additional Slice-views created from the “Data”-\>”All Nodes” module.
