# Spilling out of the segmentation

**URL:** <https://discourse.slicer.org/t/spilling-out-of-the-segmentation/3858>\
**Category:** Support\
**Tags:** segmentation\
**Created:** [August 21, 2018, 2:20pm UTC](https://discourse.slicer.org/t/spilling-out-of-the-segmentation/3858 "2018-08-21T14:20:46Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![alewandow](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@alewandow](https://discourse.slicer.org/u/alewandow)\
**Post date:** [August 21, 2018, 2:20pm UTC](https://discourse.slicer.org/t/spilling-out-of-the-segmentation/3858/1 "2018-08-21T14:20:46Z")

</div>

I’m following the video tutorial on editor/segment editor to get proper segmantation, but it does not work properly with my CT data.

In my real CT dicom files (even with CONTRAST and after I digged through the MultipleVolumeExplore

 ![cyst](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/f/0fd51bb4d366cb9007a6baf97881bf8b1875cde4.jpeg), the marked segment “pours” over the whole image height, when I use grow from seed, so even spleen cyst- closed rounded structure is covered by the artefacts. I expected that after picking some area of distinct density in the spleen cyst or in the liver, the segments will expand through the slices but only within those structures.  
Maybe this is because the content of spleen cyst or liver are not enough homogenously distinct from the surrounding structured. But how to decrease the sensitivity to increase specificity ?

This is the same in 4.8 and 4.9 last version.

---

<div class="post-metadata">

**Author:** ![alewandow](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@alewandow](https://discourse.slicer.org/u/alewandow)\
**Post date:** [August 21, 2018, 2:23pm UTC](https://discourse.slicer.org/t/spilling-out-of-the-segmentation/3858/2 "2018-08-21T14:23:23Z")

</div>

ps. This is another picture.

 ![cyst2](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/d/2d8a32c765e633bc96eb0cac94a041fc48e40d5c.jpeg)

---

<div class="post-metadata">

**Author:** ![alewandow](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@alewandow](https://discourse.slicer.org/u/alewandow)\
**Post date:** [August 21, 2018, 2:27pm UTC](https://discourse.slicer.org/t/spilling-out-of-the-segmentation/3858/3 "2018-08-21T14:27:55Z")

</div>

This is pthe picture where the segmentation was made by grow from seed in case of liver, and fill between slices for spleen.

 ![cyst3](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/e/6e7b42790568964dd94860ffb1970fda12993afc.jpeg)

---

<div class="post-metadata">

**Author:** ![alewandow](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@alewandow](https://discourse.slicer.org/u/alewandow)\
**Post date:** [August 21, 2018, 2:29pm UTC](https://discourse.slicer.org/t/spilling-out-of-the-segmentation/3858/4 "2018-08-21T14:29:55Z")

</div>

ps2. and another strange thing, probably with memory.

Picture attached:

 ![SceneView_1](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/2/c2ea4934fe2e5c93b0cb50fbb20c1f1fca88f9c6.png)

---

<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:** [August 21, 2018, 2:46pm UTC](https://discourse.slicer.org/t/spilling-out-of-the-segmentation/3858/5 "2018-08-21T14:46:56Z")

</div>

Based on the screenshots you give the Grow from seeds algorithm way too little seed. You need to keep refining the seed segments, both background and foreground, so that it gives you a better result. You can do this by drawing green where it should definitely be green not yellow, and vice versa. Only click Apply when the result is satisfactory.

I cannot make out much from the last screenshot, as I don’t know what am I supposed to see in the 2D viewers.

---

<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:** [August 21, 2018, 2:59pm UTC](https://discourse.slicer.org/t/spilling-out-of-the-segmentation/3858/6 "2018-08-21T14:59:53Z")

</div>

Also if you want just spleen and liver, then you also need to define a background class for everything else. E.g. paint in rad in the lungs, kidneys, air table, etc. Let us know if you get it working or have more questions.

---

<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:** [August 21, 2018, 5:01pm UTC](https://discourse.slicer.org/t/spilling-out-of-the-segmentation/3858/7 "2018-08-21T17:01:00Z")

</div>

The main issue is what @pieper described above (you need to add a third segment for “other”, as it is shown in almost all [segmentation tutorials](https://www.slicer.org/wiki/Documentation/Nightly/Training#Slicer4_Image_Segmentation)).

I’ve also noticed that you have a huge volume and you segment only a small fraction of it, which unnecessarily increases computation time and memory usage. Moreover, slice spacing seems to be larger than in-slice spacing. You can fix both these issues by cropping the input volume to the minimum necessary size (to only contain the object of interests and a small margin) and resample to have isotropic voxel spacing - using “Crop volume” module.

---

<div class="post-metadata">

**Author:** ![alewandow](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@alewandow](https://discourse.slicer.org/u/alewandow)\
**Post date:** [August 22, 2018, 8:00am UTC](https://discourse.slicer.org/t/spilling-out-of-the-segmentation/3858/8 "2018-08-22T08:00:26Z")

</div>

Thanks a lot. I will try to follow your all suggestions.

---

<div class="post-metadata">

**Author:** ![alewandow](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@alewandow](https://discourse.slicer.org/u/alewandow)\
**Post date:** [August 24, 2018, 11:04am UTC](https://discourse.slicer.org/t/spilling-out-of-the-segmentation/3858/9 "2018-08-24T11:04:44Z")

</div>

Hello !

I’m trying to make segmentation on another CT example. When using Editor and PaintEffect on the white colored bones and spine, after FastMarching Effect the selected area are completly reversed to selected. Why ?

 ![CDL](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/0/c07d199b4ccb608ac1c2c288bf8337775caa658d.jpeg)

 ![segmenation](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/0/108e79fecf34805a22a5ee28b5a1fc21bbb9b57a.jpeg)  
Pictures attached.

Tkanks.  
Andrzej

---

<div class="post-metadata">

**Author:** ![alewandow](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@alewandow](https://discourse.slicer.org/u/alewandow)\
**Post date:** [August 24, 2018, 11:14am UTC](https://discourse.slicer.org/t/spilling-out-of-the-segmentation/3858/10 "2018-08-24T11:14:49Z")

</div>

ps. Error report. Maybe it is usefull for you.

 ![error](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/f/5fcf38b406f601514d9b90c76d2465c493c6527c.jpeg)

---

<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:** [August 24, 2018, 12:08pm UTC](https://discourse.slicer.org/t/spilling-out-of-the-segmentation/3858/11 "2018-08-24T12:08:03Z")

</div>

> [@alewandow](#):
>
> Error report. Maybe it is usefull for you.

Yes, that helps - whenever it says “bad allocation” it means you ran out of memory. If possible, you can use a bigger computer or you can crop the images.

Also we suggest using the Segment Editor from the latest nightly build rather than the older Editor module which isn’t maintained.

---

<div class="post-metadata">

**Author:** ![alewandow](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@alewandow](https://discourse.slicer.org/u/alewandow)\
**Post date:** [August 24, 2018, 12:20pm UTC](https://discourse.slicer.org/t/spilling-out-of-the-segmentation/3858/12 "2018-08-24T12:20:50Z")

</div>

I sent two posts above that, which you had read. Can you see those too ?
