11
11
12
12
BASE_LAYOUT = {
13
13
"01" : {
14
- "anat" : [{"suffix" : "T1w" }, {"suffix" : "T2w" }],
14
+ "anat" : [
15
+ {"run" : 1 , "suffix" : "T1w" },
16
+ {"run" : 2 , "suffix" : "T1w" },
17
+ {"suffix" : "T2w" },
18
+ ],
15
19
"func" : [
16
20
{
17
21
"task" : "rest" ,
39
43
}
40
44
41
45
46
+ @pytest .fixture (scope = "module" , autouse = True )
47
+ def quiet_logger ():
48
+ import logging
49
+
50
+ logger = logging .getLogger ("nipype.workflow" )
51
+ old_level = logger .getEffectiveLevel ()
52
+ logger .setLevel (logging .ERROR )
53
+ yield
54
+ logger .setLevel (old_level )
55
+
56
+
42
57
@pytest .fixture (scope = "module" )
43
58
def bids_root (tmp_path_factory ):
44
59
base = tmp_path_factory .mktemp ("base" )
@@ -115,6 +130,8 @@ def test_anat_fit_wf(
115
130
@pytest .mark .parametrize ("t1w_mask" , [False , True ])
116
131
@pytest .mark .parametrize ("t1w_dseg" , [False , True ])
117
132
@pytest .mark .parametrize ("t1w_tpms" , [False , True ])
133
+ @pytest .mark .parametrize ("t1w" , [1 , 2 ])
134
+ @pytest .mark .parametrize ("t2w" , [0 , 1 ])
118
135
def test_anat_fit_precomputes (
119
136
bids_root : Path ,
120
137
tmp_path : Path ,
@@ -123,10 +140,18 @@ def test_anat_fit_precomputes(
123
140
t1w_mask : bool ,
124
141
t1w_dseg : bool ,
125
142
t1w_tpms : bool ,
143
+ t1w : int ,
144
+ t2w : int ,
126
145
):
127
146
output_dir = tmp_path / 'output'
128
147
output_dir .mkdir ()
129
148
149
+ t1w_list = [
150
+ str (bids_root / "sub-01" / "anat" / "sub-01_run-1_T1w.nii.gz" ),
151
+ str (bids_root / "sub-01" / "anat" / "sub-01_run-2_T1w.nii.gz" ),
152
+ ][:t1w ]
153
+ t2w_list = [str (bids_root / "sub-01" / "anat" / "sub-01_T2w.nii.gz" )][:t2w ]
154
+
130
155
empty_img = nb .Nifti1Image (np .zeros ((1 , 1 , 1 )), np .eye (4 ))
131
156
precomputed = {}
132
157
if t1w_preproc :
@@ -146,12 +171,12 @@ def test_anat_fit_precomputes(
146
171
init_anat_fit_wf (
147
172
bids_root = str (bids_root ),
148
173
output_dir = str (output_dir ),
149
- freesurfer = False ,
174
+ freesurfer = True ,
150
175
hires = False ,
151
176
longitudinal = False ,
152
177
msm_sulc = True ,
153
- t1w = [ str ( bids_root / "sub-01" / "anat" / "sub-01_T1w.nii.gz" )] ,
154
- t2w = [ str ( bids_root / "sub-01" / "anat" / "sub-01_T2w.nii.gz" )] ,
178
+ t1w = t1w_list ,
179
+ t2w = t2w_list ,
155
180
skull_strip_mode = 'force' ,
156
181
skull_strip_template = Reference ("OASIS30ANTs" ),
157
182
spaces = SpatialReferences (
0 commit comments