# How to cut multi-segments in a segmentation node with scissors at the same time?

**URL:** <https://discourse.slicer.org/t/how-to-cut-multi-segments-in-a-segmentation-node-with-scissors-at-the-same-time/20620>\
**Category:** Development\
**Tags:** segmentation, python\
**Created:** [November 15, 2021, 6:55am UTC](https://discourse.slicer.org/t/how-to-cut-multi-segments-in-a-segmentation-node-with-scissors-at-the-same-time/20620 "2021-11-15T06:55:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hualin](https://avatars.discourse-cdn.com/v4/letter/h/f6c823/32.png) [@Hualin](https://discourse.slicer.org/u/Hualin)\
**Post date:** [November 15, 2021, 6:55am UTC](https://discourse.slicer.org/t/how-to-cut-multi-segments-in-a-segmentation-node-with-scissors-at-the-same-time/20620/1 "2021-11-15T06:55:11Z")

</div>

Hi, My slicer version is:

```nohighlight
Operating system: Arch Linux
Kernel: x86_64 Linux 5.14.16-arch1
Slicer version: 4.11.20210226

```

I tried to use `ApplyToAllVisibleSegments` effect parameter:  
[https://slicer.readthedocs.io/en/latest/developer\_guide/modules/segmenteditor.html#scissors](https://slicer.readthedocs.io/en/latest/developer_guide/modules/segmenteditor.html#scissors)

```python
volumeNode = slicer.mrmlScene.GetFirstNodeByClass('vtkMRMLScalarVolumeNode')
segmentationNode = slicer.mrmlScene.GetFirstNodeByClass('vtkMRMLSegmentationNode')
segmentationNode.CreateClosedSurfaceRepresentation()
segmentationNode.GetDisplayNode().SetAllSegmentsVisibility(1)
segmentationNode.SetReferenceImageGeometryParameterFromVolumeNode(volumeNode)

segmentEditorWidget = slicer.qMRMLSegmentEditorWidget()
segmentEditorWidget.setMRMLScene(slicer.mrmlScene)
segmentEditorNode = slicer.mrmlScene.AddNewNodeByClass("vtkMRMLSegmentEditorNode")
segmentEditorWidget.setMRMLSegmentEditorNode(segmentEditorNode)

segmentEditorWidget.setSegmentationNode(segmentationNode)
segmentEditorWidget.setMasterVolumeNode(volumeNode)
segmentEditorWidget.setActiveEffectByName("Scissors")
effect = segmentEditorWidget.activeEffect()
effect.setParameter('ApplyToAllVisibleSegments', 1)

```

Then I used mouse to cut the segments in 3D view, but only worked on the first segment.  
So, is there a way to cut multi-segments with scissors at the same time?

Thanks

---

<div class="post-metadata">

**Author:** ![Hualin](https://avatars.discourse-cdn.com/v4/letter/h/f6c823/32.png) [@Hualin](https://discourse.slicer.org/u/Hualin)\
**Post date:** [November 15, 2021, 12:25pm UTC](https://discourse.slicer.org/t/how-to-cut-multi-segments-in-a-segmentation-node-with-scissors-at-the-same-time/20620/2 "2021-11-15T12:25:25Z")

</div>

By the way, is there a way to cut multiple segments in different segmentation nodes?And How is the performance?

---

<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:** [November 15, 2021, 1:20pm UTC](https://discourse.slicer.org/t/how-to-cut-multi-segments-in-a-segmentation-node-with-scissors-at-the-same-time/20620/3 "2021-11-15T13:20:22Z")

</div>

> [@Hualin](#):
>
> is there a way to cut multi-segments with scissors at the same time?

Yes, you are lucky, @rbumm has already implemented this for you in July. Use a recent Slicer Preview Release and cCheck the “all segments” checkbox if you want to cut/fill all visible segments, not just the current one.

> [@Hualin](#):
>
> is there a way to cut multiple segments in different segmentation nodes?And How is the performance?

Segment Editor only modifies the selected segmentation. However, it is easy to move or copy segments between segmentations: drag-and-drop in the Data module, or use the Copy/move segments feature in Segmentation module.

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [November 15, 2021, 2:22pm UTC](https://discourse.slicer.org/t/how-to-cut-multi-segments-in-a-segmentation-node-with-scissors-at-the-same-time/20620/4 "2021-11-15T14:22:21Z")

</div>

> [@Hualin](#):
>
> How is the performance?

Very good, the multi-segment cut through 15 segmented vertebrae from a CT takes 2.5s on a gaming laptop.
