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

Track proximal sources of functional GIFTIs #3263

Merged
merged 5 commits into from
Mar 29, 2024

Conversation

tsalo
Copy link
Collaborator

@tsalo tsalo commented Mar 28, 2024

Related to #3261.

Changes proposed in this pull request

  • Add an outputnode to init_ds_volumes_wf with the saved bold path.
  • Add sources field to init_bold_surf_wf's inputnode.
  • Infer Sources for functional GIFTI outputs.
    • If the user has requested T1w-space outputs, then this should be bold from the associated ds_volumes_wf and fsnative2t1w_xfm
    • If the user didn't want T1w-space volumetric outputs, then this should be the raw BOLD file, motion_xfm, boldref2anat_xfm, fsnative2t1w_xfm.

Documentation that should be reviewed

Copy link

codecov bot commented Mar 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.86%. Comparing base (ecf8580) to head (79eb79e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3263      +/-   ##
==========================================
+ Coverage   73.82%   73.86%   +0.04%     
==========================================
  Files          56       56              
  Lines        4279     4286       +7     
==========================================
+ Hits         3159     3166       +7     
  Misses       1120     1120              

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

@tsalo
Copy link
Collaborator Author

tsalo commented Mar 28, 2024

The GIFTI metadata from ds005 look good:

{
  "RepetitionTime": 2.0,
  "SliceTimingCorrected": false,
  "Sources": [
    "bids:raw:sub-01/func/sub-01_task-mixedgamblestask_run-01_bold.nii.gz",
    "bids::sub-01/func/sub-01_task-mixedgamblestask_run-01_from-orig_to-boldref_mode-image_desc-hmc_xfm.txt",
    "bids::sub-01/func/sub-01_task-mixedgamblestask_run-01_from-boldref_to-T1w_mode-image_desc-coreg_xfm.txt",
    "bids:deriv-0:sub-01/anat/sub-01_from-fsnative_to-T1w_mode-image_xfm.txt"
  ],
  "TaskName": "mixed-gambles task"
}

This is how they should look if the user doesn't want T1w-space outputs. If they do, then I think the Sources should look like:

{
  "Sources": [
    "bids::sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_desc-preproc_bold.nii.gz",
    "bids:deriv-0:sub-01/anat/sub-01_from-fsnative_to-T1w_mode-image_xfm.txt"
  ],
}

@tsalo tsalo marked this pull request as ready for review March 28, 2024 18:38
@tsalo tsalo requested a review from effigies March 29, 2024 15:26
fmriprep/workflows/bold/base.py Outdated Show resolved Hide resolved
(inputnode, merge_surface_sources, [('fsnative2t1w_xfm', 'in2')]),
]) # fmt:skip
else:
# sources are bold_file, motion_xfm, boldref2anat_xfm, fsnative2t1w_xfm
Copy link
Member

Choose a reason for hiding this comment

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

I would include the white-matter and pial surfaces for each hemisphere, since those determine the coordinates at which the BOLD is sampled. If that's difficult to do at the moment, I'm fine with postponing it to another PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The hemisphere loop happens within init_bold_surf_wf, so I need to add those sources there, but I can't pin down where exactly those two files are grabbed in the workflow. I think it'll have to wait for another PR.

fmriprep/workflows/bold/outputs.py Outdated Show resolved Hide resolved
@effigies effigies merged commit 123c3f8 into nipreps:master Mar 29, 2024
17 checks passed
@tsalo tsalo deleted the track-proximal-sources-2 branch March 29, 2024 18:58
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