I am working on multiscale_demons
registration and getting the following error from this line here: 66_Registration_Demons
Error:
Traceback (most recent call last):
File "/home/banikr/PycharmProjects/registration/RegistrationWoMorph.py", line 357, in <module>
initial_displacement_field.CopyInformation(fixed_images[-1])
File "/home/banikr/miniconda3/envs/reg37/lib/python3.7/site-packages/SimpleITK/SimpleITK.py", line 3446, in CopyInformation
return _SimpleITK.Image_CopyInformation(self, srcImage)
RuntimeError: Exception thrown in SimpleITK Image_CopyInformation: /tmp/SimpleITK/Code/Common/src/sitkImage.cxx:278:
sitk::ERROR: Source Image for information does not match this image's dimension.
If I print the fixed_image
print("low res image >> ", fixed_images[-1].GetDimension())
low res image >> 2
which is a 2D image that I am using.
I tried adding the following:
initial_displacement_field = sitk.Image(fixed_images[-1].GetWidth(),
fixed_images[-1].GetHeight(),
fixed_images[-1].GetDepth(),
fixed_images[-1].GetDimension(),
# sitk.sitkVectorFloat64
)
which didn’t work.
The following params are being used:
shrinkFactors = [4, 2, 1]
smoothingSigmas = [8, 4, 0.000000001]
Additional print statement:
fixed & moving image size >> 0 : (111, 93) (111, 93)
1 : (111, 93) == (111, 93)
2 : (56, 47) == (56, 47)
3 : (28, 23) == (28, 23)
After smooth and shrink the fixed_images[-1]
looks like:
Also as a side issue the online sources documention for itk seems not to work. for example I wanted to check sitk.Image
documentation to learn more about CopyInformation()
The page won’t simply load.
And this happened so many times for many other pages during troubleshoot.
Any help?