Skip to content

FIX: Ordering of ITK displacements fields when reading and writing #266

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

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

oesteban
Copy link
Collaborator

Transposes data as suggested by @feilong when reading and writing ITK displacements fields.

Tests have been added to ensure round-trip consistency.

Related-to: #171.

@oesteban oesteban force-pushed the fix/itk-displacements-field-round-trip branch 2 times, most recently from e4e2b0a to 076c4fa Compare July 24, 2025 14:55
@oesteban
Copy link
Collaborator Author

@feilong apologies for the noise of the force-pushes

Transposes data as suggested by @feilong when reading and writing
displacements fields.

Tests have been added to ensure round-trip consistency.

Related-to: #171.

Co-Authored-By: Feilong Ma <[email protected]>
Copy link

codecov bot commented Jul 24, 2025

Codecov Report

❌ Patch coverage is 0% with 46 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (5647caf) to head (eee5a4e).

Files with missing lines Patch % Lines
nitransforms/nonlinear.py 0.00% 19 Missing ⚠️
nitransforms/io/itk.py 0.00% 12 Missing ⚠️
nitransforms/resampling.py 0.00% 10 Missing ⚠️
nitransforms/base.py 0.00% 5 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (5647caf) and HEAD (eee5a4e). Click for more details.

HEAD has 27 uploads less than BASE
Flag BASE (5647caf) HEAD (eee5a4e)
27 1
unittests 1 0
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #266       +/-   ##
==========================================
- Coverage   95.09%   0.00%   -95.10%     
==========================================
  Files          16      16               
  Lines        1979    1984        +5     
  Branches      265       0      -265     
==========================================
- Hits         1882       0     -1882     
- Misses         77    1984     +1907     
+ Partials       20       0       -20     
Flag Coverage Δ
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@feilong
Copy link
Contributor

feilong commented Jul 24, 2025

@oesteban No worries. Happy to see the issue fixed in nitransforms.

@oesteban oesteban force-pushed the fix/itk-displacements-field-round-trip branch from 961a020 to b807020 Compare July 26, 2025 06:11
@oesteban
Copy link
Collaborator Author

It doesn't look this transposition is the right answer (pictures extracted within the test_densefield_map_vs_ants test in this PR, which uses @feilong's 01_ants_t1_to_mniComposite_DisplacementFieldTransform.nii.gz:

Displacements with antsApplyTransformsToPoints:
Screenshot 2025-07-26 at 17 58 35

Displacements with nitransforms:
Screenshot 2025-07-26 at 17 58 22

@oesteban oesteban force-pushed the fix/itk-displacements-field-round-trip branch from b807020 to eee5a4e Compare July 27, 2025 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants