@@ -78,7 +78,8 @@ def setup_class(self, tmpdir):
78
78
def test_create_resting_preproc (self , mock_node , mock_realign_wf ):
79
79
wflow = create_resting_preproc (base_dir = os .getcwd ())
80
80
81
- wflow .inputs .inputspec .num_noise_components = self .num_noise_components
81
+ # wflow.inputs.inputspec.num_noise_components = self.num_noise_components
82
+ wflow .inputs .compcor .variance_threshold = 0.15
82
83
mask_in = wflow .get_node ('threshold' ).inputs
83
84
mask_in .out_file = self .in_filenames ['mask_file' ]
84
85
func_in = wflow .get_node ('slicetimer' ).inputs
@@ -89,16 +90,17 @@ def test_create_resting_preproc(self, mock_node, mock_realign_wf):
89
90
# assert
90
91
expected_file = os .path .abspath (self .out_filenames ['components_file' ])
91
92
with open (expected_file , 'r' ) as components_file :
92
- components_data = [line .split () for line in components_file ]
93
- num_got_components = len (components_data )
94
- assert (num_got_components == self .num_noise_components
95
- or num_got_components == self .fake_data .shape [3 ])
96
- first_two = [row [:2 ] for row in components_data [1 :]]
97
- assert first_two == [['-0.5172356654' , '-0.6973053243' ], [
98
- '0.2574722644' , '0.1645270737'
99
- ], ['-0.0806469590' ,
100
- '0.5156853779' ], ['0.7187176051' , '-0.3235820287' ],
101
- ['-0.3783072450' , '0.3406749013' ]]
93
+ components_data = [line .split ()
94
+ for line in components_file .read ().splitlines ()]
95
+ num_got_components = len (components_data )
96
+ assert (num_got_components == self .num_noise_components or
97
+ num_got_components == self .fake_data .shape [3 ])
98
+ first_two = [row [:2 ] for row in components_data [1 :]]
99
+ assert first_two == [['-0.5172356654' , '-0.6973053243' ],
100
+ ['0.2574722644' , '0.1645270737' ],
101
+ ['-0.0806469590' , '0.5156853779' ],
102
+ ['0.7187176051' , '-0.3235820287' ],
103
+ ['-0.3783072450' , '0.3406749013' ]]
102
104
103
105
fake_data = np .array ([[[[2 , 4 , 3 , 9 , 1 ], [3 , 6 , 4 , 7 , 4 ]],
104
106
[[8 , 3 , 4 , 6 , 2 ], [4 , 0 , 4 , 4 , 2 ]]],
0 commit comments