filipetrocadoferreira / end2endlobesegmentation

Code to replicate Experiments from the paper 'End-to-End Supervised Lobe Segmentation'
40 stars 12 forks source link

Why set origin and spacing with a reverse order? #7

Open Jingnan-Jia opened 4 years ago

Jingnan-Jia commented 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)

%%

filipetrocadoferreira commented 4 years ago

I think it was to save time in visualization. I used Slicer at the time.