Skip to content

Commit

Permalink
Document the nichart mode (#1325)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo authored Nov 18, 2024
1 parent 5df76de commit 91385ba
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 13 deletions.
32 changes: 31 additions & 1 deletion docs/workflows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Starting in version 0.8.0, XCP-D includes a required ``--mode`` parameter.
The ``mode`` parameter automatically defines sets of other parameters,
based on recommended processing pipelines for different studies.

XCP-D can be run in one of three modes: ``linc``, ``abcd``, or ``hbcd``.
XCP-D can be run in one of four modes: ``linc``, ``abcd``, ``hbcd``, or ``nichart``.
Each mode is designed by a different group, and has different requirements.

Users may also run XCP-D in ``none`` mode, in which case almost all of the parameters must be
Expand Down Expand Up @@ -66,6 +66,8 @@ which may be overridden by the user:
- ``--fd-thresh 0``: Censoring is disabled by default.
- ``--input-type fmriprep``: fMRIPrep outputs are expected as input.
- ``--linc-qc``: The LINC QC file will be created by default.
- ``--min-coverage 0.5``: The default coverage threshold is 0.5.
- ``--smoothing 6``: Smoothing is enabled by default.

Optional Parameters
-------------------
Expand Down Expand Up @@ -116,6 +118,8 @@ which may be overridden by the user:
- ``--combine-runs``: Runs will be concatenated by default.
- ``--warp-surfaces-native2std``: Surfaces will be warped to standard space by default.
- ``--linc-qc``: The LINC QC file will be created by default.
- ``--min-coverage 0.5``: The default coverage threshold is 0.5.
- ``--smoothing 6``: Smoothing is enabled by default.

Required Parameters
-------------------
Expand Down Expand Up @@ -167,6 +171,8 @@ which may be overridden by the user:
- ``--combine-runs``: Runs will be concatenated by default.
- ``--warp-surfaces-native2std``: Surfaces will be warped to standard space by default.
- ``--linc-qc``: The LINC QC file will be created by default.
- ``--min-coverage 0.5``: The default coverage threshold is 0.5.
- ``--smoothing 6``: Smoothing is enabled by default.

Required Parameters
-------------------
Expand All @@ -189,6 +195,30 @@ Optional Parameters
as well as the special value "all", which uses all of the low-motion data from the run.


nichart Mode
============

The ``nichart`` mode is used by the `NiChart project <https://neuroimagingchart.com/>`_.

This mode is very similar to ``linc`` mode, with the exception that it processes NIfTI files
by default and has smoothing disabled.

Defaults
--------

By default, the ``nichart`` mode will apply the following parameters,
which may be overridden by the user:

- ``--file-format nifti``: NIfTI files are used as input.
- ``--despike``: Despiking is enabled by default.
- ``--fd-thresh 0``: Motion-based censoring is disabled by default.
- ``--input-type fmriprep``: fMRIPrep outputs are expected as input.
- ``--linc-qc``: The LINC QC file will be created by default.
- ``--min-coverage 0.4``: The default coverage threshold is 0.4 instead of the more common 0.5.
- ``--output-type censored``: Censored data are the primary output.
- ``--smoothing 0``: Smoothing is disabled by default.


Major Differences Between Modes
===============================

Expand Down
16 changes: 4 additions & 12 deletions xcp_d/cli/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -982,11 +982,8 @@ def _validate_parameters(opts, build_log, parser):
if opts.output_type == 'censored':
error_messages.append(f"'--output-type' cannot be 'censored' for '{opts.mode}' mode.")
opts.output_type = 'interpolated'
opts.process_surfaces = True if opts.process_surfaces == 'auto' else opts.process_surfaces
opts.smoothing = 6 if opts.smoothing == 'auto' else opts.smoothing
opts.confounds_config = '36P' if opts.confounds_config == 'auto' else opts.confounds_config
opts.process_surfaces = (
True if (opts.process_surfaces == 'auto') else opts.process_surfaces
)
# Remove "all" from the list of correlation lengths
opts.dcan_correlation_lengths = [c for c in opts.dcan_correlation_lengths if c != 'all']
elif opts.mode == 'hbcd':
Expand All @@ -1010,11 +1007,8 @@ def _validate_parameters(opts, build_log, parser):
if opts.output_type == 'censored':
error_messages.append(f"'--output-type' cannot be 'censored' for '{opts.mode}' mode.")
opts.output_type = 'interpolated'
opts.process_surfaces = True if opts.process_surfaces == 'auto' else opts.process_surfaces
opts.smoothing = 6 if opts.smoothing == 'auto' else opts.smoothing
opts.confounds_config = '36P' if opts.confounds_config == 'auto' else opts.confounds_config
opts.process_surfaces = (
True if (opts.process_surfaces == 'auto') else opts.process_surfaces
)
# Remove "all" from the list of correlation lengths
opts.dcan_correlation_lengths = [c for c in opts.dcan_correlation_lengths if c != 'all']
elif opts.mode == 'linc':
Expand All @@ -1035,9 +1029,8 @@ def _validate_parameters(opts, build_log, parser):
f"'--output-type' cannot be 'interpolated' for '{opts.mode}' mode."
)
opts.output_type = 'censored'
opts.smoothing = 6 if opts.smoothing == 'auto' else opts.smoothing
opts.confounds_config = '36P' if opts.confounds_config == 'auto' else opts.confounds_config
opts.process_surfaces = False if opts.process_surfaces == 'auto' else opts.process_surfaces
opts.smoothing = 6 if opts.smoothing == 'auto' else opts.smoothing
if opts.dcan_correlation_lengths is not None:
error_messages.append(f"'--create-matrices' is not supported for '{opts.mode}' mode.")
elif opts.mode == 'nichart':
Expand All @@ -1057,9 +1050,8 @@ def _validate_parameters(opts, build_log, parser):
opts.min_coverage = 0.4 if opts.min_coverage == 'auto' else opts.min_coverage
opts.output_correlations = True if 'all' in opts.dcan_correlation_lengths else False
opts.output_type = 'censored' if opts.output_type == 'auto' else opts.output_type
opts.smoothing = 0 if opts.smoothing == 'auto' else opts.smoothing
opts.confounds_config = '36P' if opts.confounds_config == 'auto' else opts.confounds_config
opts.process_surfaces = False if opts.process_surfaces == 'auto' else opts.process_surfaces
opts.smoothing = 0 if opts.smoothing == 'auto' else opts.smoothing
# Remove "all" from the list of correlation lengths
opts.dcan_correlation_lengths = [c for c in opts.dcan_correlation_lengths if c != 'all']
elif opts.mode == 'none':
Expand Down

0 comments on commit 91385ba

Please sign in to comment.