xcp_d.workflows.concatenation module

Workflows for concatenating postprocessed data.

xcp_d.workflows.concatenation.init_concatenate_data_wf(output_dir, motion_filter_type, mem_gb, omp_nthreads, TR, head_radius, smoothing, cifti, dcan_qc, name='concatenate_data_wf')[source]

Concatenate postprocessed data.

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/”.

  • 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.

  • mem_gb (float) – Memory limit, in gigabytes.

  • omp_nthreads (int) – Maximum number of threads an individual process may use.

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

  • head_radius (float or “auto”) – Radius of the head, in millimeters, for framewise displacement calculation.

    xcp_d’s default head radius is 50. The recommended value for infants is 35. A value of ‘auto’ is also supported, in which case the brain radius is estimated from the preprocessed brain mask.

  • 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.

  • 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.

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

Inputs:
  • name_source (str) – Path to the file that will be used as the source_file for derivatives. This is generally the preprocessed BOLD file. This file does not need to exist (e.g., in the case of a concatenated version of the filename). One list entry for each run. These are used as the bases for concatenated output filenames.

  • preprocessed_bold (list of str) – The preprocessed BOLD files, after dummy volume removal.

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

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

  • uncensored_denoised_bold (str) – Path to the uncensored, denoised BOLD file. This file is the result of denoising the full (uncensored) preprocessed BOLD data using betas estimated using the censored BOLD data and nuisance regressors.

    This output should not be used for analysis. It is primarily used for DCAN QC plots. One list entry for each run.

  • 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. One list entry for each run.

  • 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. One list entry for each run.

  • bold_mask (list of str or Undefined) – Brain mask files for each of the BOLD runs. This will be a list of paths for NIFTI inputs, or a list of Undefineds for CIFTI ones.

  • anat_brainmask (str)

  • template_to_anat_xfm (str) – Path to the MNI-to-T1w transform file. May be “identity”, for testing purposes.

  • boldref (str) – Path to the BOLD reference file associated with the target BOLD run. This comes from the preprocessing derivatives.

  • 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). This will be a list of lists, with one sublist for each run.

  • 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. This will be a list of lists, with one sublist for each run.

  • 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. This will be a list of lists, with one sublist for each run.