nipy / nitransforms

a standalone fork of nipy/nibabel#656
https://nitransforms.readthedocs.io
MIT License
28 stars 15 forks source link

FIX: Load ITK fields from H5 correctly #211

Closed effigies closed 6 days ago

effigies commented 3 weeks ago

Ports nipreps/fmriprep#3300 to nitransforms.

I've gotten ANTs to generate a warp field with a non-cardinal rotation matrix and anistropic spacing:

image

Need to verify that we're raveling the fixed parameters in the correct order. Numpy defaults to C.

codecov[bot] commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.79%. Comparing base (d6170fb) to head (1c74669). Report is 36 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #211 +/- ## ======================================= Coverage 95.79% 95.79% ======================================= Files 14 14 Lines 1307 1307 Branches 259 259 ======================================= Hits 1252 1252 Misses 52 52 Partials 3 3 ``` | [Flag](https://app.codecov.io/gh/nipy/nitransforms/pull/211/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nipy) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/nipy/nitransforms/pull/211/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nipy) | `95.79% <100.00%> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nipy#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

effigies commented 3 weeks ago

Oh no.

image

effigies commented 3 weeks ago
In [37]: np.allclose(np.diag([-1, -1, 1, 1]) @ targetrot, nb.affines.from_matvec(np.reshape(params, (3, 3))))
Out[37]: True