@@ -241,10 +241,10 @@ def init_bold_confs_wf(
241
241
acompcor .inputs .repetition_time = metadata ['RepetitionTime' ]
242
242
243
243
# Global and segment regressors
244
- gs_select = pe . Node ( niu . Select ( index = [ 0 , 1 ]), name = "gs_select" ,
245
- run_without_submitting = True )
246
- signals_class_labels = [ "csf" , "white_matter" , "global_signal" ]
247
- merge_rois = pe .Node (niu .Merge (2 , ravel_inputs = True ), name = 'merge_rois' ,
244
+ signals_class_labels = [
245
+ "global_signal" , "csf" , "white_matter" , "csf_wm" , "tcompcor" ,
246
+ ]
247
+ merge_rois = pe .Node (niu .Merge (3 , ravel_inputs = True ), name = 'merge_rois' ,
248
248
run_without_submitting = True )
249
249
signals = pe .Node (SignalExtraction (class_labels = signals_class_labels ),
250
250
name = "signals" , mem_gb = mem_gb )
@@ -316,7 +316,7 @@ def init_bold_confs_wf(
316
316
317
317
# Generate reportlet (Confound correlation)
318
318
conf_corr_plot = pe .Node (
319
- ConfoundsCorrelationPlot (reference_column = 'global_signal' , max_dim = 70 ),
319
+ ConfoundsCorrelationPlot (reference_column = 'global_signal' , max_dim = 20 ),
320
320
name = 'conf_corr_plot' )
321
321
ds_report_conf_corr = pe .Node (
322
322
DerivativesDataSink (desc = 'confoundcorr' , datatype = "figures" , dismiss_entities = ("echo" ,)),
@@ -326,6 +326,13 @@ def init_bold_confs_wf(
326
326
def _last (inlist ):
327
327
return inlist [- 1 ]
328
328
329
+ def _select_cols (table ):
330
+ import pandas as pd
331
+ return [
332
+ col for col in pd .read_table (table , nrows = 2 ).columns
333
+ if not col .startswith (("a_comp_cor_" , "t_comp_cor_" , "std_dvars" ))
334
+ ]
335
+
329
336
workflow .connect ([
330
337
# connect inputnode to each non-anatomical confound node
331
338
(inputnode , dvars , [('bold' , 'in_file' ),
@@ -351,9 +358,9 @@ def _last(inlist):
351
358
("bold_mask" , "mask_files" )]),
352
359
# Global signals extraction (constrained by anatomy)
353
360
(inputnode , signals , [('bold' , 'in_file' )]),
354
- (acc_msk_bin , gs_select , [('out_file ' , 'inlist ' )]),
355
- (gs_select , merge_rois , [('out ' , 'in1 ' )]),
356
- (inputnode , merge_rois , [('bold_mask ' , 'in2 ' )]),
361
+ (inputnode , merge_rois , [('bold_mask ' , 'in1 ' )]),
362
+ (acc_msk_bin , merge_rois , [('out_file ' , 'in2 ' )]),
363
+ (tcompcor , merge_rois , [('high_variance_masks ' , 'in3 ' )]),
357
364
(merge_rois , signals , [('out' , 'label_files' )]),
358
365
359
366
# Collate computed confounds together
@@ -395,7 +402,8 @@ def _last(inlist):
395
402
(acompcor , mrg_cc_metadata , [('metadata_file' , 'in2' )]),
396
403
(mrg_cc_metadata , compcor_plot , [('out' , 'metadata_files' )]),
397
404
(compcor_plot , ds_report_compcor , [('out_file' , 'in_file' )]),
398
- (concat , conf_corr_plot , [('confounds_file' , 'confounds_file' )]),
405
+ (concat , conf_corr_plot , [('confounds_file' , 'confounds_file' ),
406
+ (('confounds_file' , _select_cols ), 'columns' )]),
399
407
(conf_corr_plot , ds_report_conf_corr , [('out_file' , 'in_file' )]),
400
408
])
401
409
0 commit comments