# Computing intersection between volume and segmentation

**URL:** https://discourse.slicer.org/t/computing-intersection-between-volume-and-segmentation/38334
**Category:** Support
**Tags:** segmentation, segmentations, segment-editor
**Created:** [September 11, 2024, 9:03pm UTC](https://discourse.slicer.org/t/computing-intersection-between-volume-and-segmentation/38334 "2024-09-11T21:03:28Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Josh\_Gregory](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/josh_gregory/32/77908_2.png) [@Josh\_Gregory](https://discourse.slicer.org/u/Josh_Gregory)
#### Post date: [September 11, 2024, 9:03pm UTC](https://discourse.slicer.org/t/computing-intersection-between-volume-and-segmentation/38334/1 "2024-09-11T21:03:28Z")

</div>

Hi everyone,

I am dealing with some skull-stripped CTA scans that I have imported as a Volume and the corresponding segmentations imported as a Segmentation. I have some parts of the segmentation that do not map to the skull-stripped scan (i.e. the segmentation is of the neck but the skull-stripped scan does not have this). Is there a way edit the segmentation so that only the segmentations are the ones that intersect the CTA scans? I’ve attached an image of what I would like to do; the red circles show the segmentations that I would like to delete, and the green circles show the segmentations (around the brain stem) that I would like to keep.

Does anyone have any suggestions for how to do this?  
Thanks!

---

<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: [September 11, 2024, 11:48pm UTC](https://discourse.slicer.org/t/computing-intersection-between-volume-and-segmentation/38334/2 "2024-09-11T23:48:47Z")

</div>

Not seeing the images - repost?

In any case you should be able to do what you describe with the Segment Editor and logical operations.

---

<div class="post-metadata">

### Author: ![Josh\_Gregory](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/josh_gregory/32/77908_2.png) [@Josh\_Gregory](https://discourse.slicer.org/u/Josh_Gregory)
#### Post date: [September 12, 2024, 12:05am UTC](https://discourse.slicer.org/t/computing-intersection-between-volume-and-segmentation/38334/3 "2024-09-12T00:05:23Z")

</div>

Oops, sorry about that!

Here’s the image.  
 ![seg](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/8/2802da4eace22f8d08326aacca251379f1a42e0f.png)

I tried doing it with the Segment Editor, but it seemed as though i was running into issues due to the segmentations being a Segmentation and the scans being a Volume. I tried converting it to a LabelMapVolume and then that to a Segmentation, but each pixel was segmented instead.

---

<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: [September 12, 2024, 12:23am UTC](https://discourse.slicer.org/t/computing-intersection-between-volume-and-segmentation/38334/4 "2024-09-12T00:23:24Z")

</div>

You should just make a new segment and use the Threshold tool to select just the brain allowing overlap with the vessels. Then use the logical operators to keep just the vessels that are also in the brain. Use the CTA as the reference volume for thresholding.

---

<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: [September 13, 2024, 8:28am UTC](https://discourse.slicer.org/t/computing-intersection-between-volume-and-segmentation/38334/5 "2024-09-13T08:28:13Z")

</div>

The figure in this section helps understanding the way how different data types interact in Slicer  
[https://slicer.readthedocs.io/en/latest/user\_guide/user\_interface.html#review-loaded-data](https://slicer.readthedocs.io/en/latest/user_guide/user_interface.html#review-loaded-data)

We just released a new tutorial for segmentation. I think it would be helpful

> **[GitHub - Slicer/SlicerSegmentationFor3DPrintingTutorial: Segmentation for 3D Printing Tutorial for 3D...](https://github.com/Slicer/SlicerSegmentationFor3DPrintingTutorial)**
>
> Segmentation for 3D Printing Tutorial for 3D Slicer

I suggest reading this page as well  
[https://slicer.readthedocs.io/en/latest/user\_guide/image\_segmentation.html](https://slicer.readthedocs.io/en/latest/user_guide/image_segmentation.html)
