# Export volume as .npy in Axial, Coronal, Saggital

**URL:** <https://discourse.slicer.org/t/export-volume-as-npy-in-axial-coronal-saggital/42884>\
**Category:** Support\
**Tags:** dicom, python\
**Created:** [May 12, 2025, 10:13am UTC](https://discourse.slicer.org/t/export-volume-as-npy-in-axial-coronal-saggital/42884 "2025-05-12T10:13:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SANTIAGO\_PENDON\_MING](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/santiago_pendon_ming/32/66060_2.png) [@SANTIAGO\_PENDON\_MING](https://discourse.slicer.org/u/SANTIAGO_PENDON_MING)\
**Post date:** [May 12, 2025, 10:13am UTC](https://discourse.slicer.org/t/export-volume-as-npy-in-axial-coronal-saggital/42884/1 "2025-05-12T10:13:41Z")

</div>

Hi to everyone.

I am currently working with brain MRI DICOM files and, for further post processing pipelines, I would like to export it as npy. files. When I do that (programmatically) I found that the each volume is orient as the original acquisition (for example if the sequence was a T1 coronal, the first dimension in the npy will be the coronal…)

To optimize the automatization I would like to export all the volumes as Axial, Coronal, Sagittal.

Is this possible? How can I do it in Python?

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [May 12, 2025, 3:27pm UTC](https://discourse.slicer.org/t/export-volume-as-npy-in-axial-coronal-saggital/42884/2 "2025-05-12T15:27:30Z")

</div>

Not sure how you writing the npy, but you can try reordering the dimensions prior to writing.

---

<div class="post-metadata">

**Author:** ![SANTIAGO\_PENDON\_MING](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/santiago_pendon_ming/32/66060_2.png) [@SANTIAGO\_PENDON\_MING](https://discourse.slicer.org/u/SANTIAGO_PENDON_MING)\
**Post date:** [May 13, 2025, 6:55am UTC](https://discourse.slicer.org/t/export-volume-as-npy-in-axial-coronal-saggital/42884/3 "2025-05-13T06:55:34Z")

</div>

I think the solution is use Orient Scalar Volume module, that allows me set the output orientation of of the volume and the I can export it as a npy file with `arrayFromVolume(volumeNode)`

---

<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 13, 2025, 12:49pm UTC](https://discourse.slicer.org/t/export-volume-as-npy-in-axial-coronal-saggital/42884/4 "2025-05-13T12:49:39Z")

</div>

MONAI provides well-tested tools to conveniently address common needs like this. For example, in deep learning pipelines usually there is an [Orientationd](https://docs.monai.io/en/stable/transforms.html#orientationd) transform that can reorder or resample the voxel array to be bring all images to a canonical orientation. The transform can also compute the inverse operation to get output in the original space.
