# Extracting a subnetwork from 3D volume

**URL:** <https://discourse.slicer.org/t/extracting-a-subnetwork-from-3d-volume/11570>\
**Category:** Support\
**Created:** [May 16, 2020, 3:21am UTC](https://discourse.slicer.org/t/extracting-a-subnetwork-from-3d-volume/11570 "2020-05-16T03:21:12Z")\
**Posts on this page:** 10\
**Page:** 2

<div class="post-metadata">

**Author:** ![Deepa](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deepa/32/5634_2.png) [@Deepa](https://discourse.slicer.org/u/Deepa)\
**Post date:** [May 21, 2020, 5:09pm UTC](https://discourse.slicer.org/t/extracting-a-subnetwork-from-3d-volume/11570/21 "2020-05-21T17:09:46Z")

</div>

@lassoan

> [@lassoan](#):
>
> You can remove disconnected fragments using Islands effect

I would like to know if it is right to select `keep largest island` to retain only the connected component and remove fragments.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/83011_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [May 21, 2020, 5:23pm UTC](https://discourse.slicer.org/t/extracting-a-subnetwork-from-3d-volume/11570/23 "2020-05-21T17:23:06Z")

</div>

> [@Deepa](#):
>
> I am accessing Slicer installed on linux server through Mobaxterm. I am facing same problem with the stable version too. Please let me know if I should open a new thread for this issue.

This issue is due to OpenGL support in Mobaxterm. I am not sure what the fix it. In our lab we use VNC + virtualGL to run Slicer in a remote Linux server.

> [@Deepa](#):
>
> I would like to know if it is right to select `keep largest island` to retain only the connected component and remove fragments.

If want to create a new volume that only contains voxels represented by the brown segment, you can use the `MaskVolume` which will create a new volume.

---

<div class="post-metadata">

**Author:** ![Deepa](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deepa/32/5634_2.png) [@Deepa](https://discourse.slicer.org/u/Deepa)\
**Post date:** [May 22, 2020, 5:10pm UTC](https://discourse.slicer.org/t/extracting-a-subnetwork-from-3d-volume/11570/24 "2020-05-22T17:10:01Z")

</div>

> [@lassoan](#):
>
> You can remove disconnected fragments using Islands effect

May I know how long it would take to remove the disconnected fragments using Island effect.

I am running island effect on a volume that resulted after using shrink and grow operations.  
It’s running on my local machine for 4 hours and it’s not complete yet.

Thanks a lot for the support  
Deepa

---

<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:** [May 22, 2020, 6:10pm UTC](https://discourse.slicer.org/t/extracting-a-subnetwork-from-3d-volume/11570/25 "2020-05-22T18:10:49Z")

</div>

Usually it takes a few seconds, maybe it can take 1-2 minutes for a huge image. Did you reduce the default minimum island size? Can you upload your scene .mrb file somewhere and post the link here?

---

<div class="post-metadata">

**Author:** ![Deepa](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deepa/32/5634_2.png) [@Deepa](https://discourse.slicer.org/u/Deepa)\
**Post date:** [May 23, 2020, 2:43am UTC](https://discourse.slicer.org/t/extracting-a-subnetwork-from-3d-volume/11570/26 "2020-05-23T02:43:15Z")

</div>

> [@lassoan](#):
>
> Did you reduce the default minimum island size?

I didn’t reduce the default minimum island. I selected `island effect` , `keep largest island` and hit enter.

After I forcefully terminated the run, the following error message was shown. I think there was a memory leak.

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/7/27088003c25b32db8a5f310b49123cb68dcdeddb.png)

> [@lassoan](#):
>
> Can you upload your scene .mrb file somewhere and post the link here?

Sure, I will repeat the steps and share the scene if I encounter the same problem again.  
Thanks a lot for the support.

---

<div class="post-metadata">

**Author:** ![Deepa](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deepa/32/5634_2.png) [@Deepa](https://discourse.slicer.org/u/Deepa)\
**Post date:** [June 3, 2020, 10:45am UTC](https://discourse.slicer.org/t/extracting-a-subnetwork-from-3d-volume/11570/27 "2020-06-03T10:45:44Z")

</div>

Hi @lassoan  
This time I carried out all the steps on a server and I could get it working

---

<div class="post-metadata">

**Author:** ![Deepa](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deepa/32/5634_2.png) [@Deepa](https://discourse.slicer.org/u/Deepa)\
**Post date:** [June 3, 2020, 11:22am UTC](https://discourse.slicer.org/t/extracting-a-subnetwork-from-3d-volume/11570/28 "2020-06-03T11:22:07Z")

</div>

Hi @muratmaga

> [@muratmaga](#):
>
> When you specify the margin size during dilate/shrink operation, you can choose 10 micron as the size (if that’s what you want to remove) for the second segment. This operation will remove anything less than 10micron in diameter

Could you offer some advice on how to set the margin size for filtering vessel diameters \> 5 micron and \< 10 micron?  
Previously I have used 10 micron in `Margin` settings for both shrink and grow to filter vessels less than 10 microns.

Thank you very much for your time and attention

---

<div class="post-metadata">

**Author:** ![Deepa](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deepa/32/5634_2.png) [@Deepa](https://discourse.slicer.org/u/Deepa)\
**Post date:** [June 3, 2020, 5:09pm UTC](https://discourse.slicer.org/t/extracting-a-subnetwork-from-3d-volume/11570/29 "2020-06-03T17:09:23Z")

</div>

Hi @lassoan

After using Islands for retaining the largest connected island , I could observe the resulting segment has holes on the surface.

I would like to know why these holes are present on the surface and how to obtain a surface without holes. In the end I would like to retain the surfaces that don’t have holes. The reason is, I intend to find the centerline lengths and I am afraid that computation of centerline lengths will be erroneous when holes area present.

Suggestions on how to retain surfaces without holes will be really helpful

---

<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:** [June 3, 2020, 5:25pm UTC](https://discourse.slicer.org/t/extracting-a-subnetwork-from-3d-volume/11570/30 "2020-06-03T17:25:06Z")

</div>

Can you post a few screenshots that shows what kind of holes you see?

You may avoid holes if you disable surface smoothing (in drop-down menu of “Show 3D” button).

---

<div class="post-metadata">

**Author:** ![Deepa](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deepa/32/5634_2.png) [@Deepa](https://discourse.slicer.org/u/Deepa)\
**Post date:** [June 4, 2020, 3:30am UTC](https://discourse.slicer.org/t/extracting-a-subnetwork-from-3d-volume/11570/31 "2020-06-04T03:30:14Z")

</div>

@lassoan

Please find the snapshot below

 ![Untitled](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/e/4e305270eb34ba3f8275f12140ec74c6ebbe1b47.png)

> [@lassoan](#):
>
> You may avoid holes if you disable surface smoothing (in drop-down menu of “Show 3D” button).

Sure, I will try this

[Previous page](https://discourse.slicer.org/t/extracting-a-subnetwork-from-3d-volume/11570.md?page=1)
