SimpleITK & MetaIO: changing the .raw extension

Dear all,
When I save MHD images using 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) is there is a similar possibility with SimpleITK?

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.

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