From 1ca8bbb075cc241e6b68a9ba7e61c5db590a0cbe Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 3 Nov 2023 14:08:47 -0400 Subject: [PATCH] RF: Move confounds datasink into bold_wf --- fmriprep/workflows/bold/base.py | 17 +++++++++++++++++ fmriprep/workflows/bold/outputs.py | 14 -------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/fmriprep/workflows/bold/base.py b/fmriprep/workflows/bold/base.py index a750e951d..99e75aecc 100644 --- a/fmriprep/workflows/bold/base.py +++ b/fmriprep/workflows/bold/base.py @@ -452,6 +452,19 @@ def init_bold_wf( name="bold_confounds_wf", ) + ds_confounds = pe.Node( + DerivativesDataSink( + base_directory=fmriprep_dir, + desc='confounds', + suffix='timeseries', + dismiss_entities=("echo",), + ), + name="ds_confounds", + run_without_submitting=True, + mem_gb=DEFAULT_MEMORY_MIN_GB, + ) + ds_confounds.inputs.source_file = bold_file + workflow.connect([ (inputnode, bold_confounds_wf, [ ('t1w_tpms', 'inputnode.t1w_tpms'), @@ -467,6 +480,10 @@ def init_bold_wf( (bold_native_wf, bold_confounds_wf, [ ('outputnode.bold_native', 'inputnode.bold'), ]), + (bold_confounds_wf, ds_confounds, [ + ('outputnode.confounds_file', 'in_file'), + ('outputnode.confounds_metadata', 'meta_dict'), + ]), ]) # fmt:skip # Fill-in datasinks of reportlets seen so far diff --git a/fmriprep/workflows/bold/outputs.py b/fmriprep/workflows/bold/outputs.py index 9f141f17c..d31cafc0b 100644 --- a/fmriprep/workflows/bold/outputs.py +++ b/fmriprep/workflows/bold/outputs.py @@ -961,17 +961,6 @@ def init_func_derivatives_wf( raw_sources = pe.Node(niu.Function(function=_bids_relative), name='raw_sources') raw_sources.inputs.bids_root = bids_root - ds_confounds = pe.Node( - DerivativesDataSink( - base_directory=output_dir, - desc='confounds', - suffix='timeseries', - dismiss_entities=("echo",), - ), - name="ds_confounds", - run_without_submitting=True, - mem_gb=DEFAULT_MEMORY_MIN_GB, - ) ds_ref_t1w_xfm = pe.Node( DerivativesDataSink( base_directory=output_dir, @@ -1001,9 +990,6 @@ def init_func_derivatives_wf( # fmt:off workflow.connect([ (inputnode, raw_sources, [('all_source_files', 'in_files')]), - (inputnode, ds_confounds, [('source_file', 'source_file'), - ('confounds', 'in_file'), - ('confounds_metadata', 'meta_dict')]), (inputnode, ds_ref_t1w_xfm, [('source_file', 'source_file'), ('bold2anat_xfm', 'in_file')]), (inputnode, ds_ref_t1w_inv_xfm, [('source_file', 'source_file'),