# Export transformed 4D image as nifti?

**URL:** <https://discourse.slicer.org/t/export-transformed-4d-image-as-nifti/25032>\
**Category:** Support\
**Tags:** registration, nifti, nrrd\
**Created:** [August 31, 2022, 7:27pm UTC](https://discourse.slicer.org/t/export-transformed-4d-image-as-nifti/25032 "2022-08-31T19:27:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ch-n](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ch-n/32/16474_2.png) [@ch-n](https://discourse.slicer.org/u/ch-n)\
**Post date:** [August 31, 2022, 7:27pm UTC](https://discourse.slicer.org/t/export-transformed-4d-image-as-nifti/25032/1 "2022-08-31T19:27:51Z")

</div>

Hi I would like to apply a bspline transformation I generated with the plastimatch plugin to a 4D image.  
That works all fine but afterwards I can no longer export the image in nifti format.  
I need the image for further work as nifti.  
Is there a way to export as nifti?  
I tried to convert the nrrd file afterwards to the nifti format using SimpleITK, but the 4D image becomes a 5D image with an empty fourth dim and the actual forth in the fifth.  
I just loaded de nrrd with sitk.ReadImage and saved with sitk.WriteImage.

Thanks for your help,  
Chris

---

<div class="post-metadata">

**Author:** ![ebrahim](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ebrahim/32/13403_2.png) [@ebrahim](https://discourse.slicer.org/u/ebrahim)\
**Post date:** [August 31, 2022, 7:43pm UTC](https://discourse.slicer.org/t/export-transformed-4d-image-as-nifti/25032/2 "2022-08-31T19:43:11Z")

</div>

Are you using Slicer to load the image? You can right click on the node and there should be an option to export. Then you can choose nifti as the export format.

The sitk problem sounds like some dim being misinterpreted as a channel

---

<div class="post-metadata">

**Author:** ![ch-n](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ch-n/32/16474_2.png) [@ch-n](https://discourse.slicer.org/u/ch-n)\
**Post date:** [September 1, 2022, 7:29am UTC](https://discourse.slicer.org/t/export-transformed-4d-image-as-nifti/25032/3 "2022-09-01T07:29:16Z")

</div>

Hi @ebrahim, thanks for the tip, but there is only the option to export as DICOM and in the save manue I can just select nrrd and nhrd.

I guess that should be the problem with sitk.  
Do you have any knowledge about the meta information in the nrrd file?  
I’m not to 100% sure to which key they translate in the nifti format.

---

<div class="post-metadata">

**Author:** ![ebrahim](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ebrahim/32/13403_2.png) [@ebrahim](https://discourse.slicer.org/u/ebrahim)\
**Post date:** [September 1, 2022, 12:54pm UTC](https://discourse.slicer.org/t/export-transformed-4d-image-as-nifti/25032/4 "2022-09-01T12:54:46Z")

</div>

I’m not familiar with the meta info off the top of my head but feel free to share an example file if you’d like me to poke around
