@@ -387,7 +387,8 @@ def create_reg_workflow(name='registration'):
387
387
'transformed_mean' ,
388
388
'segmentation_files' ,
389
389
'anat2target' ,
390
- 'aparc'
390
+ 'aparc' ,
391
+ 'min_cost_file'
391
392
]),
392
393
name = 'outputspec' )
393
394
@@ -505,7 +506,7 @@ def create_reg_workflow(name='registration'):
505
506
reg .inputs .args = '--float'
506
507
reg .inputs .output_warped_image = 'output_warped_image.nii.gz'
507
508
reg .inputs .num_threads = 4
508
- reg .plugin_args = {'qsub_args ' : '-l nodes=1:ppn=4' }
509
+ reg .plugin_args = {'sbatch_args ' : '-c%d' % 4 }
509
510
register .connect (stripper , 'out_file' , reg , 'moving_image' )
510
511
register .connect (inputnode ,'target_image' , reg ,'fixed_image' )
511
512
@@ -531,6 +532,7 @@ def create_reg_workflow(name='registration'):
531
532
warpmean .inputs .terminal_output = 'file'
532
533
warpmean .inputs .args = '--float'
533
534
warpmean .inputs .num_threads = 4
535
+ warpmean .plugin_args = {'sbatch_args' : '-c%d' % 4 }
534
536
535
537
register .connect (inputnode ,'target_image' , warpmean ,'reference_image' )
536
538
register .connect (inputnode , 'mean_image' , warpmean , 'input_image' )
@@ -554,6 +556,8 @@ def create_reg_workflow(name='registration'):
554
556
register .connect (reg , 'composite_transform' ,
555
557
outputnode , 'anat2target_transform' )
556
558
register .connect (merge , 'out' , outputnode , 'transforms' )
559
+ register .connect (bbregister , 'min_cost_file' ,
560
+ outputnode , 'min_cost_file' )
557
561
558
562
return register
559
563
@@ -593,6 +597,7 @@ def create_workflow(files,
593
597
realign .inputs .slice_times = slice_times
594
598
realign .inputs .tr = TR
595
599
realign .inputs .slice_info = 2
600
+ realign .plugin_args = {'sbatch_args' : '-c%d' % 4 }
596
601
597
602
598
603
# Comute TSNR on realigned data regressing polynomials upto order 2
@@ -615,6 +620,13 @@ def create_workflow(files,
615
620
registration .inputs .inputspec .subjects_dir = subjects_dir
616
621
registration .inputs .inputspec .target_image = target_file
617
622
623
+ """Quantify TSNR in each freesurfer ROI
624
+ """
625
+ get_roi_tsnr = MapNode (fs .SegStats (default_color_table = True ),
626
+ iterfield = ['in_file' ], name = 'get_aparc_tsnr' )
627
+ get_roi_tsnr .inputs .avgwf_txt_file = True
628
+ wf .connect (tsnr , 'tsnr_file' , get_roi_tsnr , 'in_file' )
629
+ wf .connect (registration , 'outputspec.aparc' , get_roi_tsnr , 'segmentation_file' )
618
630
619
631
"""Use :class:`nipype.algorithms.rapidart` to determine which of the
620
632
images in the functional series are outliers based on deviations in
@@ -754,7 +766,8 @@ def merge_files(in1, in2):
754
766
warpall .inputs .terminal_output = 'file'
755
767
warpall .inputs .reference_image = target_file
756
768
warpall .inputs .args = '--float'
757
- warpall .inputs .num_threads = 1
769
+ warpall .inputs .num_threads = 2
770
+ warpall .plugin_args = {'sbatch_args' : '-c%d' % 2 }
758
771
759
772
# transform to target
760
773
wf .connect (collector , 'out' , warpall , 'input_image' )
@@ -874,13 +887,14 @@ def get_names(files, suffix):
874
887
substitutions += [("_filtermotion%d" % i ,"" ) for i in range (11 )[::- 1 ]]
875
888
substitutions += [("_filter_noise_nosmooth%d" % i ,"" ) for i in range (11 )[::- 1 ]]
876
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 ]]
877
891
878
- substitutions += [("T1_out_brain_pve_0_maths_warped" ,"compcor_csf" ),
879
- ("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" ),
880
894
("T1_out_brain_pve_2_maths_warped" , "compcor_wm" ),
881
- ("output_warped_image_maths" ,"target_brain_mask" ),
882
- ("median_brain_mask" ,"native_brain_mask" ),
883
- ("corr_" ,"" )]
895
+ ("output_warped_image_maths" , "target_brain_mask" ),
896
+ ("median_brain_mask" , "native_brain_mask" ),
897
+ ("corr_" , "" )]
884
898
885
899
regex_subs = [('_combiner.*/sar' , '/smooth/' ),
886
900
('_combiner.*/ar' , '/unsmooth/' ),
@@ -910,6 +924,11 @@ def get_names(files, suffix):
910
924
wf .connect (filter1 , 'out_pf' , datasink , 'resting.qa.compmaps.@mc_pF' )
911
925
wf .connect (filter2 , 'out_f' , datasink , 'resting.qa.compmaps' )
912
926
wf .connect (filter2 , 'out_pf' , datasink , 'resting.qa.compmaps.@p' )
927
+ wf .connect (registration , 'outputspec.min_cost_file' , datasink , 'resting.qa.mincost' )
928
+ wf .connect (tsnr , 'tsnr_file' , datasink , 'resting.qa.tsnr.@map' )
929
+ wf .connect ([(get_roi_tsnr , datasink , [('avgwf_txt_file' , 'resting.qa.tsnr' ),
930
+ ('summary_file' , 'resting.qa.tsnr.@summary' )])])
931
+
913
932
wf .connect (bandpass , 'out_files' , datasink , 'resting.timeseries.@bandpassed' )
914
933
wf .connect (smooth , 'out_file' , datasink , 'resting.timeseries.@smoothed' )
915
934
wf .connect (createfilter1 , 'out_files' ,
0 commit comments