# Resize 3d volume

**URL:** <https://discourse.slicer.org/t/resize-3d-volume/11767>\
**Category:** Support\
**Tags:** resample\
**Created:** [May 29, 2020, 2:55am UTC](https://discourse.slicer.org/t/resize-3d-volume/11767 "2020-05-29T02:55:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![1116](https://avatars.discourse-cdn.com/v4/letter/1/439d5e/32.png) [@1116](https://discourse.slicer.org/u/1116)\
**Post date:** [May 29, 2020, 2:55am UTC](https://discourse.slicer.org/t/resize-3d-volume/11767/1 "2020-05-29T02:55:36Z")

</div>

If i want to resize 3d volume 256 x 256 x 26 to 184 x 220 x 26 , is it right to use Resample Sacalar/Vector/DWI Volume module?  
The Original volumes spacing is 1.25 x 1.25 x 4

The reason to resize 3d volume is that I’m going to extract the axial slices of volume to set of png file and use it for 2D CNN.

---

<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:** [May 29, 2020, 5:13pm UTC](https://discourse.slicer.org/t/resize-3d-volume/11767/2 "2020-05-29T17:13:37Z")

</div>

Yes, that should work.

---

<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 30, 2020, 12:02am UTC](https://discourse.slicer.org/t/resize-3d-volume/11767/3 "2020-05-30T00:02:41Z")

</div>

Note that your CNN uses numpy arrays as inputs, so there is no need to force your data into compressed 8-bit (or even worse, 24-bit) png images. Instead, you can get numpy array directly from your volume using [`slicer.util.arrayFromVolume`](https://slicer.readthedocs.io/en/latest/developer_guide/slicer.html#slicer.util.arrayFromVolume) and save it to a npy file that you can directly use in your CNN.
