Skip to content

Commit 19201db

Browse files
committed
Merge remote-tracking branch 'upstream/maint/24.0.x'
2 parents b04519f + ed8e51d commit 19201db

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

fmriprep/workflows/bold/fit.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,14 @@ def init_bold_fit_wf(
465465

466466
# Select initial boldref, enhance contrast, and generate mask
467467
fmapref_buffer.inputs.sbref_files = sbref_files
468+
if sbref_files and nb.load(sbref_files[0]).ndim > 3:
469+
raw_sbref_wf = init_raw_boldref_wf(
470+
name='raw_sbref_wf',
471+
bold_file=sbref_files[0],
472+
multiecho=len(sbref_files) > 1,
473+
)
474+
workflow.connect(raw_sbref_wf, 'outputnode.boldref', fmapref_buffer, 'sbref_files')
475+
468476
enhance_boldref_wf = init_enhance_and_skullstrip_bold_wf(omp_nthreads=omp_nthreads)
469477

470478
ds_coreg_boldref_wf = init_ds_boldref_wf(

fmriprep/workflows/bold/tests/test_base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,18 @@ def test_bold_wf(
5656
bold_series = [
5757
str(bids_root / 'sub-01' / 'func' / 'sub-01_task-rest_run-1_bold.nii.gz'),
5858
]
59+
sbref = str(bids_root / 'sub-01' / 'func' / 'sub-01_task-rest_run-1_sbref.nii.gz')
5960
elif task == 'nback':
6061
bold_series = [
6162
str(bids_root / 'sub-01' / 'func' / f'sub-01_task-nback_echo-{i}_bold.nii.gz')
6263
for i in range(1, 4)
6364
]
65+
sbref = str(bids_root / 'sub-01' / 'func' / 'sub-01_task-nback_echo-1_sbref.nii.gz')
6466

6567
# The workflow will attempt to read file headers
6668
for path in bold_series:
6769
img.to_filename(path)
70+
img.to_filename(sbref)
6871

6972
with mock_config(bids_dir=bids_root):
7073
config.workflow.bold2anat_init = bold2anat_init

fmriprep/workflows/bold/tests/test_fit.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,19 @@ def test_bold_fit_precomputes(
8989
bold_series = [
9090
str(bids_root / 'sub-01' / 'func' / 'sub-01_task-rest_run-1_bold.nii.gz'),
9191
]
92+
sbref = str(bids_root / 'sub-01' / 'func' / 'sub-01_task-rest_run-1_sbref.nii.gz')
9293
elif task == 'nback':
9394
bold_series = [
9495
str(bids_root / 'sub-01' / 'func' / f'sub-01_task-nback_echo-{i}_bold.nii.gz')
9596
for i in range(1, 4)
9697
]
98+
sbref = str(bids_root / 'sub-01' / 'func' / 'sub-01_task-nback_echo-1_sbref.nii.gz')
9799

98100
# The workflow will attempt to read file headers
99101
for path in bold_series:
100102
img.to_filename(path)
103+
# Single volume sbref; multi-volume tested in test_base
104+
img.slicer[:, :, :, 0].to_filename(sbref)
101105

102106
dummy_nifti = str(tmp_path / 'dummy.nii')
103107
dummy_affine = str(tmp_path / 'dummy.txt')

0 commit comments

Comments
 (0)