1
- ''' Testing module for fmriprep.workflows.base '''
1
+ ''' Testing module for fmriprep.workflows.bold.util '''
2
2
import pytest
3
+ import os
3
4
4
5
import numpy as np
6
+ from nipype .utils .filemanip import fname_presuffix
5
7
from nilearn .image import load_img
6
8
from ..util import init_bold_reference_wf
7
9
@@ -16,7 +18,29 @@ def symmetric_overlap(img1, img2):
16
18
return overlap / np .sqrt (total1 * total2 )
17
19
18
20
19
- @pytest .skip
21
+ @pytest .mark .skipif (not os .getenv ('FMRIPREP_REGRESSION_SOURCE' ) or
22
+ not os .getenv ('FMRIPREP_REGRESSION_TARGETS' ))
23
+ @pytest .mark .parametrize ('input_name,expected_fname' , [
24
+ (os .path .join (os .getenv ('FMRIPREP_REGRESSION_SOURCE' , '' ),
25
+ base_fname ),
26
+ fname_presuffix (base_fname , suffix = '_mask' , use_ext = True ,
27
+ new_path = os .getenv ('FMRIPREP_REGRESSION_TARGETS' , '' )))
28
+ for base_fname in (
29
+ 'ds000116/sub-12_task-visualoddballwithbuttonresponsetotargetstimuli_run-02_bold.nii.gz' ,
30
+ # 'ds000133/sub-06_ses-post_task-rest_run-01_bold.nii.gz',
31
+ # 'ds000140/sub-32_task-heatpainwithregulationandratings_run-02_bold.nii.gz',
32
+ # 'ds000157/sub-23_task-passiveimageviewing_bold.nii.gz',
33
+ # 'ds000210/sub-06_task-rest_run-01_echo-1_bold.nii.gz',
34
+ # 'ds000210/sub-06_task-rest_run-01_echo-2_bold.nii.gz',
35
+ # 'ds000210/sub-06_task-rest_run-01_echo-3_bold.nii.gz',
36
+ # 'ds000216/sub-03_task-rest_echo-1_bold.nii.gz',
37
+ # 'ds000216/sub-03_task-rest_echo-2_bold.nii.gz',
38
+ # 'ds000216/sub-03_task-rest_echo-3_bold.nii.gz',
39
+ # 'ds000216/sub-03_task-rest_echo-4_bold.nii.gz',
40
+ # 'ds000237/sub-03_task-MemorySpan_acq-multiband_run-01_bold.nii.gz',
41
+ # 'ds000237/sub-06_task-MemorySpan_acq-multiband_run-01_bold.nii.gz',
42
+ )
43
+ ])
20
44
def test_masking (input_fname , expected_fname ):
21
45
bold_reference_wf = init_bold_reference_wf (enhance_t2 = True )
22
46
bold_reference_wf .inputs .inputnode .bold_file = input_fname
0 commit comments