Issue with SetSpacing


I am trying to create an itk image from numpy array. I have,

itkImg = itk.GetImageFromArray(array)
itkImg.SetOrigin([1.0, 1.0, 1.0])
itkImg.SetSpacing([1.0, 2.0, 2.0])

After creating the image, I want to change the origin and spacing of itkImg. I was able to change the origin but I am not able to change the spacing. When I call SetSpacing, the jupyter notebook kernal crashes.

Any suggestions?


1 Like

Number one thing to try is using the latest release. ITK 5.2.0 was tagged last week, make sure you are using it. If this does not resolve the issue, what versions of other tools are you using (jupyter etc)?

1 Like