Skip to content

Conversation

@effigies
Copy link
Member

@effigies effigies commented Mar 5, 2025

This is the last step for using pre-computed derivatives without recomputing. I'm able to target native, T1w, MNI and fsLR spaces using this.

This is mainly about fieldmaps in fmriprep.workflows.base, but other things fixed in passing:

  1. Reporting for bold2anat registration now says "precomputed". This is necessary because fallbacks are not attempted if no registration is attempted.
  2. Consolidates populating precomputed derivative buffers.

--use-syn-sdc still needs to be declared if SyN-SDC fieldmaps are to be used.

There's still a minor bug, or missed opportunity, in workflows.bold.fit to make sure that fieldmaps are reported even if coregistration is already done. It doesn't feel like it's worth holding this PR up to make that happen.

@codecov
Copy link

codecov bot commented Mar 6, 2025

Codecov Report

Attention: Patch coverage is 40.25974% with 46 lines in your changes missing coverage. Please review.

Project coverage is 72.37%. Comparing base (f81a304) to head (00fee36).
Report is 69 commits behind head on master.

Files with missing lines Patch % Lines
fmriprep/workflows/base.py 17.64% 26 Missing and 2 partials ⚠️
fmriprep/utils/bids.py 35.00% 13 Missing ⚠️
fmriprep/interfaces/reports.py 0.00% 3 Missing ⚠️
fmriprep/interfaces/resampling.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3439      +/-   ##
==========================================
- Coverage   72.99%   72.37%   -0.63%     
==========================================
  Files          57       57              
  Lines        4369     4430      +61     
  Branches      548      570      +22     
==========================================
+ Hits         3189     3206      +17     
- Misses       1060     1107      +47     
+ Partials      120      117       -3     

☔ 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.

@effigies effigies added this to the 25.0.0 milestone Mar 17, 2025
@effigies effigies marked this pull request as ready for review March 18, 2025 20:10
@effigies
Copy link
Member Author

@mgxd A review would be appreciated. I've run this locally on ds000217 and its OpenNeuro derivatives (selected due to having a fieldmap and minimal derivatives).

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.

few comments, but overall happy with this!

@effigies
Copy link
Member Author

@mgxd want to have a look at 24b04e3? I feel like that will be more readable than an information dump.

Co-authored-by: Mathias Goncalves <goncalves.mathias@gmail.com>
@effigies effigies merged commit 2106034 into nipreps:master Mar 20, 2025
19 of 21 checks passed
@effigies effigies deleted the fix/transforms branch March 20, 2025 19:57
effigies added a commit that referenced this pull request Mar 25, 2025
25.0.0 (March 25, 2025)

New feature release in the 25.0.x series.

This release substantially improves support for pre-computed derivatives.
Previous releases would miss some derivatives and rerun the computations.
Note that derivatives from previous versions will be accepted,
so it should not be necessary to recompute derivatives from previous versions.
The recommended command line is::

    fmriprep BIDS_DIR OUT_DIR participant --derivatives fmriprep=PRECOMP_DIR

Note that multiple derivatives can be specified, for example::

    fmriprep BIDS_DIR OUT_DIR participant \
      anat=PRECOMPUTED_ANATOMICAL_DIR \
      func=PRECOMPUTED_FUNCTIONAL_DIR

When the same file is found in multiple derivatives, the last one found takes precedence.

Additionally, `--force-*` flags have been consolidated into a single
`--force` flag that can take multiple, space-separated arguments.

Structural processing changes
-----------------------------
We now output white, pial and midthickness fsLR meshes on the subject surface.
Look for `sub-<subject>_hemi-<L|R>_space-fsLR_*_<surf>.surf.gii` files.

Brain extraction has been modified slightly to more closely match the
`antsBrainExtraction.sh` workflow distributed by ANTs.
The impact should be minimal, but in rare cases this fixes a crash.

Fieldmap processing changes
---------------------------
SyN-SDC fieldmap filtering is now single-level, following the improvements
for gradient-echo fieldmaps in 24.1.

Jacobian-weighting during fieldmap unwarping is now on by default *only*
for PEPolar fieldmaps.
To enable for other fieldmap types, use `--force fieldmap-jacobian`.

All merged pull requests
------------------------

* FIX: Detect and apply precomputed fieldmaps (#3439)
* FIX: Calculate bold mask and dummy scans in transform-only runs (#3428)
* FIX: Use consistent skull-stripping pre- and post- SDC (#3415)
* FIX: Use removeprefix instead of lstrip or ternary operator (#3409)
* FIX: Listify sessions when generating reports (#3408)
* FIX: Ensure fieldmap is resampled correctly in report (#3387)
* FIX: Stop excluding FS minc_modify_header used during fallback registration (#3372)
* FIX: Repair and test query for precalculated baseline/boldref files (#3370)
* FIX: Repair search for precomputed transforms (#3369)
* ENH: Enable Jacobians only for PEPOLAR by default, allow forcing (#3443)
* ENH: Create `--force` flag that accepts a list, replacing individual `--force-*` flags (#3442)
* ENH: Output fsLR meshes on subject surfaces (#3411)
* ENH: Flexibilize "sophisticated" pepolar to allow monomodal execution (#3393)
* ENH: Update FSL packages for reported bug fixes (#3374)
* RF: Calculate RMSD from motion transforms (#3427)
* RF: Reconstruct motion confounds from minimal derivatives (#3424)
* RF: Replace deprecated pkgutil.find_loader (#3384)
* RF: Upgrade nitransforms and remove workarounds (#3378)
* DOC: Fix xfm extension in the outputs docs (#3435)
* DOC: Mention fMRIPost-AROMA in parser documentation (#3356)
* MNT: Remove CLI flags with expired deprecation periods (#3445)
* MNT: Update pinned environment (#3440)
* MNT: Bump pins, update RTD config (#3425)
* MNT: Declare linux/amd64 platform during Docker build (#3422)
* MNT: Bump astral-sh/setup-uv from 4 to 5 (#3417)
* MNT: Test support for Python 3.13 (#3416)
* MNT: Install Workbench CLI via conda (#3410)
* MNT: Update minimum dependencies, test with tox-uv (#3412)
* MNT: Install c3d through conda (#3382)
* CI: Fetch tags and 200 commits to support describe (#3381)
* CI: Build docker images in GHA, store cache inline and push to GHCR (#3380)
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