-
Notifications
You must be signed in to change notification settings - Fork 18
rf: Split fieldmap registration into its own fit step #531
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
Conversation
7f96d77 to
36aa373
Compare
0ac34b4 to
074820a
Compare
This comment was marked as outdated.
This comment was marked as outdated.
074820a to
0084257
Compare
effigies
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple notes for reviewers.
| 'importlib_resources; python_version < "3.11"', | ||
| "acres", | ||
| "fmriprep >= 24.1.0, <= 25.0.0", | ||
| "fmriprep ~= 25.1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed to relax the requirements for a transform list in ResampleSeries, so it can just SD unwarp a single volume.
| "sdcflows ~= 2.13.0", | ||
| "sentry-sdk <= 2.28.0", | ||
| "smriprep <= 0.18.0", | ||
| "smriprep ~= 0.18.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ~= reflects that we try quite hard to maintain backwards compatibility during patch releases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the ASL fit workflow to isolate fieldmap reconstruction into its own stage and updates key dependency versions.
- Updated version constraints for fmriprep, sdcflows, and smriprep in pyproject.toml
- Split
unwarp_wflogic into distinct stages: added Stage 3 for fieldmap reconstruction, Stage 4 for coregistration reference, and updated Stage 5 logging - Removed the old
init_unwarp_wfimport and reorganized workflow connections infit.py
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pyproject.toml | Bumped fmriprep, sdcflows, and smriprep to use ~= version syntax |
| aslprep/workflows/asl/fit.py | Split ASL fit into separate unwarp, fieldmap, and coreg stages; updated node imports and connect calls |
Comments suppressed due to low confidence (3)
aslprep/workflows/asl/fit.py:486
- The
ReconstructFieldmapnode is used here but not imported; please add the appropriate import (e.g.,from sdcflows.workflows.apply.fieldmap import ReconstructFieldmap) at the top of the file.
aslref_fmap = pe.Node(ReconstructFieldmap(inverse=[True]), name='aslref_fmap', mem_gb=1)
aslprep/workflows/asl/fit.py:553
- [nitpick] The Stage 4 block duplicates much of the workflow connection logic used elsewhere; consider extracting shared setup steps into a helper function to reduce repetition and improve readability.
if not coreg_aslref:
aslprep/workflows/asl/fit.py:656
- [nitpick] The log message for Stage 5 is ambiguous and similar to Stage 4; consider clarifying it (e.g., 'Stage 5: Adding ASL-to-anatomical registration workflow') to distinguish between stages.
config.loggers.workflow.info('Stage 5: Adding coregistration workflow')
tsalo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM. Just want @mattcieslak to take a look as well before merging.
The goal of this PR was initially to get SDC reports added to the ASL section of the reports when reusing minimal derivatives. The main thing that needed to happen was to reconstruct the fieldmap in the aslref space, which is part of the
unwarp_wfworkflow, deep inside the coregistration reference logic.This PR applies nipreps/fmriprep@32478f8 (part of nipreps/fmriprep#3423) to split up the
unwarp_wfinto three nodes, and pulls theReconstructFieldmapnode into the new stage 3.This needs applying to fMRIPrep, as well.