plot_sensors_connectiviy result doesn't agree with connectivity matrix

Dear Forum,

I ran into some problem with plotting all-to-all EEG sensor connectivity using the funcion plot_sensors_connectivity(). The connectivity is computed from epoch data and transformed into matrix form:

conn = mne_connectivity.spectral_connectivity_epochs(epochs_fl.get_data(), method='coh', fmin=bands[band][0], fmax=bands[band][1], sfreq=sfreq)
conn_matrix = conn.get_data(output="dense")[:, :, 0]

When I visualize my connectivity matrix it looks fine

However, when I try plot_sensors_connectivity(epochs_fl.info, conn_matrix) there are only 2 connections with very high connectivity strength:

I have checked my EEG montage using epochs_fl.get_montage().digand it seems to have the sensor location info. What could be wrong here?

The problem seems to be due to the hard-coded minimal distance, and fixed by:

Perhaps this can be merged?

Hello,

Sorry for the late reply, I was away on vacation.

This fix has been merged into the development version of the package which you can install with pip install git+https://github.com/mne-tools/mne-connectivity. If you want the fix, working with the development version is your best bet. As far as I’m aware there’s no set date for when it will be officially released, and it’s stable enough in its current state.

You can find the documentation for the new min_distance parameter here: mne_connectivity.viz.plot_sensors_connectivity β€” MNE-Connectivity 0.8.0.dev66+gc7090ac2 documentation

Cheers,
Thomas

1 Like