Skip to content

Commit

Permalink
Fix fMRIPrep-related bugs (#366)
Browse files Browse the repository at this point in the history
* Fix CIFTI density bug.

Copied from nipreps/fmriprep#3179.

* Ignore sbrefs when requested.

Copied from nipreps/fmriprep#3180.
  • Loading branch information
tsalo committed Dec 8, 2023
1 parent 3b1c478 commit 6bcc6ff
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
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

0 comments on commit 6bcc6ff

Please sign in to comment.