Skip to content

Conversation

@mgxd
Copy link
Collaborator

@mgxd mgxd commented Sep 24, 2025

Closes #3498

@mgxd mgxd changed the title enh: add boldref / sbrefs to source metadata enh: add boldref / sbref to source metadata Sep 24, 2025
@codecov
Copy link

codecov bot commented Sep 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.73%. Comparing base (089b494) to head (10c20b9).
⚠️ Report is 12 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3532      +/-   ##
==========================================
+ Coverage   73.72%   73.73%   +0.01%     
==========================================
  Files          60       60              
  Lines        4757     4756       -1     
  Branches      615      615              
==========================================
  Hits         3507     3507              
+ Misses       1109     1108       -1     
  Partials      141      141              

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

@mgxd mgxd marked this pull request as ready for review September 25, 2025 19:28
@mgxd
Copy link
Collaborator Author

mgxd commented Sep 25, 2025

Looking at the boldref sources for one of the CI runs.. the idea behind this change was to make it easier to trace whether an sbref or the hmc boldref (which is a derivative of the bold series itself) was used to create it. I don't think we should include working directory files in the sources, so we could consider a few options:

  • Backtracking to the first 'source' file (raw / derivative) and pass that along as a source
  • Saving additional outputs

@effigies
Copy link
Member

effigies commented Sep 25, 2025

Just to pull the contents:

sub-02_task-cuedSGT_run-01_desc-coreg_boldref.json

{
  "Sources": [
    "/scratch/fmriprep_25_2_wf/sub_02_wf/bold_task_cuedSGT_run_01_echo_1_wf/bold_fit_wf/hmc_boldref_wf/gen_avg/sub-02_task-cuedSGT_run-01_echo-1_bold_valid_average.nii.gz",
    "bids::sub-02/func/sub-02_task-cuedSGT_run-01_from-boldref_to-auto00000_mode-image_desc-fmap_xfm.txt",
    "/scratch/fmriprep_25_2_wf/sub_02_wf/fmap_preproc_wf/wf_auto_00000/bs_filter/fmap_syn0Warp_Hz_trans_coeff000.nii.gz"
  ]
}

@effigies
Copy link
Member

I think this just shows that we're not using the outputs of a datasink in our buffers. I'll fix that.

@effigies
Copy link
Member

sub-100185_task-machinegame_run-01_desc-coreg_boldref.json:

{
  "Sources": [
    "bids:raw:sub-100185/func/sub-100185_task-machinegame_run-01_sbref.nii.gz",
    "bids::sub-100185/func/sub-100185_task-machinegame_run-01_from-boldref_to-auto00000_mode-image_desc-fmap_xfm.txt",
    "bids::sub-100185/fmap/sub-100185_fmapid-auto00000_desc-coeff_fieldmap.nii.gz"
  ]
}

sub-100185_task-machinegame_run-01_from-boldref_to-T1w_mode-image_desc-coreg_xfm.json

{
  "GeneratedBy": [
    {
      "Name": "flirt",
      "Version": "<unknown>"
    }
  ],
  "Sources": [
    "bids::sub-100185/func/sub-100185_task-machinegame_run-01_desc-coreg_boldref.nii.gz"
  ]
}

sub-100185_task-machinegame_run-01_from-boldref_to-auto00000_mode-image_desc-fmap_xfm.json

{
  "Sources": [
    "bids:raw:sub-100185/func/sub-100185_task-machinegame_run-01_sbref.nii.gz",
    "bids::sub-100185/fmap/sub-100185_fmapid-auto00000_desc-magnitude_fieldmap.nii.gz"
  ]
}

sub-100185_task-machinegame_run-02_desc-coreg_boldref.json

{
  "Sources": [
    "bids:raw:sub-100185/func/sub-100185_task-machinegame_run-02_sbref.nii.gz",
    "bids::sub-100185/func/sub-100185_task-machinegame_run-02_from-boldref_to-auto00000_mode-image_desc-fmap_xfm.txt",
    "bids::sub-100185/fmap/sub-100185_fmapid-auto00000_desc-coeff_fieldmap.nii.gz"
  ]
}

sub-02_task-cuedSGT_run-01_desc-coreg_boldref.json

{
  "Sources": [
    "bids::sub-02/func/sub-02_task-cuedSGT_run-01_desc-hmc_boldref.nii.gz",
    "bids::sub-02/func/sub-02_task-cuedSGT_run-01_from-boldref_to-auto00000_mode-image_desc-fmap_xfm.txt",
    "bids::sub-02/fmap/sub-02_run-01_fmapid-auto00000_desc-coeff_fieldmap.nii.gz"
  ]
}

This could definitely be fleshed out more, but we're getting fieldmap and boldref/sbref sources from the input/output directories. I would suggest that we merge nipreps/sdcflows#506 and this and open an issue with "ideal" source lists that can be worked toward piecemeal.

After nipreps/sdcflows#506 is merged, I'll rebase this and relock the pixi environment.

Copy link
Member

@effigies effigies left a comment

Choose a reason for hiding this comment

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

I think this is good to go. Please merge if you're happy with it.

@mgxd
Copy link
Collaborator Author

mgxd commented Sep 26, 2025

looks great - thanks for the assist

@mgxd mgxd merged commit 8c51992 into master Sep 26, 2025
22 of 23 checks passed
@mgxd mgxd deleted the enh/bold-source branch September 26, 2025 15:50
effigies added a commit that referenced this pull request Oct 1, 2025
25.2.0 (October 01, 2025)

New feature release in the 25.2.x series.

This release is an *fMRIPrep Long-Term Support (LTS)* release.
The planned support window is 4 years, until October 2029.

This release is an incremental improvement over 25.1.x, but includes some fixes
and improvements that do not fit within our
`bug-fix policy <https://www.nipreps.org/devs/releases/#bug-fix-releases>`__.

Importantly, the change in interpolation in 25.1.0 introduced artifacts for some datasets.
This release changes the default interpolation mode to ``grid-constant``, which
resolves those problems while not reintroducing the issue the previous release sought to fix.

This release also (finally) introduces per-session processing.
The ``--session-label`` flag selects the sessions to process,
and the ``--subject-anatomical-reference`` flag indicates whether and how
to combine across sessions.
Existing filters passed via ``--bids-filter-file`` may need to be updated or
removed in favor of using these flags to achieve the desired behavior.

We would like to thank the AMP-SCZ and ENIGMA consortia for testing out and providing
feedback on this release.

  * FIX: Clean up output report language (#3529)
  * FIX: Default to grid-constant interpolation mode (#3516)
  * FIX: Adapt to transposed ndcoords in nitransforms (#3517)
  * FIX: Write out Freesurfer-derived outputs (#3512)
  * FIX: Add kwargs to _warnings.py (#3483)
  * ENH: Resample BOLD data to any surface template space using the Connectome Workbench (#3461)
  * ENH: Add boldref / sbref to source metadata (#3532)
  * ENH: Add dedicated session filtering, alternative anatomical template options (#3495)
  * ENH: Write out goodvoxels mask (#3513)
  * ENH: Add registration metadata to boldref-to-anat transforms (#3500)
  * ENH: Write out cortex mask GIFTIs (#3491)
  * ENH: Update transforms.py according to new transform chain of nitransforms (#3494)
  * RF/DOC: Improve and document command-line parser defaults (#3487)
  * DOC: Explain better SDC and B0FieldSource requirement (#2768)
  * DOC: Document `freesurfer` parameter in BOLD confound workflow init (#3504)
  * DOC: Add myself to contributor list (#3506)
  * DOC: Fix non-standard Input/Output docstring section management (#3505)
  * MNT: Split Dockerfile into base and pixi layers (#3521)
  * MNT: Replace conda with pixi and lock (#3503)
  * MNT: Update license metadata using SPDX expression (#3486)
  * MNT: no need to re-run `ruff check` after `ruff format` (#3480)
  * MNT: Update pre-commit ruff legacy alias (#3479)
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.

Improve consistency in referring to BOLD reference in reports

3 participants