Skip to content

Commit 406834d

Browse files
committed
fix: remove pe, clean doc and add sbatch args
1 parent d4d023f commit 406834d

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

examples/rsfmri_vol_surface_preprocessing_nipy.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ def create_reg_workflow(name='registration'):
506506
reg.inputs.args = '--float'
507507
reg.inputs.output_warped_image = 'output_warped_image.nii.gz'
508508
reg.inputs.num_threads = 4
509-
reg.plugin_args = {'qsub_args': '-l nodes=1:ppn=4'}
509+
reg.plugin_args = {'sbatch_args': '-c%d' % 4}
510510
register.connect(stripper, 'out_file', reg, 'moving_image')
511511
register.connect(inputnode,'target_image', reg,'fixed_image')
512512

@@ -532,6 +532,7 @@ def create_reg_workflow(name='registration'):
532532
warpmean.inputs.terminal_output = 'file'
533533
warpmean.inputs.args = '--float'
534534
warpmean.inputs.num_threads = 4
535+
warpmean.plugin_args = {'sbatch_args': '-c%d' % 4}
535536

536537
register.connect(inputnode,'target_image', warpmean,'reference_image')
537538
register.connect(inputnode, 'mean_image', warpmean, 'input_image')
@@ -596,6 +597,7 @@ def create_workflow(files,
596597
realign.inputs.slice_times = slice_times
597598
realign.inputs.tr = TR
598599
realign.inputs.slice_info = 2
600+
realign.plugin_args = {'sbatch_args': '-c%d' % 4}
599601

600602

601603
# Comute TSNR on realigned data regressing polynomials upto order 2
@@ -620,8 +622,8 @@ def create_workflow(files,
620622

621623
"""Quantify TSNR in each freesurfer ROI
622624
"""
623-
get_roi_tsnr = pe.MapNode(fs.SegStats(default_color_table=True),
624-
iterfield=['in_file'], name='get_aparc_tsnr')
625+
get_roi_tsnr = MapNode(fs.SegStats(default_color_table=True),
626+
iterfield=['in_file'], name='get_aparc_tsnr')
625627
get_roi_tsnr.inputs.avgwf_txt_file = True
626628
wf.connect(tsnr, 'tsnr_file', get_roi_tsnr, 'in_file')
627629
wf.connect(registration, 'outputspec.aparc', get_roi_tsnr, 'segmentation_file')
@@ -764,7 +766,8 @@ def merge_files(in1, in2):
764766
warpall.inputs.terminal_output = 'file'
765767
warpall.inputs.reference_image = target_file
766768
warpall.inputs.args = '--float'
767-
warpall.inputs.num_threads = 1
769+
warpall.inputs.num_threads = 2
770+
warpall.plugin_args = {'sbatch_args': '-c%d' % 2}
768771

769772
# transform to target
770773
wf.connect(collector, 'out', warpall, 'input_image')
@@ -884,13 +887,14 @@ def get_names(files, suffix):
884887
substitutions += [("_filtermotion%d" % i,"") for i in range(11)[::-1]]
885888
substitutions += [("_filter_noise_nosmooth%d" % i,"") for i in range(11)[::-1]]
886889
substitutions += [("_makecompcorfilter%d" % i,"") for i in range(11)[::-1]]
890+
substitutions += [("_get_aparc_tsnr%d/" % i, "run%d_" % (i + 1)) for i in range(11)[::-1]]
887891

888-
substitutions += [("T1_out_brain_pve_0_maths_warped","compcor_csf"),
889-
("T1_out_brain_pve_1_maths_warped","compcor_gm"),
892+
substitutions += [("T1_out_brain_pve_0_maths_warped", "compcor_csf"),
893+
("T1_out_brain_pve_1_maths_warped", "compcor_gm"),
890894
("T1_out_brain_pve_2_maths_warped", "compcor_wm"),
891-
("output_warped_image_maths","target_brain_mask"),
892-
("median_brain_mask","native_brain_mask"),
893-
("corr_","")]
895+
("output_warped_image_maths", "target_brain_mask"),
896+
("median_brain_mask", "native_brain_mask"),
897+
("corr_", "")]
894898

895899
regex_subs = [('_combiner.*/sar', '/smooth/'),
896900
('_combiner.*/ar', '/unsmooth/'),
@@ -921,6 +925,7 @@ def get_names(files, suffix):
921925
wf.connect(filter2, 'out_f', datasink, 'resting.qa.compmaps')
922926
wf.connect(filter2, 'out_pf', datasink, 'resting.qa.compmaps.@p')
923927
wf.connect(registration, 'outputspec.min_cost_file', datasink, 'resting.qa.mincost')
928+
wf.connect(tsnr, 'tsnr_file', datasink, 'resting.qa.tsnr.@map')
924929
wf.connect([(get_roi_tsnr, datasink, [('avgwf_txt_file', 'resting.qa.tsnr'),
925930
('summary_file', 'resting.qa.tsnr.@summary')])])
926931

0 commit comments

Comments
 (0)