From ac7dd5e4be3633fa78eeefc66be701587597cdb5 Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Tue, 19 Mar 2024 10:51:40 -0400 Subject: [PATCH] [DCAN] Enable DCAN QC by default (#1086) --- docs/outputs.rst | 6 +++--- docs/workflows.rst | 2 +- xcp_d/cli/run.py | 14 +++++++++++--- xcp_d/tests/test_cli.py | 7 ++----- xcp_d/workflows/base.py | 6 +++--- 5 files changed, 20 insertions(+), 15 deletions(-) diff --git a/docs/outputs.rst b/docs/outputs.rst index 287c6618b..c7984bc40 100644 --- a/docs/outputs.rst +++ b/docs/outputs.rst @@ -204,7 +204,7 @@ Denoised or residual BOLD data .. important:: The interpolated denoised BOLD files (``desc-interpolated``) should NOT be used for analyses. - These files are only generated if ``--dcan-qc`` is used, + These files are only generated if ``--skip-dcan-qc`` is not used, and primarily exist for compatibility with DCAN-specific analysis tools. The sidecar json files contains parameters of the data and processing steps. @@ -326,8 +326,8 @@ This file includes the high-motion volumes that are removed in most other deriva as volumes are removed by censoring, rather than regression. -DCAN style scrubbing file (if ``--dcan-qc`` is used) -==================================================== +DCAN style scrubbing file (if ``--skip-dcan-qc`` is not used) +============================================================= This file is in hdf5 format (readable by h5py), and contains binary scrubbing masks from 0.0 to 1mm FD in 0.01 steps. diff --git a/docs/workflows.rst b/docs/workflows.rst index a96a0c7dc..de7cf5277 100644 --- a/docs/workflows.rst +++ b/docs/workflows.rst @@ -449,7 +449,7 @@ to satisfy DCAN-specific tools. The residuals from the second step are referred to as the ``denoised, interpolated BOLD``. The ``denoised, interpolated BOLD`` will only be written out to the output -directory if the ``--dcan-qc`` flag is used, +directory if the ``--skip-dcan-qc`` flag is not used, as users **should not** use interpolated data directly. diff --git a/xcp_d/cli/run.py b/xcp_d/cli/run.py index fc8fab8be..c817f39c9 100644 --- a/xcp_d/cli/run.py +++ b/xcp_d/cli/run.py @@ -542,13 +542,21 @@ def get_parser(): **IMPORTANT**: This parameter can only be run if the --cifti flag is also enabled. """, ) - g_experimental.add_argument( + g_dcan_qc = g_experimental.add_mutually_exclusive_group(required=False) + g_dcan_qc.add_argument( "--dcan-qc", "--dcan_qc", action="store_true", dest="dcan_qc", - default=False, - help="Run DCAN QC.", + default=True, + help="Run DCAN QC. This option is deprecated as of 0.6.4 and will be removed in 0.7.0.", + ) + g_dcan_qc.add_argument( + "--skip-dcan-qc", + "--skip_dcan_qc", + action="store_false", + dest="dcan_qc", + help="Do not run DCAN QC.", ) return parser diff --git a/xcp_d/tests/test_cli.py b/xcp_d/tests/test_cli.py index b00c61a40..be386dfe2 100644 --- a/xcp_d/tests/test_cli.py +++ b/xcp_d/tests/test_cli.py @@ -52,6 +52,7 @@ def test_ds001419_nifti(data_dir, output_dir, working_dir): "--motion-filter-type=lp", "--band-stop-min=6", "--skip-parcellation", + "--skip-dcan-qc", "--random-seed=8675309", ] opts = run.get_parser().parse_args(parameters) @@ -109,7 +110,6 @@ def test_ds001419_cifti(data_dir, output_dir, working_dir): "--band-stop-max=18", "--cifti", "--combineruns", - "--dcan-qc", "--dummy-scans=auto", "--fd-thresh=0.3", "--upper-bpf=0.0", @@ -169,6 +169,7 @@ def test_ukbiobank(data_dir, output_dir, working_dir): "--smoothing=6", "--motion-filter-type=lp", "--band-stop-min=6", + "--skip-dcan-qc", "--min-coverage=0.1", "--random-seed=8675309", ] @@ -242,7 +243,6 @@ def test_pnc_cifti(data_dir, output_dir, working_dir): "--warp-surfaces-native2std", "--cifti", "--combineruns", - "--dcan-qc", "--dummy-scans=auto", "--fd-thresh=0.3", "--upper-bpf=0.0", @@ -316,7 +316,6 @@ def test_pnc_cifti_t2wonly(data_dir, output_dir, working_dir): "--warp-surfaces-native2std", "--cifti", "--combineruns", - "--dcan-qc", "--dummy-scans=auto", "--fd-thresh=0.3", "--lower-bpf=0.0", @@ -391,7 +390,6 @@ def test_fmriprep_without_freesurfer(data_dir, output_dir, working_dir): "--nuisance-regressors 27P " "--disable-bandpass-filter " "--min-time 20 " - "--dcan-qc " "--dummy-scans 1 " f"--custom_confounds={custom_confounds_dir}" ) @@ -437,7 +435,6 @@ def test_nibabies(data_dir, output_dir, working_dir): "--head_radius=auto", "--smoothing=0", "--fd-thresh=0", - "--dcan-qc", ] _run_and_generate( test_name=test_name, diff --git a/xcp_d/workflows/base.py b/xcp_d/workflows/base.py index 3a6e64d66..91f59f49b 100644 --- a/xcp_d/workflows/base.py +++ b/xcp_d/workflows/base.py @@ -81,7 +81,7 @@ def init_xcpd_wf( omp_nthreads, layout=None, process_surfaces=False, - dcan_qc=False, + dcan_qc=True, input_type="fmriprep", min_coverage=0.5, min_time=100, @@ -137,7 +137,7 @@ def init_xcpd_wf( omp_nthreads=1, layout=None, process_surfaces=False, - dcan_qc=False, + dcan_qc=True, input_type="fmriprep", min_time=100, atlases=["Glasser"], @@ -324,7 +324,7 @@ def init_subject_wf( random_seed=None, fd_thresh=0.3, despike=True, - dcan_qc=False, + dcan_qc=True, min_coverage=0.5, min_time=100, exact_time=[],