|
4 | 4 | from nipype.pipeline import engine as pe |
5 | 5 | from nipype.interfaces import utility as niu |
6 | 6 |
|
7 | | -from ...config import DEFAULT_MEMORY_MIN_GB |
8 | | -from ...interfaces import DerivativesDataSink |
| 7 | +from fmriprep import config |
| 8 | +from fmriprep.config import DEFAULT_MEMORY_MIN_GB |
| 9 | +from fmriprep.interfaces import DerivativesDataSink |
9 | 10 |
|
10 | 11 |
|
11 | 12 | def init_func_derivatives_wf( |
@@ -62,7 +63,7 @@ def init_func_derivatives_wf( |
62 | 63 | 'bold_mask_native', 'cifti_variant', 'cifti_metadata', 'cifti_density', |
63 | 64 | 'confounds', 'confounds_metadata', 'melodic_mix', 'nonaggr_denoised_file', |
64 | 65 | 'source_file', 'surf_files', 'surf_refs', 'template', 'spatial_reference', |
65 | | - 'bold2anat_xfm', 'anat2bold_xfm']), |
| 66 | + 'bold2anat_xfm', 'anat2bold_xfm', 'acompcor_masks', 'tcompcor_mask']), |
66 | 67 | name='inputnode') |
67 | 68 |
|
68 | 69 | raw_sources = pe.Node(niu.Function(function=_bids_relative), name='raw_sources') |
@@ -338,6 +339,23 @@ def init_func_derivatives_wf( |
338 | 339 | (('cifti_metadata', _read_json), 'meta_dict')]) |
339 | 340 | ]) |
340 | 341 |
|
| 342 | + if "compcor" in config.execution.debug: |
| 343 | + ds_acompcor_masks = pe.Node( |
| 344 | + DerivativesDataSink( |
| 345 | + base_directory=output_dir, desc=[f"CompCor{_}" for _ in "CWA"], |
| 346 | + suffix="mask", compress=True), |
| 347 | + name="ds_acompcor_masks", run_without_submitting=True) |
| 348 | + ds_tcompcor_mask = pe.Node( |
| 349 | + DerivativesDataSink( |
| 350 | + base_directory=output_dir, desc="CompCorT", suffix="mask", compress=True), |
| 351 | + name="ds_tcompcor_mask", run_without_submitting=True) |
| 352 | + workflow.connect([ |
| 353 | + (inputnode, ds_acompcor_masks, [("acompcor_masks", "in_file"), |
| 354 | + ("source_file", "source_file")]), |
| 355 | + (inputnode, ds_tcompcor_mask, [("tcompcor_mask", "in_file"), |
| 356 | + ("source_file", "source_file")]), |
| 357 | + ]) |
| 358 | + |
341 | 359 | return workflow |
342 | 360 |
|
343 | 361 |
|
|
0 commit comments