# Using crop volume module to extract subvolume from a 3D volume

**URL:** <https://discourse.slicer.org/t/using-crop-volume-module-to-extract-subvolume-from-a-3d-volume/11926>\
**Category:** Support\
**Created:** [June 8, 2020, 1:57pm UTC](https://discourse.slicer.org/t/using-crop-volume-module-to-extract-subvolume-from-a-3d-volume/11926 "2020-06-08T13:57:05Z")\
**Posts on this page:** 6\
**Page:** 1

<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 8, 2020, 1:57pm UTC](https://discourse.slicer.org/t/using-crop-volume-module-to-extract-subvolume-from-a-3d-volume/11926/1 "2020-06-08T13:57:05Z")

</div>

Hello Everyone,

I have a 3D volume like the following that has been reconstructed from 2D images.

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

I’d like to know if there is a way to remove the terminal branches from this volume . By terminal branches, I mean the free ends (i.e inlets/outlets of a 3D volume).

After removing the terminal branches, I’d like to extract a subvolume from the original volume.  
I had a chance to look at [this](https://www.youtube.com/watch?v=1mYNwJbE7dQ) video tutorial that shows how to crop volumes by selecting regions in 2D images. I’d like to know if there exists a similar  
approach to crop volume.

Any suggestions on how to do this will be highly appreciated.

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:** [June 8, 2020, 2:37pm UTC](https://discourse.slicer.org/t/using-crop-volume-module-to-extract-subvolume-from-a-3d-volume/11926/2 "2020-06-08T14:37:35Z")

</div>

You can crop a segmentation using “Scissors” effect or for more complicated cuts, using “Surface cut” effect (provided by SegmentEditorExtraEffects extension).

---

<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 8, 2020, 3:08pm UTC](https://discourse.slicer.org/t/using-crop-volume-module-to-extract-subvolume-from-a-3d-volume/11926/3 "2020-06-08T15:08:59Z")

</div>

@lassoan

Thank you very much. I will check these options.

But prior to extracting the subvolume, I’d like to do the following

> [@Deepa](#):
>
> I’d like to know if there is a way to remove the terminal branches from this volume . By terminal branches, I mean the free ends (i.e inlets/outlets of a 3D volume).

Since the original volume is highly complex, I’d like to know if it is possible to programmatically remove the free ends. It will be difficult to manually locate these free ends.

---

<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 8, 2020, 4:18pm UTC](https://discourse.slicer.org/t/using-crop-volume-module-to-extract-subvolume-from-a-3d-volume/11926/4 "2020-06-08T16:18:13Z")

</div>

You don’t need to address this during segmentation. Centerline extraction module extracts all the endpoints that it can find and then extract those branches. But we can allow editing of these endpoints, so that you keep only selected branches.

---

<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 9, 2020, 4:21am UTC](https://discourse.slicer.org/t/using-crop-volume-module-to-extract-subvolume-from-a-3d-volume/11926/5 "2020-06-09T04:21:48Z")

</div>

Hi @lassoan,

In the end, I would like to extract a 3D subvolume with one inlet free end and one outlet free end similar to [this 2D](https://discourse.slicer.org/uploads/short-url/dhB0T1KRpkNoIfry97yVIAS58C7.png).

In the 3D volume image posted above, I could find many free ends and I wasn’t sure how to retain just one inlet and one outlet. For this reason, I had thought of removing all the free ends before extracting the subvolume. Once the subvolume is extracted, I could cut open two branches (located geometrically opposite) to create the inlet and outlet before feeding this subvolume to the centerline extraction module.

From what you have suggested, I think I shall do this vice-versa. First extract the subvolume, feed to the centerline extraction, delete terminal branches.

---

<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 20, 2020, 9:52pm UTC](https://discourse.slicer.org/t/using-crop-volume-module-to-extract-subvolume-from-a-3d-volume/11926/7 "2020-06-20T21:52:39Z")

</div>

Just for future reference, extraction of selected branches is now implemented:

> [@New module: Extract Centerline (in SlicerVMTK extension)](https://discourse.slicer.org/t/new-module-extract-centerline-in-slicervmtk-extension/12117):
>
> We added a completely new module that makes vessel (or airway or any other tree structure) centerline extraction much faster, flexible, and robust. It can quickly extract a network, determine branch endpoints automatically, allows editing of endpoints, computing centerlines, branches, and quantitative metrics (radius, curvature, torsion, etc). The new “Extract Centerline” module is available in SlicerVMTK extension for latest Slicer-4.11 release (it replaces the old “Centerline Computation” modu…
