@@ -506,7 +506,7 @@ def create_reg_workflow(name='registration'):
506
506
reg .inputs .args = '--float'
507
507
reg .inputs .output_warped_image = 'output_warped_image.nii.gz'
508
508
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 }
510
510
register .connect (stripper , 'out_file' , reg , 'moving_image' )
511
511
register .connect (inputnode ,'target_image' , reg ,'fixed_image' )
512
512
@@ -532,6 +532,7 @@ def create_reg_workflow(name='registration'):
532
532
warpmean .inputs .terminal_output = 'file'
533
533
warpmean .inputs .args = '--float'
534
534
warpmean .inputs .num_threads = 4
535
+ warpmean .plugin_args = {'sbatch_args' : '-c%d' % 4 }
535
536
536
537
register .connect (inputnode ,'target_image' , warpmean ,'reference_image' )
537
538
register .connect (inputnode , 'mean_image' , warpmean , 'input_image' )
@@ -596,6 +597,7 @@ def create_workflow(files,
596
597
realign .inputs .slice_times = slice_times
597
598
realign .inputs .tr = TR
598
599
realign .inputs .slice_info = 2
600
+ realign .plugin_args = {'sbatch_args' : '-c%d' % 4 }
599
601
600
602
601
603
# Comute TSNR on realigned data regressing polynomials upto order 2
@@ -620,8 +622,8 @@ def create_workflow(files,
620
622
621
623
"""Quantify TSNR in each freesurfer ROI
622
624
"""
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' )
625
627
get_roi_tsnr .inputs .avgwf_txt_file = True
626
628
wf .connect (tsnr , 'tsnr_file' , get_roi_tsnr , 'in_file' )
627
629
wf .connect (registration , 'outputspec.aparc' , get_roi_tsnr , 'segmentation_file' )
@@ -764,7 +766,8 @@ def merge_files(in1, in2):
764
766
warpall .inputs .terminal_output = 'file'
765
767
warpall .inputs .reference_image = target_file
766
768
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 }
768
771
769
772
# transform to target
770
773
wf .connect (collector , 'out' , warpall , 'input_image' )
@@ -884,13 +887,14 @@ def get_names(files, suffix):
884
887
substitutions += [("_filtermotion%d" % i ,"" ) for i in range (11 )[::- 1 ]]
885
888
substitutions += [("_filter_noise_nosmooth%d" % i ,"" ) for i in range (11 )[::- 1 ]]
886
889
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 ]]
887
891
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" ),
890
894
("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_" , "" )]
894
898
895
899
regex_subs = [('_combiner.*/sar' , '/smooth/' ),
896
900
('_combiner.*/ar' , '/unsmooth/' ),
@@ -921,6 +925,7 @@ def get_names(files, suffix):
921
925
wf .connect (filter2 , 'out_f' , datasink , 'resting.qa.compmaps' )
922
926
wf .connect (filter2 , 'out_pf' , datasink , 'resting.qa.compmaps.@p' )
923
927
wf .connect (registration , 'outputspec.min_cost_file' , datasink , 'resting.qa.mincost' )
928
+ wf .connect (tsnr , 'tsnr_file' , datasink , 'resting.qa.tsnr.@map' )
924
929
wf .connect ([(get_roi_tsnr , datasink , [('avgwf_txt_file' , 'resting.qa.tsnr' ),
925
930
('summary_file' , 'resting.qa.tsnr.@summary' )])])
926
931
0 commit comments