python实现mhd转换为nii
import SimpleITK as sitk
# 读取MHD文件
mhd_image = sitk.ReadImage('D:/test.mhd')
# 将MHD图像写入NIfTI格式
sitk.WriteImage(mhd_image, 'D:/output.nii')
import SimpleITK as sitk
# 读取MHD文件
mhd_image = sitk.ReadImage('D:/test.mhd')
# 将MHD图像写入NIfTI格式
sitk.WriteImage(mhd_image, 'D:/output.nii')