I'm computing affine transforms for co-registering anatomical MRI scans.
Sometimes I would like to re-use those transforms, so in a case similar to the example here
https://dipy.org/documentation/1.2.0./examples_built/affine_registration_3d…
my final transform is the result of this command:
rigid = affreg.optimize ( static, moving, transform, params0,
static_affine, moving_affine,
starting_affine = translation.…
[View More]affine );
final = rigid;
after first having aligned the centres of gravity.
After this command I can call
resampled = final.transform ( moving );
and then I get the desired result.
What I don't understand is how to store the transform and re-use it later.
I have tried to just save the object 'final' with
np.savez ( 'transformation.npz', final );
and then load it later with
with np.load ( 'transformation.npz', allow_pickle = True ) as npzfile:
final = npzfile [ 'arr_0' ];
and then re-run
resampled = final.transform ( moving );
but that returns the following error:
resampled = final.transform ( moving );
AttributeError: 'numpy.ndarray' object has no attribute 'transform'
So what I understand from this is that the output 'rigid' from the affreg.optimize() command has an attribute
'transform', but when I save it and then load it again it does not any more.
Is there a(nother) way to save and (re)load transforms?
Many thanks
Alle Meije
[View Less]
Hello all,
We are happy to announce two new releases of DIPY: DIPY 1.4.0 and 1.4.1 are
out!
Please support us by citing DIPY in your papers using the following DOI:
10.3389/fninf.2014.00008 <https://www.ncbi.nlm.nih.gov/pubmed/24600385>
DIPY 1.4.1 (Thursday, 6 May 2021) & 1.4.0 (Saturday, 13 March, 2021)
-
Release 1.4.1 received contributions from 11 developers (the full
release notes are at:
https://dipy.org/documentation/1.4.1./release_notes/release1.4.1/).
-
…
[View More] Release 1.4.0 received contributions from 8 developers (the full release
notes are at:
https://dipy.org/documentation/1.4.0./release_notes/release1.4/).
Thank you all for your contributions and feedback!
Please click here <https://dipy.org/documentation/1.4.1./api_changes/> to
check 1.4.1 API changes.
Please click here <https://dipy.org/documentation/1.4.0./api_changes/> to
check 1.4.0 API changes.
Highlights of 1.4.1 release include:
-
New surface seeding module for tractography named mesh.
-
Patch2Self and its documentation updated.
-
BUAN and RecoBundles documentation updated.
-
Standardization and improvement of the multiprocessing / multithreading
rules.
-
Community and governance information added.
-
Large update of Cython code in compliance with the last standard.
-
Large documentation update.
-
Closed 61 issues and merged 28 pull requests.
Highlights of 1.4.0 release include:
-
New self-supervised denoising algorithm Patch2Self added.
-
Response function refactored and clarified.
-
B-tensor allowed with response functions.
-
Large Command Line Interface (CLI) documentation updated.
-
Public API for Registration added.
-
Large documentation update.
-
Closed 47 issues and merged 19 pull requests.
To upgrade or install <http://dipy.org/release0.10.html> DIPY
Run the following command in your terminal:
<http://dipy.org/release0.10.html>
pip install --upgrade dipy
or
conda install -c conda-forge dipy
This version of DIPY depends on nibabel (3.0.0+).
For visualization you need FURY (0.7.0+).
Questions or suggestions?
For any questions go to https://dipy.org, or send an e-mail to
dipy(a)python.org <neuroimaging(a)python.org>
We also have an instant messaging service and chat room available at
https://gitter.im/dipy/dipy
Finally, a new forum is available at
https://github.com/dipy/dipy/discussions
Have a wonderful time using the latest release.
On behalf of the DIPY developers,
Eleftherios Garyfallidis, Ariel Rokem, Serge Koudoro
https://dipy.org/contributors
[View Less]