# How to merge multiple segments at once

**URL:** <https://discourse.slicer.org/t/how-to-merge-multiple-segments-at-once/30449>\
**Category:** Support\
**Tags:** build, segmentation, python\
**Created:** [July 7, 2023, 11:26am UTC](https://discourse.slicer.org/t/how-to-merge-multiple-segments-at-once/30449 "2023-07-07T11:26:05Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kitchen-Sinkk](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kitchen-sinkk/32/66688_2.png) [@Kitchen-Sinkk](https://discourse.slicer.org/u/Kitchen-Sinkk)\
**Post date:** [July 7, 2023, 11:26am UTC](https://discourse.slicer.org/t/how-to-merge-multiple-segments-at-once/30449/1 "2023-07-07T11:26:05Z")

</div>

![slicer1](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/8/0829fbfa2b13968d6d7d9b252b378739baae023c.jpeg)

 ![SLICERS](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/1/11215015765472f55927e53e7c81c3bf14b69b57.jpeg)  
as the images showed, I have mutiple segements. I can add them one by one through the “logic operators” functions. However, I like to merge or “add” them together at once. Are there any method to achieve this goal?

---

<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 8, 2023, 4:09am UTC](https://discourse.slicer.org/t/how-to-merge-multiple-segments-at-once/30449/2 "2023-07-08T04:09:05Z")

</div>

I find that the easiest to merge many segments is:

- show all the segments that you want to add (hide those segments you don’t want to add)
- select “Logical operators” effect
- select “Operation” → “Fill”
- uncheck “Bypass masking”
- select “Masking” / “Editable area” → “Inside all visible segments”
- click “Apply”

---

<div class="post-metadata">

**Author:** ![Kitchen-Sinkk](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kitchen-sinkk/32/66688_2.png) [@Kitchen-Sinkk](https://discourse.slicer.org/u/Kitchen-Sinkk)\
**Post date:** [July 12, 2023, 1:28am UTC](https://discourse.slicer.org/t/how-to-merge-multiple-segments-at-once/30449/3 "2023-07-12T01:28:45Z")

</div>

It’s work! thank you very much!

---

<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:** [July 12, 2023, 8:36am UTC](https://discourse.slicer.org/t/how-to-merge-multiple-segments-at-once/30449/4 "2023-07-12T08:36:51Z")

</div>

As this is such an important feature it would be nice to have a special entry or preset in the “Operation” dropdown like “Merge visible segments” which automates that recipe

---

<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 12, 2023, 2:09pm UTC](https://discourse.slicer.org/t/how-to-merge-multiple-segments-at-once/30449/5 "2023-07-12T14:09:32Z")

</div>

Would it be enough if the “Logical operators” effect allowed selection of multiple input segments?

---

<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:** [July 12, 2023, 2:31pm UTC](https://discourse.slicer.org/t/how-to-merge-multiple-segments-at-once/30449/6 "2023-07-12T14:31:24Z")

</div>

Probably yes, maybe also “Fill/Merge”?

---

<div class="post-metadata">

**Author:** ![Deep\_Learning](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deep_learning/32/15345_2.png) [@Deep\_Learning](https://discourse.slicer.org/u/Deep_Learning)\
**Post date:** [October 2, 2023, 3:47pm UTC](https://discourse.slicer.org/t/how-to-merge-multiple-segments-at-once/30449/7 "2023-10-02T15:47:11Z")

</div>

Could you please clarify.  
I want to merge 4 segments.

Make the four segments visible.

- select “Logical operators” effect
- select “Operation” → “Fill”
- uncheck “Bypass masking”
- select “Masking” / “Editable area” → “Inside all visible segments”

%%%$$$ Now which segment should be selected before applying?

A new empty segment? Any one of the four segments…

No matter what I do, I end up with the whole volume segmented (A big box)

[  
lassoan](https://discourse.slicer.org/u/lassoan)[Andras Lasso](https://discourse.slicer.org/u/lassoan)

[Jul 8](https://discourse.slicer.org/t/how-to-merge-multiple-segments-at-once/30449/2)

I find that the easiest to merge many segments is:

- show all the segments that you want to add (hide those segments you don’t want to add)
- select “Logical operators” effect
- select “Operation” → “Fill”
- uncheck “Bypass masking”
- select “Masking” / “Editable area” → “Inside all visible segments”
- click “Apply”

---

<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:** [October 3, 2023, 3:23pm UTC](https://discourse.slicer.org/t/how-to-merge-multiple-segments-at-once/30449/8 "2023-10-03T15:23:13Z")

</div>

You should create a new segment → “combined”. Here is a short video showing the process:

[https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/7/87621985237ec8a8a2d30e9d65e0b200a4529169.mp4](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/7/87621985237ec8a8a2d30e9d65e0b200a4529169.mp4)

Good luck.

---

<div class="post-metadata">

**Author:** ![Deep\_Learning](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deep_learning/32/15345_2.png) [@Deep\_Learning](https://discourse.slicer.org/u/Deep_Learning)\
**Post date:** [October 4, 2023, 12:02pm UTC](https://discourse.slicer.org/t/how-to-merge-multiple-segments-at-once/30449/9 "2023-10-04T12:02:31Z")

</div>

[quote=“Deep\_Learning, post:7, topic:30449”]

Thank you, I was missing the “allow overlap”.

Slicer 5.1:

- show all the segments that you want to add (hide those segments you don’t want to add)
- select “Logical operators” effect
- select “Operation” → “Fill”
- create a new Segment and select it
- uncheck “Bypass masking”
- select “Masking” / “Editable area” → “Inside all visible segments”
- select “Modify other Segments”→ “Allow Overlap"
- click “Apply”

---

<div class="post-metadata">

**Author:** ![CS1](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cs1/32/80852_2.png) [@CS1](https://discourse.slicer.org/u/CS1)\
**Post date:** [November 14, 2025, 11:47am UTC](https://discourse.slicer.org/t/how-to-merge-multiple-segments-at-once/30449/10 "2025-11-14T11:47:04Z")

</div>

Sorry lassoan, got a silly question, what happen with the overlapped volume/area between the two merged segments? would they be calculated twice Thanks!

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [November 14, 2025, 11:48am UTC](https://discourse.slicer.org/t/how-to-merge-multiple-segments-at-once/30449/11 "2025-11-14T11:48:53Z")

</div>

No, the merged segment will have no knowledge about where the different regions came from. Any statistic about the merged segment will be strictly about the contained voxel data in the segment.

---

<div class="post-metadata">

**Author:** ![CS1](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cs1/32/80852_2.png) [@CS1](https://discourse.slicer.org/u/CS1)\
**Post date:** [November 18, 2025, 12:04pm UTC](https://discourse.slicer.org/t/how-to-merge-multiple-segments-at-once/30449/12 "2025-11-18T12:04:30Z")

</div>

Thank you! this is very helpful!
