Closed dipterix closed 1 year ago
@stnava @tfmoraes It'll be great if you could help, also feel free to edit PR if errors out, or to close the PR if you don't like the fix : )
Another Windows user posted an issue (#437) so I did some digging. I think the issue might be that the serialization on windows produces "[address]", whereas on other platforms it is "0x[address]", where "address" is 16 hex digits for a 64-bit address (it would be good to not hard code this requirement!)
There's two possible solutions
Modify the proposed serializer to reformat the pointers. This assumes that an address having string form "0x[address]" would cast correctly to a pointer on Windows.
Modify ANTs C++ such that "[address]" is treated as a pointer, much as "0x[address]" is - I think I can do this.
EDIT: Windows pointers are just "[address]", I was counting incorrectly. Hoping to fix in #438
Note: we use this same trick in ANTsR - so I would prefer the 2nd approach if it is possible.
Ok I'll try that!
I think this is no longer needed (#442), but thanks @dipterix and others for helping to orient me to where the fixes needed to go
Added
ANTsSerializer
inprocess_args.py
to fix https://github.com/ANTsX/ANTsPy/issues/429 on WindowsIt handles image pointers differently on windows: ANTsImages are saved to temporary file instead of returning memory pointers. However, the temporary files need to be cleaned after running command.
This class requires
with
syntax:I can't compile ANTsPy from source on my machine (neither osx nor windows). Calling for help if anyone can test the code : )