Skip to content

Commit

Permalink
[DCAN] Enable DCAN QC by default (PennLINC#1086)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo authored Mar 19, 2024
1 parent d83d68e commit ac7dd5e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
6 changes: 3 additions & 3 deletions docs/outputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/workflows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.


Expand Down
14 changes: 11 additions & 3 deletions xcp_d/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions xcp_d/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
]
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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}"
)
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions xcp_d/workflows/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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"],
Expand Down Expand Up @@ -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=[],
Expand Down

0 comments on commit ac7dd5e

Please sign in to comment.