xcp_d.workflows.outputs module

Workflows for collecting and saving xcp_d outputs.

xcp_d.workflows.outputs.init_copy_inputs_to_outputs_wf(output_dir, name='copy_inputs_to_outputs_wf')[source]

Copy files from the preprocessing derivatives to the output folder, with no modifications.

Workflow Graph

(Source code)

Parameters:
  • output_dir (str) – Path to the output directory for xcp_d derivatives. This should not include the xcp_d folder. For example, “/path/to/dset/derivatives/”.

  • name (str, optional) – Name of the workflow. This is used for working directories and workflow graphs. Default is “copy_inputs_to_outputs_wf”.

Inputs:
  • lh_pial_surf

  • rh_pial_surf

  • lh_wm_surf

  • rh_wm_surf

  • lh_sulcal_depth

  • rh_sulcal_depth

  • lh_sulcal_curv

  • rh_sulcal_curv

  • lh_cortical_thickness

  • rh_cortical_thickness

xcp_d.workflows.outputs.init_postproc_derivatives_wf(name_source, bandpass_filter, low_pass, high_pass, fd_thresh, motion_filter_type, smoothing, params, cifti, dcan_qc, output_dir, TR, name='postproc_derivatives_wf')[source]

Write out the xcp_d derivatives in BIDS format.

Workflow Graph

(Source code)

Parameters:
  • name_source (str) – bold or cifti files

  • low_pass (float) – low pass filter

  • high_pass (float) – high pass filter

  • fd_thresh (float) – Framewise displacement threshold for censoring, in millimeters. Any framewise displacement values higher than the threshold are flagged as “high motion”. If set to <=0, no censoring will be performed. Default is 0.2 mm.

  • motion_filter_type ({None, “lp”, “notch”}) – Type of filter to use for removing respiratory artifact from motion regressors.

    If None, no filter will be applied.

    If the filter type is set to “notch”, frequencies between band_stop_min and band_stop_max will be removed with a notch filter. In this case, both band_stop_min and band_stop_max must be defined.

    If “lp”, frequencies above band_stop_min will be removed with a Butterworth filter. In this case, only band_stop_min must be defined.

  • smoothing (float) – The full width at half maximum (FWHM), in millimeters, of the Gaussian smoothing kernel that will be applied to the post-processed and denoised data. ALFF and ReHo outputs will also be smoothing with this kernel.

  • params ({“36P”, “24P”, “27P”, “acompcor”, “acompcor_gsr”, “aroma”, “aroma_gsr”, “custom”}, optional) – Shorthand for the parameter set to extract from the confounds TSV. Default is “36P”, most expansive option.

  • cifti (bool) – Post-process surface data (CIFTIs) instead of volumetric data (NIFTIs). This parameter is overridden when DCAN- or HCP-format data are provided. Default is False.

  • dcan_qc (bool) – This flag determines if DCAN-related QC steps will be taken. Enabling this flag will trigger the following steps:

    1. Brainsprite figures will be generated.

    2. The executive summary will be generated.

    3. DCAN QC files will be generated.

  • output_dir (str) – output directory

  • TR (float) – Repetition time of the BOLD run, in seconds.

  • name (str, optional) – Name of the workflow. This is used for working directories and workflow graphs. Default is “connectivity_wf”.

Inputs:
  • atlas_names (list of str) – A list of atlases used for parcellating the BOLD data. The list of atlas names is generated by xcp_d.utils.atlas.get_atlas_names(). The atlases include: “Schaefer117”, “Schaefer217”, “Schaefer317”, “Schaefer417”, “Schaefer517”, “Schaefer617”, “Schaefer717”, “Schaefer817”, “Schaefer917”, “Schaefer1017”, “Glasser”, “Gordon”, and “subcortical” (Tian). Used for indexing timeseries and correlations.

  • timeseries (list of str) – List of paths to atlas-specific time series TSV files. These time series are produced from the censored_denoised_bold outputs.

  • correlations (list of str) – List of paths to atlas-specific ROI-to-ROI correlation TSV files. These correlations are produced from the timeseries outputs.

  • coverage (list of str) – List of paths to atlas-specific coverage TSV files.

  • timeseries_ciftis (list of str) – List of paths to atlas-specific time series CIFTI (ptseries) files. These time series are produced from the censored_denoised_bold outputs.

  • correlation_ciftis (list of str) – List of paths to atlas-specific ROI-to-ROI correlation CIFTI (pconn) files. These correlations are produced from the timeseries_cifti outputs.

  • coverage_ciftis (list of str) – List of paths to atlas-specific coverage CIFTI (pscalar) files.

  • qc_file – LINC-style quality control file

  • interpolated_filtered_bold (str) – Path to the censored, denoised, interpolated, and filtered BOLD file. This file is the result of denoising the censored preprocessed BOLD data, followed by cubic spline interpolation and band-pass filtering.

    This output should not be used for analysis. It is primarily for DCAN QC plots.

  • censored_denoised_bold (str) – Path to the censored, denoised, interpolated, filtered, and re-censored BOLD file. This file is the result of denoising the censored preprocessed BOLD data, followed by cubic spline interpolation, band-pass filtering, and re-censoring.

    This output is the primary derivative for analysis.

  • smoothed_denoised_bold (str) – Path to the censored, denoised, interpolated, filtered, re-censored, and smoothed BOLD file. This file is the result of denoising the censored preprocessed BOLD data, followed by cubic spline interpolation, band-pass filtering, re-censoring, and spatial smoothing.

  • alff – alff nifti

  • smoothed_alff – smoothed alff

  • reho

  • confounds_file

  • filtered_motion (str) – Framewise displacement timeseries, potentially after bandstop or low-pass filtering. This is a TSV file with one column: ‘framewise_displacement’.

  • motion_metadata

  • temporal_mask (str) – Temporal mask; all values above fd_thresh set to 1. This is a TSV file with one column: ‘framewise_displacement’.

  • temporal_mask_metadata

  • dummy_scans (int or “auto”) – Number of volumes to remove from the beginning of each run. If set to ‘auto’, xcp_d will extract non-steady-state volume indices from the preprocessing derivatives’ confounds file.