InsightSoftwareConsortium / ITKElastix

An ITK Python interface to elastix, a toolbox for rigid and nonrigid registration of images
Apache License 2.0
203 stars 22 forks source link

TemplateTypeError: itk.ElastixRegistrationMethod is not wrapped for input type `None`. #188

Closed msshojaei90 closed 1 year ago

msshojaei90 commented 1 year ago

Hello everyone,

I am trying to use one of the provided example codes to register two image files (which can be accessed through the following link). However, it fails and showed me the following error. Can you please kindly review them and let me know why I get this error?

TemplateTypeError: itk.ElastixRegistrationMethod is not wrapped for input type None.

https://www.dropbox.com/scl/fo/3mud7hiko01u8epz2sg8p/h?dl=0&rlkey=g5d4p4qisbb4tkeaz1ec2plb4

Best wishes, Javad

ntatsisk commented 1 year ago

Hi Javad, as a first step can you make sure that the images are read properly before passing them to the Elastix fitler? For example, you can try doing:

print(image) # will print the image metadata
print(np.asarray(image)) # will print the pixel/voxel values

and inspect if the outputs make sense.

thewtex commented 1 year ago

Hi Javad,

Please read the images with:

fixed_image = itk.imread("HE2.tif", itk.F)
moving_image = itk.imread("Cu2.tif", itk.F)