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

Fix fMRIPrep-related bugs #366

Merged
merged 2 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions aslprep/workflows/asl/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# https://www.nipreps.org/community/licensing/
#
"""Fit workflows for ASLPrep."""
import os
import typing as ty

import bids
Expand Down Expand Up @@ -201,6 +202,14 @@ def init_asl_fit_wf(
entity_overrides=config.execution.get().get("bids_filters", {}).get("sbref", {}),
layout=layout,
)
basename = os.path.basename(asl_file)
sbref_msg = f"No single-band-reference found for {basename}."
if sbref_file and "sbref" in config.workflow.ignore:
sbref_msg = f"Single-band reference file(s) found for {basename} and ignored."
sbref_file = []
elif sbref_file:
sbref_msg = f"Using single-band reference file(s) {os.path.basename(sbref_file)}."
config.loggers.workflow.info(sbref_msg)

# Get metadata from ASL file(s)
metadata = layout.get_metadata(asl_file)
Expand Down
7 changes: 5 additions & 2 deletions aslprep/workflows/asl/resampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,9 @@ def init_bold_fsLR_resampling_wf( # noqa: N802
):
"""Resample BOLD time series to fsLR surface.

This is copied from fMRIPrep and can be replaced with an fMRIPrep import once 23.2.0 is
released.

This workflow is derived heavily from three scripts within the DCAN-HCP pipelines scripts

Line numbers correspond to the locations of the code in the original scripts, found at:
Expand Down Expand Up @@ -426,8 +429,8 @@ def init_bold_fsLR_resampling_wf( # noqa: N802
]
atlases = smriprep_data.load_resource("atlases")
select_surfaces.inputs.template_roi = [
str(atlases / "L.atlasroi.32k_fs_LR.shape.gii"),
str(atlases / "R.atlasroi.32k_fs_LR.shape.gii"),
str(atlases / f"L.atlasroi.{fslr_density}_fs_LR.shape.gii"),
str(atlases / f"R.atlasroi.{fslr_density}_fs_LR.shape.gii"),
]

# RibbonVolumeToSurfaceMapping.sh
Expand Down
Loading