# cropping 3d volume

**URL:** <https://discourse.itk.org/t/cropping-3d-volume/1788>\
**Category:** Algorithms\
**Created:** [April 15, 2019, 3:21pm UTC](https://discourse.itk.org/t/cropping-3d-volume/1788 "2019-04-15T15:21:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marco\_Festugato](https://discourse.itk.org/user_avatar/discourse.itk.org/marco_festugato/32/696_2.png) [@Marco\_Festugato](https://discourse.itk.org/u/Marco_Festugato)\
**Post date:** [April 15, 2019, 3:21pm UTC](https://discourse.itk.org/t/cropping-3d-volume/1788/1 "2019-04-15T15:21:44Z")

</div>

Hello, i have segmented the liver from 199 CT slices of the same patient (DICOM images).

How can i crop the volume in order to contain only the segmented liver? I also have to write the 3D cropped volume back to the 199 images (I thought to use the example DicomSeriesReadSeriesWrite.cxx for this)…but how can i crop my volume? I dont have a fix dimension…

Thanks for any help!

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [April 15, 2019, 4:15pm UTC](https://discourse.itk.org/t/cropping-3d-volume/1788/2 "2019-04-15T16:15:11Z")

</div>

Does this [discussion](https://itk.org/pipermail/insight-users/2011-March/040213.html) help you? How about [this one](https://itk.org/pipermail/insight-users/2009-October/033277.html)? Spatial objects have been significantly refactored about a month ago, keep it in mind of you use the second approach.

---

<div class="post-metadata">

**Author:** ![Marco\_Festugato](https://discourse.itk.org/user_avatar/discourse.itk.org/marco_festugato/32/696_2.png) [@Marco\_Festugato](https://discourse.itk.org/u/Marco_Festugato)\
**Post date:** [April 16, 2019, 1:55pm UTC](https://discourse.itk.org/t/cropping-3d-volume/1788/3 "2019-04-16T13:55:10Z")

</div>

thank u again @dzenanz for all your help. Is it possible to do something that is like

volume = volume( volume \> 0 ) ?

in practise i want my filter to work **only** on the volume \> 0, is it possible?
