medusa.connectivity package

Submodules

medusa.connectivity.amplitude_connectivity module

medusa.connectivity.amplitude_connectivity.aec(data, ort=True)[source]

This method implements the amplitude envelope correlation (using GPU if available). Based on the “ort” param, the signals could be orthogonalized before the computation of the amplitude envelope correlation.

REFERENCES: Liu, Z., Fukunaga, M., de Zwart, J. A., & Duyn, J. H. (2010). Large-scale spontaneous fluctuations and correlations in brain electrical activity observed with magnetoencephalography. Neuroimage, 51(1), 102-111. Hipp, J. F., Hawellek, D. J., Corbetta, M., Siegel, M., & Engel, A. K. (2012). Large-scale cortical correlation structure of spontaneous oscillatory activity. Nature neuroscience, 15(6), 884-890. O’Neill, G. C., Barratt, E. L., Hunt, B. A., Tewarie, P. K., & Brookes, M. J. (2015). Measuring electrophysiological connectivity by power envelope correlation: a technical review on MEG methods. Physics in Medicine & Biology, 60(21), R271.

Parameters
  • data (numpy 2D matrix) – MEEG Signal. [n_samples x n_channels].

  • ort (bool) – If True, the signals on “data” will be orthogonalized before the computation of the amplitude envelope correlation.

Returns

aec – aec-based connectivity matrix. [n_channels x n_channels].

Return type

numpy 2D square matrix

medusa.connectivity.amplitude_connectivity.iac(data, ort=True)[source]

This method implements the instantaneous amplitude correlation (using GPU if available). Based on the “ort” param, the signals could be orthogonalized before the computation of the amplitude envelope correlation.

REFERENCES: Tewarie, P., Liuzzi, L., O’Neill, G. C., Quinn, A. J., Griffa, A., Woolrich, M. W., … & Brookes, M. J. (2019). Tracking dynamic brain networks using high temporal resolution MEG measures of functional connectivity. Neuroimage, 200, 38-50.

Parameters
  • data (numpy 2D matrix) – MEEG Signal. [n_samples x n_channels].

  • ort (bool) – If True, the signals on “data” will be orthogonalized before the computation of the instantaneous amplitude correlation.

Returns

iac – iac-based connectivity matrix. [n_channels x n_channels].

Return type

numpy 2D square matrix

medusa.connectivity.phase_connectivity module

medusa.connectivity.phase_connectivity.phase_connectivity(data)[source]

This method implements three phase-based connectivity parameters: PLV, PLI, and wPLI.

REFERENCES: PLV: Mormann, F., Lehnertz, K., David, P., & Elger, C. E. (2000). Mean phase coherence as a measure for phase synchronization and its application to the EEG of epilepsy patients. Physica D: Nonlinear Phenomena, 144(3-4), 358-369. PLI: Nolte, G., Bai, O., Wheaton, L., Mari, Z., Vorbach, S., & Hallett, M. (2004). Identifying true brain interaction from EEG data using the imaginary part of coherency. Clinical neurophysiology, 115(10), 2292-2307. wPLI: Vinck, M., Oostenveld, R., Van Wingerden, M., Battaglia, F., & Pennartz, C. M. (2011). An improved index of phase-synchronization for electrophysiological data in the presence of volume-conduction, noise and sample-size bias. Neuroimage, 55(4), 1548-1565.

NOTE: PLV is sensitive to volume conduction effects

Parameters

data (numpy 2D matrix) – MEEG Signal. [n_samples x n_channels].

Returns

  • plv (numpy 2D square matrix) – plv-based connectivity matrix. [n_channels x n_channels].

  • pli (numpy 2D square matrix) – pli-based connectivity matrix. [n_channels x n_channels].

  • wpli (numpy 2D square matrix) – wpli-based connectivity matrix. [n_channels x n_channels].

medusa.connectivity.phase_connectivity.reshape_angles_loops(phase_data)[source]

Additional method require for the implementation of PLV, PLI, and wPLI in Numba. It receives the phases of the signal and return the PLV, PLI and wPLI connectivity matrices.

NOTE: The shape of “phase_data” is [n_channels x n_samples], not the usual [n_samples x n_channels]

Parameters

phase_data (numpy 2D matrix) – phases of the MEEG Signal. [n_channels x n_samples].

Returns

  • plv (numpy 2D square matrix) – plv-based connectivity matrix. [n_channels x n_channels].

  • pli (numpy 2D square matrix) – pli-based connectivity matrix. [n_channels x n_channels].

  • wpli (numpy 2D square matrix) – wpli-based connectivity matrix. [n_channels x n_channels].