xcp_d.workflows.connectivity module

Workflows for extracting time series and computing functional connectivity.

xcp_d.workflows.connectivity.init_functional_connectivity_cifti_wf(output_dir, alff_available, min_coverage, mem_gb, omp_nthreads, name='connectivity_wf')[source]

Extract CIFTI time series.

Workflow Graph
../_images/xcp_d-workflows-connectivity-1.png

(Source code, png, svg, pdf)

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

  • alff_available

  • min_coverage (float) – Coverage threshold to apply to parcels in each atlas. Any parcels with lower coverage than the threshold will be replaced with NaNs. Must be a value between zero and one. Default is 0.5.

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

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

  • name (str, optional) – Name of the workflow. This is used for working directories and workflow graphs. Default is “connectivity_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).

  • denoised_bold – Clean CIFTI after filtering and nuisance regression. The CIFTI file is in the same standard space as the atlases, so no transformations will be applied to the data before parcellation.

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

  • alff

  • reho

  • 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: “4S156Parcels”, “4S256Parcels”, “4S356Parcels”, “4S456Parcels”, “4S556Parcels”, “4S656Parcels”, “4S756Parcels”, “4S856Parcels”, “4S956Parcels”, “4S1056Parcels”, “Glasser”, “Gordon”, “Tian”, and “HCP”.

  • atlas_files

  • atlas_labels_files

  • parcellated_atlas_files

Outputs:
  • coverage_ciftis (list of str) – List of paths to atlas-specific coverage CIFTI (pscalar) 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.

  • correlation_ciftis_exact

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

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

  • correlations_exact

  • parcellated_reho

  • parcellated_alff

xcp_d.workflows.connectivity.init_functional_connectivity_nifti_wf(output_dir, alff_available, min_coverage, mem_gb, name='connectivity_wf')[source]

Extract BOLD time series and compute functional connectivity.

Workflow Graph
../_images/xcp_d-workflows-connectivity-2.png

(Source code, png, svg, pdf)

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

  • alff_available

  • min_coverage (float) – Coverage threshold to apply to parcels in each atlas. Any parcels with lower coverage than the threshold will be replaced with NaNs. Must be a value between zero and one. Default is 0.5.

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

  • name (str, optional) – Name of the workflow. This is used for working directories and workflow graphs. Default is “connectivity_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).

  • denoised_bold – clean bold after filtered out nuisscance and filtering

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

  • alff

  • reho

  • 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: “4S156Parcels”, “4S256Parcels”, “4S356Parcels”, “4S456Parcels”, “4S556Parcels”, “4S656Parcels”, “4S756Parcels”, “4S856Parcels”, “4S956Parcels”, “4S1056Parcels”, “Glasser”, “Gordon”, “Tian”, and “HCP”.

  • atlas_files

  • atlas_labels_files

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

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

  • correlations_exact (list of list of str) – Exact-scan-wise list of lists of paths to atlas-specific ROI-to-ROI correlation TSV files. These correlations are produced from the timeseries outputs and the temporal_mask input.

  • parcellated_alff

  • parcellated_reho

xcp_d.workflows.connectivity.init_load_atlases_wf(output_dir, cifti, mem_gb, omp_nthreads, name='load_atlases_wf')[source]

Load atlases and warp them to the same space as the BOLD file.

Workflow Graph
../_images/xcp_d-workflows-connectivity-3.png

(Source code, png, svg, pdf)

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

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

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

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

  • name (str, optional) – Name of the workflow. This is used for working directories and workflow graphs. Default is “load_atlases_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).

  • bold_file

Outputs:
  • atlas_names

  • atlas_files

  • atlas_labels_files

  • parcellated_atlas_files

xcp_d.workflows.connectivity.init_parcellate_surfaces_wf(output_dir, files_to_parcellate, min_coverage, mem_gb, omp_nthreads, name='parcellate_surfaces_wf')[source]

Parcellate surface files and write them out to the output directory.

Workflow Graph
../_images/xcp_d-workflows-connectivity-4.png

(Source code, png, svg, pdf)

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

  • files_to_parcellate (list of str) – List of surface file types to parcellate (e.g., “sulcal_depth”, “sulcal_curv”, “cortical_thickness”).

  • min_coverage (float) – Coverage threshold to apply to parcels in each atlas. Any parcels with lower coverage than the threshold will be replaced with NaNs. Must be a value between zero and one. Default is 0.5.

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

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

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

Inputs:
  • sulcal_depth

  • sulcal_curv

  • cortical_thickness

  • cortical_thickness_corr

  • myelin

  • myelin_smoothed