Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ANTsImage operators don't work on Windows for right-sided operations #549

Closed
cookpa opened this issue Feb 20, 2024 · 3 comments · Fixed by #689
Closed

ANTsImage operators don't work on Windows for right-sided operations #549

cookpa opened this issue Feb 20, 2024 · 3 comments · Fixed by #689

Comments

@cookpa
Copy link
Member

cookpa commented Feb 20, 2024

@ncullen93 looks like #547 is not working on Windows

Traceback (most recent call last):
  File "D:\a\ANTsPy\ANTsPy\tests\test_core_ants_image.py", line 239, in test__radd__
    img2 = 6.9 + img
TypeError: unsupported operand type(s) for +: 'float' and 'ANTsImage'
@ncullen93
Copy link
Member

Thanks, I saw the windows build was failing and didnt realize it would fail the build if the tests fail. Now I know to check! It's a weird issue but I have tried to at least fix the tests. Couldn't find any reason why those operations would fail only in windows.

@cookpa
Copy link
Member Author

cookpa commented Feb 20, 2024

Yeah, it is a mystery to me as well. Works fine on Mac. As the error is with ANTsImage and not the numpy array, I infer that it's not finding the __radd__ function for some reason, rather than trying to run it and failing.

@cookpa cookpa changed the title Windows tests broken ANTsImage operators don't work on Windows for right-sided operations Feb 20, 2024
@cookpa
Copy link
Member Author

cookpa commented Feb 20, 2024

This works on all platforms:

im = ants.image_read(ants.get_ants_data('r16'))
im2 = im + 1

This works on Mac and Linux, but fails on Windows:

im = ants.image_read(ants.get_ants_data('r16'))
im2 = 1 + im

@cookpa cookpa linked a pull request Jul 24, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants