# Consider a non-destructive default in segment editor masking options

**URL:** <https://discourse.slicer.org/t/consider-a-non-destructive-default-in-segment-editor-masking-options/30631>\
**Category:** Feature requests\
**Created:** [July 16, 2023, 5:26pm UTC](https://discourse.slicer.org/t/consider-a-non-destructive-default-in-segment-editor-masking-options/30631 "2023-07-16T17:26:14Z")\
**Posts on this page:** 4\
**Page:** 1

<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:** [July 16, 2023, 5:26pm UTC](https://discourse.slicer.org/t/consider-a-non-destructive-default-in-segment-editor-masking-options/30631/1 "2023-07-16T17:26:14Z")

</div>

The item ‘Modify other segments’ in the masking options of the ‘Segment editor’ defaults to ‘Overwrite all’. When working with multiple segments, we may forget to switch to ‘Allow overlap’ so as to preserve prior work, and notices it when we can’t revert changes.

I hereby suggest that this item defaults to ‘Allow overlap’ rather. If it is forgotten as such, nothing is lost, and ‘Subtract’ in ‘Logical operators’ can still be used.

Thank you for considering.

Regards.

---

<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 17, 2023, 7:01pm UTC](https://discourse.slicer.org/t/consider-a-non-destructive-default-in-segment-editor-masking-options/30631/2 "2023-07-17T19:01:40Z")

</div>

This default can be set in the application startup file as described [here](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#set-default-segmentation-options).

If we get some votes on this feature request then we will add GUI for this. We would also welcome a pull request that adds this option to application settings.

---

<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:** [July 17, 2023, 7:24pm UTC](https://discourse.slicer.org/t/consider-a-non-destructive-default-in-segment-editor-masking-options/30631/3 "2023-07-17T19:24:22Z")

</div>

> [@lassoan](#):
>
> as described [here](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#set-default-segmentation-options)

This works perfectly well, thank you.

> [@lassoan](#):
>
> a pull request that adds this option to application settings

Can you please hint the location of application settings in the source tree ?

---

<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 17, 2023, 8:13pm UTC](https://discourse.slicer.org/t/consider-a-non-destructive-default-in-segment-editor-masking-options/30631/4 "2023-07-17T20:13:33Z")

</div>

Segmentation settings are implemented in `qSlicerSegmentationsSettingsPanel.cxx`.

You can implement `GetOverwriteMode()` and `SetOverwriteMode(...)` methods in vtkSlicerSegmentationsModuleLogic.cxx to get/set the default `OverwriteMode` - very similarly how `vtkSlicerSegmentationsModuleLogic::GetDefaultSurfaceSmoothingEnabled()` and `vtkSlicerSegmentationsModuleLogic::SetDefaultSurfaceSmoothingEnabled()` are implemented. You can then use these methods in `qSlicerSegmentationsSettingsPanel`.
