MNE SpectralConnectivity

:question: If you have a question or issue with MNE-Python, please include the following info:

  • MNE version: 1.9.0
  • operating system: Windows 11

I have EEG data which I’m trying to use to compute a score using a metric I made. I’m then trying to save the metric scores for all of the data into a CSV file.

Although, this is the error I keep getting.
:white_check_mark: Successfully loaded EEG data for sub-pd28, session: PD_OFF
EEG Data Shape: (41, 105472)
Error processing frequency band 1-4 Hz: SpectralConnectivity.init() missing 2 required positional arguments: ‘freqs’ and ‘n_nodes’
Error processing frequency band 4-8 Hz: SpectralConnectivity.init() missing 2 required positional arguments: ‘freqs’ and ‘n_nodes’
Error processing frequency band 8-13 Hz: SpectralConnectivity.init() missing 2 required positional arguments: ‘freqs’ and ‘n_nodes’
Error processing frequency band 13-30 Hz: SpectralConnectivity.init() missing 2 required positional arguments: ‘freqs’ and ‘n_nodes’
Error processing frequency band 30-45 Hz: SpectralConnectivity.init() missing 2 required positional arguments: ‘freqs’ and ‘n_nodes’

Please let me know if I can attach the file that I’m running so you can see what the error is.

Hello,

To store connectivity results in the SpectralConnectivity class, you also need to pass in the following arguments:

  • freqs - a list or array of frequencies which your spectral connectivity results correspond to. This will either be the individual frequency bins, or the median of the frequency bins if you’ve aggregated the results over frequency bands.
  • n_nodes - The number of signals that the connectivity results were computed from.

There are other optional parameters, but you have to supply freqs and n_nodes. That is what is causing the error.

Cheers,
Thomas