@@ -78,7 +78,8 @@ def setup_class(self, tmpdir):
7878 def test_create_resting_preproc (self , mock_node , mock_realign_wf ):
7979 wflow = create_resting_preproc (base_dir = os .getcwd ())
8080
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
8283 mask_in = wflow .get_node ('threshold' ).inputs
8384 mask_in .out_file = self .in_filenames ['mask_file' ]
8485 func_in = wflow .get_node ('slicetimer' ).inputs
@@ -89,16 +90,17 @@ def test_create_resting_preproc(self, mock_node, mock_realign_wf):
8990 # assert
9091 expected_file = os .path .abspath (self .out_filenames ['components_file' ])
9192 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' ]]
102104
103105 fake_data = np .array ([[[[2 , 4 , 3 , 9 , 1 ], [3 , 6 , 4 , 7 , 4 ]],
104106 [[8 , 3 , 4 , 6 , 2 ], [4 , 0 , 4 , 4 , 2 ]]],
0 commit comments