# How can I convert NIFTI files to NRRD files in batch mode?

**URL:** <https://discourse.slicer.org/t/how-can-i-convert-nifti-files-to-nrrd-files-in-batch-mode/11841>\
**Category:** Support\
**Created:** [June 3, 2020, 2:30am UTC](https://discourse.slicer.org/t/how-can-i-convert-nifti-files-to-nrrd-files-in-batch-mode/11841 "2020-06-03T02:30:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AT3432984](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@AT3432984](https://discourse.slicer.org/u/AT3432984)\
**Post date:** [June 3, 2020, 2:30am UTC](https://discourse.slicer.org/t/how-can-i-convert-nifti-files-to-nrrd-files-in-batch-mode/11841/1 "2020-06-03T02:30:11Z")

</div>

Hello,

I have approximately 300 MRI images in the NIfTI format which I need to convert to NRRD files so that I can analyse them. I can open each file in 3D-Slicer and save as NRRD, but I am wondering if there is an easier way to do this as I have so many images.

Thank you

---

<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 3, 2020, 2:32am UTC](https://discourse.slicer.org/t/how-can-i-convert-nifti-files-to-nrrd-files-in-batch-mode/11841/2 "2020-06-03T02:32:32Z")

</div>

You can write a few-line Python script that iterates through all the nifti files in that folder, loads the volume, then saves it as nrrd.

You can find examples in [script repository](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Load_volume_from_file) for loading and saving volume. This post can also help (and there were other similar questions here before that you may be able to find):

> [@how to load mrb file and save all nodes in nii format using script](https://discourse.slicer.org/t/how-to-load-mrb-file-and-save-all-nodes-in-nii-format-using-script/6169):
>
> Operating system: windows 10 Slicer version:4.8.1 Expected behavior: save nodes in nii format using script Actual behavior: only can save in nrrd format Hi, I want to export image and labelmap node in nii format to a directory using python script. My script is: mrbfile=r’D:\sample.mrb’ outdir = r’D:\output\_dir’ loadScene(infilename) saveScene(outfilename[:-4]) slicer.mrmlScene.Clear(0); However, this could only save node in nrrd format, the 3D Slicer default format. How could I save …
