1
1
#!/usr/bin/env python
2
2
import sys
3
3
import os
4
- from niworkflows . nipype .pipeline import engine as pe
5
- from niworkflows . nipype .interfaces import utility as niu
6
- from niworkflows . nipype .utils .filemanip import fname_presuffix , copyfile
7
- from fmriprep .workflows .bold .utils import init_bold_reference_wf
4
+ from nipype .pipeline import engine as pe
5
+ from nipype .interfaces import utility as niu
6
+ from nipype .utils .filemanip import fname_presuffix , copyfile
7
+ from fmriprep .workflows .bold .util import init_bold_reference_wf
8
8
9
9
10
10
def sink_ref_file (in_file , orig_file , out_dir ):
@@ -15,18 +15,24 @@ def sink_ref_file(in_file, orig_file, out_dir):
15
15
16
16
def init_main_wf (bold_file , out_dir , base_dir = None , name = 'main_wf' ):
17
17
wf = init_bold_reference_wf (enhance_t2 = True ,
18
- base_dir = base_dir ,
18
+ omp_nthreads = 4 ,
19
19
name = name )
20
+ wf .base_dir = base_dir
20
21
wf .inputs .inputnode .bold_file = bold_file
21
22
22
- sink = pe .Node (Function (function = sink_ref_file , out_dir = out_dir ,
23
+ sink = pe .Node (niu . Function (function = sink_ref_file , out_dir = out_dir ,
23
24
orig_file = bold_file ),
24
25
name = 'sink' )
25
26
wf .connect ([
26
- ('outputnode' , ' sink' , [('bold_mask' , 'in_file' )]),
27
+ (wf . get_node ( 'outputnode' ), sink , [('bold_mask' , 'in_file' )]),
27
28
])
29
+ return wf
28
30
29
31
30
32
def main ():
31
33
main_wf = init_main_wf (sys .argv [1 ], sys .argv [2 ])
32
- main_wf .run ()
34
+ main_wf .run (plugin = 'MultiProc' )
35
+
36
+
37
+ if __name__ == '__main__' :
38
+ main ()
0 commit comments