Open Jingnan-Jia opened 4 years ago
In futils.util.py I found that the save_itk function use reversed origin and spacing as the parameters to save itk files. Could anyone gives some explanation? Why donot use the normal order???
def save_itk(filename,scan,origin,spacing,dtype = 'uint8'):
stk = sitk.GetImageFromArray(scan.astype(dtype)) stk.SetOrigin(origin[::-1]) stk.SetSpacing(spacing[::-1]) writer = sitk.ImageFileWriter() writer.Execute(stk,filename,True)
I think it was to save time in visualization. I used Slicer at the time.
In futils.util.py I found that the save_itk function use reversed origin and spacing as the parameters to save itk files. Could anyone gives some explanation? Why donot use the normal order???
%%
def save_itk(filename,scan,origin,spacing,dtype = 'uint8'):
%%