File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
nipype/interfaces/utility/tests Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 8
8
from nipype .interfaces import utility
9
9
import nipype .pipeline .engine as pe
10
10
11
+ concat_sort = """\
12
+ def concat_sort(in_arrays):
13
+ import numpy as np
14
+ all_vals = np.concatenate([arr.flatten() for arr in in_arrays])
15
+ return np.sort(all_vals)
16
+ """
11
17
12
18
def test_function (tmpdir ):
13
19
os .chdir (str (tmpdir ))
@@ -27,6 +33,12 @@ def increment_array(in_array):
27
33
f2 = pe .MapNode (utility .Function (function = increment_array ), name = 'increment_array' , iterfield = ['in_array' ])
28
34
29
35
wf .connect (f1 , 'random_array' , f2 , 'in_array' )
36
+
37
+ f3 = pe .Node (
38
+ utility .Function (function = concat_sort ),
39
+ name = "concat_sort" )
40
+
41
+ wf .connect (f2 , 'out' , f3 , 'in_arrays' )
30
42
wf .run ()
31
43
32
44
You can’t perform that action at this time.
0 commit comments