Skip to content

Commit

Permalink
RF: Move confounds datasink into bold_wf
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Nov 3, 2023
1 parent ad9f868 commit 3d541d5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
17 changes: 17 additions & 0 deletions fmriprep/workflows/bold/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,19 @@ def init_bold_wf(
name="bold_confounds_wf",
)

ds_confounds = pe.Node(

Check warning on line 455 in fmriprep/workflows/bold/base.py

View check run for this annotation

Codecov / codecov/patch

fmriprep/workflows/bold/base.py#L455

Added line #L455 was not covered by tests
DerivativesDataSink(
base_directory=fmriprep_dir,
desc='confounds',
suffix='timeseries',
dismiss_entities=("echo",),
),
name="ds_confounds",
run_without_submitting=True,
mem_gb=config.DEFAULT_MEMORY_MIN_GB,
)
ds_confounds.inputs.source_file = bold_file

Check warning on line 466 in fmriprep/workflows/bold/base.py

View check run for this annotation

Codecov / codecov/patch

fmriprep/workflows/bold/base.py#L466

Added line #L466 was not covered by tests

workflow.connect([

Check warning on line 468 in fmriprep/workflows/bold/base.py

View check run for this annotation

Codecov / codecov/patch

fmriprep/workflows/bold/base.py#L468

Added line #L468 was not covered by tests
(inputnode, bold_confounds_wf, [
('t1w_tpms', 'inputnode.t1w_tpms'),
Expand All @@ -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
Expand Down
14 changes: 0 additions & 14 deletions fmriprep/workflows/bold/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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'),
Expand Down

0 comments on commit 3d541d5

Please sign in to comment.