I want to compute connectivity between sources using the PLI metric.
As far as I understand it, PLI is computed at the electrode level and
not at the source level. Does anyone know how to transform the
connectivity matrix between channels into a connectivity matrix
between sources? (I've looked at the inverse operator but I have no
idea how to apply it to the connectivity matrix).
I actually want to z score connectivities for each subject. Is there a way to compute connectivity for each epoch in the source space? (I mean: a more efficient way than iterating over all epochs)
our spectral connectivity code does not implement single-trial
connectivity, it implements phase statistics across trials.
If you want source-level connectivity, you need epochs in source space.
To do that in a memory-efficient manner, you can use
`return_generator=True` in https://mne.tools/dev/generated/mne.minimum_norm.apply_inverse_epochs.html
and then for loop by source localizing one epoch at a time.
I tried source localizing one epoch at a time, and then computing connectivity for each epoch.
However, when I average the connectivity matrices over epochs, I do not obtain the same matrix as the one obtained by computing directly connectivity over all epochs in source space. Connectivity matrices for one epoch are made only of 0 and 1.
The code in spectral connectivity does not yield any meaningful
single-epoch results.
At this point, the only valid usage of the function is to compute
connectivity across trials.