# SimpleITK & MetaIO: changing the .raw extension

**URL:** <https://discourse.itk.org/t/simpleitk-metaio-changing-the-raw-extension/5724>\
**Category:** Algorithms\
**Tags:** simpleitk, python\
**Created:** [February 19, 2023, 9:31pm UTC](https://discourse.itk.org/t/simpleitk-metaio-changing-the-raw-extension/5724 "2023-02-19T21:31:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ingmar.voigt](https://discourse.itk.org/letter_avatar_proxy/v4/letter/i/35a633/32.png) [@ingmar.voigt](https://discourse.itk.org/u/ingmar.voigt)\
**Post date:** [February 19, 2023, 9:31pm UTC](https://discourse.itk.org/t/simpleitk-metaio-changing-the-raw-extension/5724/1 "2023-02-19T21:31:12Z")

</div>

Dear all,  
When I save MHD images using [https://simpleitk.org/doxygen/latest/html/classitk\_1\_1simple\_1\_1ImageFileWriter.html](https://simpleitk.org/doxygen/latest/html/classitk_1_1simple_1_1ImageFileWriter.html), is there a way to save with a different extension other than “.raw”/“.zraw”?

VTK does support that through `vtkMetaImageWriter.SetRAWFileName` ([https://vtk.org/doc/nightly/html/classvtkMetaImageWriter.html#a0ac422a80fb366e32a88882c34e709f4](https://vtk.org/doc/nightly/html/classvtkMetaImageWriter.html#a0ac422a80fb366e32a88882c34e709f4)) is there is a similar possibility with SimpleITK?

---

<div class="post-metadata">

**Author:** ![zivy](https://discourse.itk.org/user_avatar/discourse.itk.org/zivy/32/1726_2.png) [@zivy](https://discourse.itk.org/u/zivy)\
**Post date:** [February 20, 2023, 2:14pm UTC](https://discourse.itk.org/t/simpleitk-metaio-changing-the-raw-extension/5724/2 "2023-02-20T14:14:36Z")

</div>

Hello @ingmar.voigt,

Unfortunately, this is not possible in ITK/SimpleITK. The `FileWriter` is a generic class which is used for all file types, so there is only one output name. The `mhd` format is unique in that the “output file” is actually two files.

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [February 20, 2023, 2:20pm UTC](https://discourse.itk.org/t/simpleitk-metaio-changing-the-raw-extension/5724/3 "2023-02-20T14:20:23Z")

</div>

`.nhdr` variant from NRRD file format has the same issue.
