-1

I'm trying to convert a numpy array into a mhd file using SimpleITK.

Do you know if this is possible and if so, how to do it ?

manon
  • 15
  • 5

1 Answers1

0

Sure. Here ya go:

import SimpleITK as sitk

img = sitk.GetImageFromArray(np_array)

sitk.WriteImage(img, "your_image.mhd")
Dave Chen
  • 1,905
  • 1
  • 12
  • 18