How to plot group difference topomap with p-values and perform ROI power comparison in source space?

  • MNE version: 1.9.0

  • operating system: Windows 10

Hi everyone,

I’m currently working on a group-level EEG analysis using MNE-Python, and I’d like to reproduce two types of analyses shown in the attached figures.

  1. Sensor-level topomap:
    I want to plot a topomap showing (a) the mean relative power of each group (G1, G2), (b) the difference map (G2 − G1), and (c) the p-value map (similar to the example image).
    I’ve been looking for a tutorial or code example that describes how to compute and visualize group-level statistical differences (e.g., using permutation tests or t-tests) and then map the p-values on the scalp topography.

  2. Source-level ROI analysis:
    The second figure shows ROI-based comparisons (e.g., power differences between cortical regions) with p-values represented by connection lines or color bars.
    I’d like to know if there’s any example or tutorial in MNE that demonstrates how to:

  3. extract ROI-wise source power,

  4. perform group-level comparisons (G1 vs G2), and

  5. visualize the significant ROIs or connections as in the figure.

If you know any related tutorials, GitHub examples, or documentation pages, I’d really appreciate your guidance.

Thank you very much in advance!

Sensor-level topomap:
I want to plot a topomap showing (a) the mean relative power of each group (G1, G2)

First off, take a look a these tutorials for computing power and storing it as a Spectrum object: Time-frequency analysis — MNE 1.10.2 documentation

Then for getting the mean power of each group, you can use the combine_spectrum() function (although you will need to upgrade from your MNE v1.9 to MNE v1.10).
Where all_spectrum_G1 and all_spectrum_G2 are lists containing a Spectrum object for each of your participants, you can run:

from mne.time_frequency import combine_spectrum

mean_spectrum_G1 = combine_spectrum(all_spectrum_G1, weights="equal")
mean_spectrum_G2 = combine_spectrum(all_spectrum_G2, weights="equal")

This returns a single Spectrum object for each of your groups. You’ll see also in those tutorials how you can plot a topomap with the plot_topomap() method.

(b) the difference map (G2 − G1)

Getting the difference between your groups as a Spectrum object can be done similarly with:

diff_spectrum = combine_spectrum([mean_spectrum_G2, mean_spectrum_G1], weights=[1, -1])

and (c) the p-value map

It’s hard to say what the best approach to get the p-values is without knowing more about the data. Have a look at the statistics tutorials (Statistical analysis of sensor data — MNE 1.10.2 documentation) and examples (Statistics Examples — MNE 1.10.2 documentation) to get an idea of what the most appropriate approach could be.

For example, if you had paired observations in G1 and G2, you could follow something like this example (Permutation T-test on sensor data — MNE 1.10.2 documentation).
The example uses epoched data, but you can substitute this for the difference between groups for each subject acquired using combine_spectrum and averaged over your frequency band of interest.
Then as the example shows, you can treat your p-values as evoked data and plot them as a topomap:

1 Like

For source-level ROI analyses, I can’t give much advice except that you can achieve a similar visualisation with this function: mne_connectivity.viz.plot_connectivity_circle — MNE-Connectivity 0.7.0 documentation

1 Like

Hi Thomas,

Thank you so much for the detailed pointers and code references you shared earlier — they were extremely helpful. And I’m really sorry for my late reply; I’ve been going through the materials you recommended.

I’ve also started exploring the MNE-Connectivity documentation and tutorials. While reviewing them, I realized that my overall understanding of connectivity analysis (concepts, assumptions, interpretation, etc.) might be insufficient.

If you happen to know any good resources — such as introductory papers, review articles, or tutorials — that explain EEG/MEG connectivity methods more comprehensively, I would greatly appreciate your recommendations.

Thanks again for your help!

If you happen to know any good resources — such as introductory papers, review articles, or tutorials — that explain EEG/MEG connectivity methods more comprehensively, I would greatly appreciate your recommendations.

This paper is a nice discussion of different functional connectivity methods and important considerations for applying them to EEG/MEG data: Frontiers | A Tutorial Review of Functional Connectivity Analysis Methods and Their Interpretational Pitfalls

I would also suggest Mike Cohen’s book Analyzing Neural Time Series Data which has a section on connectivity analyses.