Skip to content

Commit 348e37f

Browse files
effigiesoesteban
authored andcommitted
Update script
1 parent 1afb134 commit 348e37f

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

scripts/generate_reference_mask.py

100644100755
Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/usr/bin/env python
22
import sys
33
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
88

99

1010
def sink_ref_file(in_file, orig_file, out_dir):
@@ -15,18 +15,24 @@ def sink_ref_file(in_file, orig_file, out_dir):
1515

1616
def init_main_wf(bold_file, out_dir, base_dir=None, name='main_wf'):
1717
wf = init_bold_reference_wf(enhance_t2=True,
18-
base_dir=base_dir,
18+
omp_nthreads=4,
1919
name=name)
20+
wf.base_dir = base_dir
2021
wf.inputs.inputnode.bold_file = bold_file
2122

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,
2324
orig_file=bold_file),
2425
name='sink')
2526
wf.connect([
26-
('outputnode', 'sink', [('bold_mask', 'in_file')]),
27+
(wf.get_node('outputnode'), sink, [('bold_mask', 'in_file')]),
2728
])
29+
return wf
2830

2931

3032
def main():
3133
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

Comments
 (0)