# Export nrrd file from mhd file for 600 patients

**URL:** <https://discourse.slicer.org/t/export-nrrd-file-from-mhd-file-for-600-patients/36638>\
**Category:** Support\
**Created:** [June 7, 2024, 9:37am UTC](https://discourse.slicer.org/t/export-nrrd-file-from-mhd-file-for-600-patients/36638 "2024-06-07T09:37:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hk\_y](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hk_y/32/70063_2.png) [@hk\_y](https://discourse.slicer.org/u/hk_y)\
**Post date:** [June 7, 2024, 9:37am UTC](https://discourse.slicer.org/t/export-nrrd-file-from-mhd-file-for-600-patients/36638/1 "2024-06-07T09:37:09Z")

</div>

Operating system: mac os python 3.12  
Slicer version:4.8.1  
Expected behavior:I’ve 600 patients’ segmentation results of mhd/zraw files. I want to export them to NRRD files in 3D Slicer. However, applying this operation to each patient individually would be too time-consuming. Do you have any suggestions? I want use python to solve this problem.

---

<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:** [June 7, 2024, 9:52am UTC](https://discourse.slicer.org/t/export-nrrd-file-from-mhd-file-for-600-patients/36638/2 "2024-06-07T09:52:08Z")

</div>

This would be a pretty simple script - have you looked at examples in the script repository? Or you could ask a chatbot for advice and the come back here if you have specific questions.

---

<div class="post-metadata">

**Author:** ![hk\_y](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hk_y/32/70063_2.png) [@hk\_y](https://discourse.slicer.org/u/hk_y)\
**Post date:** [June 7, 2024, 10:28am UTC](https://discourse.slicer.org/t/export-nrrd-file-from-mhd-file-for-600-patients/36638/3 "2024-06-07T10:28:35Z")

</div>

I have read the script repository, but I still have some problems. Could you please point out the specific script to me from the script repository, I will add the loops to it later. Thanks so much.

---

<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:** [June 7, 2024, 5:20pm UTC](https://discourse.slicer.org/t/export-nrrd-file-from-mhd-file-for-600-patients/36638/4 "2024-06-07T17:20:02Z")

</div>

This looks like what you need.

> **[slicerio](https://pypi.org/project/slicerio/)**
>
> Utilities for 3D Slicer

Read the files and write them to the new format and loop over your file list.

---

<div class="post-metadata">

**Author:** ![hk\_y](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hk_y/32/70063_2.png) [@hk\_y](https://discourse.slicer.org/u/hk_y)\
**Post date:** [June 13, 2024, 9:18am UTC](https://discourse.slicer.org/t/export-nrrd-file-from-mhd-file-for-600-patients/36638/5 "2024-06-13T09:18:13Z")

</div>

Thanks！ It helps a lot!
