Open Joey0538 opened 4 years ago
import os import SimpleITK as sitk
FileNames = [ #location of dataset ] for file in FileNames: path,name = os.path.split(file) name = name.split('.') image = sitk.ReadImage(file) sitk.WriteImage(image,name[0] + '.mhd')
Is this the right way to do it?
Yes. I think it's right.
Your help would be appreciated as I'm trying to implement this. One way I know is to rename the extension from .nii to .mhd but I think that's a wrong way to do it, so please help me on how to convert this.