Closed hbhutta closed 2 weeks ago
Oh my goodness I need to pay attention, I forgot to use ants.image_read()
🧠
The transforms are strings, they are the path to temporary files, so they may not persist between sessions. You may need to save them somewhere yourself in order to use them this way
Would I need to save these temp files even if I have serialized the registration output?
From your output
'fwdtransforms': ['/tmp/tmpnteshf1h1Warp.nii.gz', '/tmp/tmpnteshflh0GenericAffine.mat']
I think if you serialize this it will save a list with these two strings that you can load later, but the files on /tmp might not exist tomorrow, or after you reboot.
Also, I'm not sure antsImage objects can be serialized, because they are bound to C++ objects.
Describe the bug Getting None when using
ants.apply_transforms
To reproduce
Expected behavior
What I expect to get is a warped version of the moving image (the ventilation image) saved into the
out
variable. I should then be able to doants.image_write(image=out, filename=...)
Screenshots
This is what I get when I run the above code (in a file called
dummy.py
):ANTsPy installation (please complete the following information):
OS:
pip install antspyx
Additional context The fixed image (CT) and the moving image (MRI) that were originally registered were both masks, so there were hard boundaries defined. The ventilation image on which I am trying to apply the forward transforms from the above mentioned registration, does not have hard boundaries -- in fact it is quite a fuzzy image. Would this have any impact on the return value of
apply_transforms
?