# Intersect segments stored in two different segmentations

**URL:** <https://discourse.slicer.org/t/intersect-segments-stored-in-two-different-segmentations/37305>\
**Category:** Support\
**Tags:** segmentation\
**Created:** [July 10, 2024, 2:38pm UTC](https://discourse.slicer.org/t/intersect-segments-stored-in-two-different-segmentations/37305 "2024-07-10T14:38:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Noa](https://avatars.discourse-cdn.com/v4/letter/n/919ad9/32.png) [@Noa](https://discourse.slicer.org/u/Noa)\
**Post date:** [July 10, 2024, 2:38pm UTC](https://discourse.slicer.org/t/intersect-segments-stored-in-two-different-segmentations/37305/1 "2024-07-10T14:38:24Z")

</div>

Hello, I try to intersect two segmentations : tumor1 and tumor2, segmented from volume1 and volume2. I created a transform, 2to1, to overlay segment 2 on segment 1. How do I intersect these two segmentations?  
Thank you in advance.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [July 10, 2024, 4:49pm UTC](https://discourse.slicer.org/t/intersect-segments-stored-in-two-different-segmentations/37305/2 "2024-07-10T16:49:23Z")

</div>

SegmentEditot -\>Logical operators

---

<div class="post-metadata">

**Author:** ![Noa](https://avatars.discourse-cdn.com/v4/letter/n/919ad9/32.png) [@Noa](https://discourse.slicer.org/u/Noa)\
**Post date:** [July 10, 2024, 6:33pm UTC](https://discourse.slicer.org/t/intersect-segments-stored-in-two-different-segmentations/37305/3 "2024-07-10T18:33:32Z")

</div>

Hello,  
I tried to use logical operators but I can’t do it with two different segmentations, and I need to keep them separated in order to save the transform. Moreover, I can’t seem to find the « multi select » in the segmentation module. I also tried CombineModels from the Sandbox extension but the python console says : error: bad shaped cells.  
Does someone knows how to solve this?  
Thank you for your replies.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [July 10, 2024, 6:34pm UTC](https://discourse.slicer.org/t/intersect-segments-stored-in-two-different-segmentations/37305/4 "2024-07-10T18:34:33Z")

</div>

You can copy segment(s) from a segmentation to another segmentation. Look at the `Segmentation` module.

---

<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 10, 2024, 7:10pm UTC](https://discourse.slicer.org/t/intersect-segments-stored-in-two-different-segmentations/37305/5 "2024-07-10T19:10:38Z")

</div>

> [@Noa](#):
>
> I need to keep them separated in order to save the transform

You can do the followings to keep the original segmentation but still have a transformed copy of the other segment:

- clone the segmentation (right-click on the segmentation in Data module and click `Clone`)
- apply the same transform to the cloned segmentation as was applied to the original (right-click on the transformation column of the cloned segmentation and click on the appropriate transform)
- harden the transformation (right-click on the transformation column of the cloned segmentation and click `Harden transform`)
- drag the segment from the cloned segmentation to the other segmentation

If you need to do this many times then you can automate it with a couple lines of Python script (most likely ChatGPT or Microsoft Copilot can generate the script).

---

<div class="post-metadata">

**Author:** ![Noa](https://avatars.discourse-cdn.com/v4/letter/n/919ad9/32.png) [@Noa](https://discourse.slicer.org/u/Noa)\
**Post date:** [July 10, 2024, 7:31pm UTC](https://discourse.slicer.org/t/intersect-segments-stored-in-two-different-segmentations/37305/6 "2024-07-10T19:31:09Z")

</div>

thank you very much !
