Skip to content

ENH: add gradunwarp base workflow for f/smriprep. #819

Open
bpinsard wants to merge 23 commits into
nipreps:masterfrom
bpinsard:enh/gradunwarp
Open

ENH: add gradunwarp base workflow for f/smriprep. #819
bpinsard wants to merge 23 commits into
nipreps:masterfrom
bpinsard:enh/gradunwarp

Conversation

@bpinsard

@bpinsard bpinsard commented Aug 2, 2023

Copy link
Copy Markdown
Contributor

Working on nipreps/fmriprep#1550.
Relies on an updated version of the gradunwarp https://github.com/bpinsard/gradunwarp/tree/fix/mem_leaks.

@codecov

codecov Bot commented Aug 2, 2023

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.72727% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.28%. Comparing base (27cb6f7) to head (af461ed).
⚠️ Report is 239 commits behind head on master.

Files with missing lines Patch % Lines
niworkflows/interfaces/gradunwarp.py 67.56% 12 Missing ⚠️
niworkflows/workflows/gradunwarp.py 69.56% 7 Missing ⚠️
niworkflows/workflows/tests/test_gradunwarp.py 86.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master     #819       +/-   ##
===========================================
- Coverage   71.46%   46.28%   -25.19%     
===========================================
  Files          89       92        +3     
  Lines        8622     8686       +64     
  Branches     1072     1074        +2     
===========================================
- Hits         6162     4020     -2142     
- Misses       2227     4549     +2322     
+ Partials      233      117      -116     

☔ View full report in Codecov by Harness.
📢 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.

@oesteban

oesteban commented Aug 7, 2023

Copy link
Copy Markdown
Member

I'm guessing if you want circle / gh to run the test, you'll need to install gradunwarp right?

Comment thread niworkflows/workflows/gradunwarp.py Outdated
Comment on lines +72 to +77
itk_warp_data = fsl_warp.get_fdata().reshape(fsl_warp.shape[:3]+(1,3))
itk_warp_data[...,(0,1)] *= -1
itk_warp = fsl_warp.__class__(itk_warp_data, fsl_warp.affine)
itk_warp.header.set_intent("vector")
out_fname = fname_presuffix(in_warp, suffix="_itk", newpath=os.getcwd())
itk_warp.to_filename(out_fname)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitransforms should do all the manipulations for you

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might have missed something, but from what I understood what needs to be provided to Ants ApplyTransform are ITK warpfields. In nitransforms I cannot see any function to output non-linear warp in ITK format from nitransforms object https://nitransforms.readthedocs.io/en/latest/_api/io.html#nitransforms.io.itk.ITKDisplacementsField, it seems to only deal with inputs. Thus, my attempt to invert that input step.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it looks like you are totally right (and I did the same here a while ago - https://github.com/nipreps/sdcflows/blob/375dd7a024abcd5d4d2b282241a037d76f9719e6/sdcflows/transform.py#L286-L292)

Would you like to become a proud contributor to nitransforms? :D

If not (or either way, actually), may I ask you to file an issue requesting this to be implemented there?

@effigies effigies left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly comments on the nipype interface.

Comment thread niworkflows/interfaces/gradunwarp.py Outdated
Comment thread niworkflows/interfaces/gradunwarp.py Outdated
Comment thread niworkflows/interfaces/gradunwarp.py Outdated
Comment thread niworkflows/interfaces/gradunwarp.py Outdated
Comment thread niworkflows/interfaces/gradunwarp.py Outdated
Comment thread niworkflows/interfaces/gradunwarp.py Outdated
Comment thread niworkflows/interfaces/gradunwarp.py Outdated
Comment thread niworkflows/workflows/tests/test_gradunwarp.py Outdated
Comment thread niworkflows/workflows/tests/test_gradunwarp.py Outdated
bpinsard and others added 17 commits May 15, 2024 12:11
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
@bpinsard
bpinsard force-pushed the enh/gradunwarp branch 2 times, most recently from 559c8a1 to a4d7e3b Compare May 15, 2024 18:18
@bpinsard
bpinsard marked this pull request as ready for review May 16, 2024 19:19
@bpinsard

Copy link
Copy Markdown
Contributor Author

I don't understand why I am getting errors on the T1w file when testing the gradunwarp pipeline. How does that ds0000030 differs from the openeuro one?

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.

3 participants