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

RF: Fix ITK warp conversion to nitransforms format #3300

Merged
merged 6 commits into from
Jun 5, 2024

Conversation

effigies
Copy link
Member

@effigies effigies commented Jun 5, 2024

Alternative to (and builds on) #3296.

Closes #3296.

mgxd and others added 4 commits June 5, 2024 10:58
The reverse of the TransformFixedParameters should match the template dimensions.

This fell through the cracks because the templates tested (MNI152 variants) all have the same
X and Z dimensions. Only when testing on a template with distinct values for shape did this become evident.

Additionally, this removes any `FIXED_PARAMS` checks, as that is template specific and more useful for debugging the
initial implementation.
Break the transformation steps down to be very explicit, with comments.
@effigies effigies requested a review from mgxd June 5, 2024 14:59
fmriprep/utils/transforms.py Outdated Show resolved Hide resolved
Copy link

codecov bot commented Jun 5, 2024

Codecov Report

Attention: Patch coverage is 7.14286% with 13 lines in your changes missing coverage. Please review.

Project coverage is 73.79%. Comparing base (604eeef) to head (758e5ac).
Report is 48 commits behind head on master.

Files with missing lines Patch % Lines
fmriprep/utils/transforms.py 7.14% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3300      +/-   ##
==========================================
+ Coverage   73.71%   73.79%   +0.08%     
==========================================
  Files          56       56              
  Lines        4269     4263       -6     
==========================================
- Hits         3147     3146       -1     
+ Misses       1122     1117       -5     

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

Copy link
Collaborator

@mgxd mgxd left a comment

Choose a reason for hiding this comment

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

LGTM - I have not tested it, but can appreciate the improved clarity.
The only concern I have is this code is copied in a number of places (here, nibabies, resampler package) - we should focus some energy on having a single distribution and importing from there (maybe an ohbm hackathon project?)

@effigies
Copy link
Member Author

effigies commented Jun 5, 2024

Actually just looked at the MNI-resampled boldref in https://app.circleci.com/pipelines/github/nipreps/fmriprep/2204/workflows/b0c88b0f-7a65-4904-a5d4-7dc26b8233f4/jobs/11504/artifacts, and it's degraded relative to your PR and master. Let me try to understand this...

@effigies
Copy link
Member Author

effigies commented Jun 5, 2024

Or, if you just want to add the ValueErrors, we can use yours (looks the same as master) and then I can complete the refactor when it's convenient.

@effigies
Copy link
Member Author

effigies commented Jun 5, 2024

Hmm. I loaded the file with my function and yours, and they seem identical. I'm going to re-run the test, in case it's just a one-off weirdness.

@effigies
Copy link
Member Author

effigies commented Jun 5, 2024

Okay, it appears to have been a one-off bad boldmask, not a problem with this function at all.

@effigies
Copy link
Member Author

effigies commented Jun 5, 2024

The only concern I have is this code is copied in a number of places (here, nibabies, resampler package) - we should focus some energy on having a single distribution and importing from there (maybe an ohbm hackathon project?)

And yes. We should get this fixed up in nitransforms so we can stop having our own special loader.

@effigies effigies merged commit 6c4cb04 into nipreps:master Jun 5, 2024
15 of 17 checks passed
@effigies effigies deleted the fix/resampling branch June 5, 2024 20:16
effigies added a commit that referenced this pull request Jun 17, 2024
24.0.0 (June 17, 2024)

New feature release in the 24.0.x series.

This release is an incremental improvement on 23.2.x, with some
fixes for bugs discovered in the updated workflow.

New features include separation of HTML reports by session for subjects
with many BOLD runs, a new ``--fs-no-resume`` option to improve interoperability
with less typical FreeSurfer directories, such as those generated by longitudinal
FreeSurfer or FastSurfer, and adoption of DatasetLinks and BIDS-URIs, to follow
the recommendations of recent versions of BIDS.

With thanks to Dimitri Papadopoulos, Basile Pinsard, Celine Provins, Taylor Salo
and Wang Hao-Ting for their contributions!

* FIX: Add "double" type to allowed DisplacementFieldTransform (#3287)
* FIX: Require recent templateflow, select correct aparc dseg.tsv (#3256)
* FIX: Ensure proper templates are retrieved with sloppy (#3251)
* FIX: Delete summary from functional report when separated by sessions (#3223)
* FIX: Support lists in bids filter file containing ``null`` or ``*`` (#3215)
* FIX: Re-enable anat fasttrack for dataset without t1w (#3202)
* ENH: Use BIDSURI in init_ds_boldmask_wf (#3297)
* ENH: Add templateflow to DatasetLinks (#3267)
* ENH: Track proximal sources of functional GIFTIs (#3263)
* ENH: Support named derivative paths (#3264)
* ENH: Track Sources for standard-space outputs (#3262)
* ENH: Add --fs-no-resume option to reuse existing FreeSurfer outputs without resuming (#3142)
* ENH: Use BIDS URIs to track Sources in sidecars (#3255)
* ENH: Ignore unselected subjects in BIDSLayoutIndexer (#3236)
* ENH: Add metadata for motion parameters (#3245)
* ENH: Separate anatomical and functional reports per session for densely sampled dataset (#3191)
* ENH: Leverage T2w if available for BOLD -> anat coregistration (#3208)
* RF: Fix ITK warp conversion to nitransforms format (#3300)
* RF: Load report assembler from nireports (#3177)
* DOC: Clarify ``--dvars-spike-threshold`` uses standardized DVARS (#3205)
* TST: Update test to reflect new report generation behavior (#3210)
* STY: Manual conversions to f-strings (#3241)
* STY: Apply ruff/pyupgrade rule UP031 (#3280)
* STY: Lint and style check full repository (#3221)
* STY: Adopt ruff for linting and formatting (#3206)
* MNT: Pin libitk 5.3 and note dependencies (#3298)
* MNT: Upgrade ruff pre-commit, add fixing checks (#3283)
* MNT: Complete transition from flake8/black to ruff (#3279)
* MNT: Apply Repo-Review suggestions (#3194)
* MNT: Verbatim copy of Apache license 2.0 (#3259)
* MNT: Bump cryptography from 41.0.7 to 42.0.4 (#3234)
* MNT: Drop copyright year, unused dunder fields (#3247)
* MNT: Update environment pins (#3226)
* MNT: Bump codecov/codecov-action from 3 to 4 (#3219)
* DOCKER: Restore mincinfo binary (#3249)
* CI: Move to new circle machine tags (#3248)
* CI: Avoid ruff warning (#3244)
* CI: Pass ruff tests (#3243)
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