Skip to content

Commit

Permalink
TEST: Ensure the first sbref files are loadable
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Jul 10, 2024
1 parent f58b2ab commit 2516724
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fmriprep/workflows/bold/tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,18 @@ def test_bold_wf(
bold_series = [
str(bids_root / 'sub-01' / 'func' / 'sub-01_task-rest_run-1_bold.nii.gz'),
]
sbref = str(bids_root / 'sub-01' / 'func' / 'sub-01_task-rest_run-1_sbref.nii.gz')
elif task == 'nback':
bold_series = [
str(bids_root / 'sub-01' / 'func' / f'sub-01_task-nback_echo-{i}_bold.nii.gz')
for i in range(1, 4)
]
sbref = str(bids_root / 'sub-01' / 'func' / 'sub-01_task-nback_echo-1_sbref.nii.gz')

# The workflow will attempt to read file headers
for path in bold_series:
img.to_filename(path)
img.to_filename(sbref)

with mock_config(bids_dir=bids_root):
config.workflow.bold2anat_init = bold2anat_init
Expand Down
4 changes: 4 additions & 0 deletions fmriprep/workflows/bold/tests/test_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,19 @@ def test_bold_fit_precomputes(
bold_series = [
str(bids_root / 'sub-01' / 'func' / 'sub-01_task-rest_run-1_bold.nii.gz'),
]
sbref = str(bids_root / 'sub-01' / 'func' / 'sub-01_task-rest_run-1_sbref.nii.gz')
elif task == 'nback':
bold_series = [
str(bids_root / 'sub-01' / 'func' / f'sub-01_task-nback_echo-{i}_bold.nii.gz')
for i in range(1, 4)
]
sbref = str(bids_root / 'sub-01' / 'func' / 'sub-01_task-nback_echo-1_sbref.nii.gz')

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

dummy_nifti = str(tmp_path / 'dummy.nii')
dummy_affine = str(tmp_path / 'dummy.txt')
Expand Down

0 comments on commit 2516724

Please sign in to comment.