Skip to content
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

ENH: Allow ingestion of alternatively grouped CompositeH5s #233

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mgxd
Copy link
Member

@mgxd mgxd commented Dec 20, 2024

ITKCompositeH5 is quite rigid ATM, bypassing the first H5 group entirely. This can be fine in some cases, but I have a transform containing a single displacement field (generated from a composite transform and reference image) which is not being read.

This PR successfully loads the DenseFieldTransform. If this looks good, can work on tests.

@mgxd mgxd requested review from effigies and oesteban December 20, 2024 04:21
Copy link

codecov bot commented Dec 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.33%. Comparing base (4d7ae6c) to head (08c3c84).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #233   +/-   ##
=======================================
  Coverage   95.32%   95.33%           
=======================================
  Files          28       28           
  Lines        2954     2960    +6     
=======================================
+ Hits         2816     2822    +6     
  Misses        138      138           
Flag Coverage Δ
unittests 95.11% <100.00%> (+<0.01%) ⬆️

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.

@effigies
Copy link
Member

How did you generate the h5? With ants, the first group was just metadata.

Probably good to be flexible anyway, but if we're generating with Python, we might need to be careful to emulate itk.

@mgxd
Copy link
Member Author

mgxd commented Dec 20, 2024

It is with ants (ApplyTransforms)

https://github.com/nipreps/nibabies/blob/86264fee0b56144d0799b29a445f84e20ea733f9/nibabies/interfaces/patches.py#L72-L73

$ antsApplyTransforms --help
     -o, --output warpedOutputFileName
                  [warpedOutputFileName or compositeDisplacementField,<printOutCompositeWarpFile=0>]
                  Linear[genericAffineTransformFile,<calculateInverse=0>]
          One can either output the warped image or, if the boolean is set, one can print 
          out the displacement field based on the composite transform and the reference 
          image. A third option is to compose all affine transforms and (if boolean is 
          set) calculate its inverse which is then written to an ITK file. 

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