mne-python icon indicating copy to clipboard operation
mne-python copied to clipboard

ENH: Add function to plot statistical clusters on brain surface

Open shristibaral opened this issue 5 months ago • 4 comments

What does this implement/fix?

I improved the existing statistical cluster plot by adding a new function that plots the cluster boundary to its spatial extent on top of the brain.

shristibaral avatar Aug 10 '25 11:08 shristibaral

Thanks for the contribution! For a big change like this, it's usually best to open an issue first to discuss the API. We'll discuss this one at our next maintainer meeting and report back. Meanwhile: if I view the last image in the rendered tutorial (https://output.circle-artifacts.com/output/job/77fa0002-c504-4110-a95d-0a57460ffe05/artifacts/0/html/auto_tutorials/stats-source-space/20_cluster_1samp_spatiotemporal.html#visualize-the-clusters), there doesn't appear to be any magenta-colored boundary on the brain? So not clear that this function is actually working as intended.

drammock avatar Aug 11 '25 20:08 drammock

Thanks for the contribution! For a big change like this, it's usually best to open an issue first to discuss the API. We'll discuss this one at our next maintainer meeting and report back.

Apologies. I will open issue next time. :)

Meanwhile: if I view the last image in the rendered tutorial (https://output.circle-artifacts.com/output/job/77fa0002-c504-4110-a95d-0a57460ffe05/artifacts/0/html/auto_tutorials/stats-source-space/20_cluster_1samp_spatiotemporal.html#visualize-the-clusters), there doesn't appear to be any magenta-colored boundary on the brain? So not clear that this function is actually working as intended.

I have updated this part with a new cluster index, the boundary is visible now.

shristibaral avatar Aug 12 '25 06:08 shristibaral

Apologies. I will open issue next time. :)

Why wait? You can do so now :)

wmvanvliet avatar Aug 13 '25 07:08 wmvanvliet

A good start! Now we need the unit test to test different scenarios:

  • Explicitly check that the proper vertices are included in the label
  • Plotting multiple clusters and checking the auto-generated names
  • Selecting different time points and checking that the cluster boundaries change

WIP

shristibaral avatar Aug 13 '25 08:08 shristibaral