voxelmorph / voxelmorph

Unsupervised Learning for Image Registration
Apache License 2.0
2.25k stars 576 forks source link

Error running your tutorial on warping annotations together with images #458

Open RuiqiGeng opened 2 years ago

RuiqiGeng commented 2 years ago

Hey, thank you for sharing this great codebase! When I ran your small tutorial on warping annotations together with images, I got the following error:


TypeError Traceback (most recent call last) in () 5 6 # warp image ----> 7 im_warped = vxm.layers.SpatialTransformer(add_identity=False)([im_keras, aff_keras]) 8 im_warped = im_warped[0, ..., 0] 9

3 frames /usr/local/lib/python3.7/dist-packages/keras/utils/generic_utils.py in validate_kwargs(kwargs, allowed_kwargs, error_message) 1172 for kwarg in kwargs: 1173 if kwarg not in allowed_kwargs: -> 1174 raise TypeError(error_message, kwarg) 1175 1176

TypeError: ('Keyword argument not understood:', 'add_identity')

ahoopes commented 2 years ago

The add_identity parameter has been removed in recent versions since it's now assumed that the affine is always 'over' the identity. If you remove that from your code, do things run correctly?

msrepo commented 1 year ago

I came along same issue. Removing add_identity worked. Additionally, got Transformation matrix size mismatch later down the line which was fixed by sending the appropriate matrix image