Skip to content

Commit 7b18731

Browse files
committed
fix: replaced plugin_args with proper arguments
1 parent 951de05 commit 7b18731

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

examples/rsfmri_preprocessing.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
1717
python rsfmri_preprocessing.py -d /data/12345-34-1.dcm -f /data/Resting.nii
1818
-s subj001 -n 2 --despike -o output
19-
-p "plugin_args=dict(plugin='PBS', plugin_args=dict(qsub_args='-q many'))"
19+
-p PBS --plugin_args "dict(qsub_args='-q many')"
2020
"""
2121

2222
import os
@@ -471,7 +471,8 @@ def create_workflow(files,
471471
else:
472472
wf.connect(calc_median, 'median_file', aparctransform, 'source_file')
473473
wf.connect(register, 'out_reg_file', aparctransform, 'reg_file')
474-
wf.connect(fssource, ('aparc_aseg', get_aparc_aseg), aparctransform, 'target_file')
474+
wf.connect(fssource, ('aparc_aseg', get_aparc_aseg),
475+
aparctransform, 'target_file')
475476

476477
# Sample the average time series in aparc ROIs
477478
sampleaparc = MapNode(freesurfer.SegStats(avgwf_txt_file=True,
@@ -729,9 +730,11 @@ def create_resting_workflow(args):
729730
help="Output directory base")
730731
parser.add_argument("-w", "--work_dir", dest="work_dir",
731732
help="Output directory base")
732-
parser.add_argument("-p", "--plugin_args", dest="plugin_args",
733-
default='plugin_args=dict()',
734-
help="Plugin args")
733+
parser.add_argument("-p", "--plugin", dest="plugin",
734+
default='Linear',
735+
help="Plugin to use")
736+
parser.add_argument("--plugin_args", dest="plugin_args",
737+
help="Plugin arguments")
735738
parser.add_argument("--field_maps", dest="field_maps", nargs="+",
736739
help="field map niftis")
737740
parser.add_argument("--fm_echospacing", dest="echo_spacing", type=float,
@@ -750,5 +753,7 @@ def create_resting_workflow(args):
750753
work_dir = os.getcwd()
751754

752755
wf.base_dir = work_dir
753-
exec args.plugin_args
754-
wf.run(**plugin_args)
756+
if args.plugin_args:
757+
wf.run(args.plugin, plugin_args=eval(args.plugin_args))
758+
else:
759+
wf.run(args.plugin)

0 commit comments

Comments
 (0)