xcp_d.utils.restingstate module

Functions for calculating resting-state derivatives (ReHo and ALFF).

xcp_d.utils.restingstate.compute_2d_reho(datat, adjacency_matrix)[source]

Calculate ReHo on 2D data.

Parameters:
  • datat (numpy.ndarray of shape (V, T)) – data matrix in vertices by timepoints

  • adjacency_matrix (numpy.ndarray of shape (V, V)) – surface adjacency matrix

Returns:

KCC – ReHo values.

Return type:

numpy.ndarray of shape (V,)

xcp_d.utils.restingstate.compute_alff(data_matrix, low_pass, high_pass, TR)[source]

Compute amplitude of low-frequency fluctuation (ALFF).

Parameters:
  • data_matrix (numpy.ndarray) – data matrix points by timepoints

  • low_pass (float) – low pass frequency in Hz

  • high_pass (float) – high pass frequency in Hz

  • TR (float) – repetition time in seconds

Returns:

alff – ALFF values.

Return type:

numpy.ndarray

Notes

Implementation based on https://pubmed.ncbi.nlm.nih.gov/16919409/.

xcp_d.utils.restingstate.mesh_adjacency(hemi)[source]

Calculate adjacency matrix from mesh timeseries.

Parameters:

hemi ({“L”, “R”}) – Surface sphere to be load from templateflow Either left or right hemisphere

Returns:

Adjacency matrix.

Return type:

numpy.ndarray