data computed in mne.viz.plot_topomap [Edit in plot_topomap]

  • MNE version: 1.0.2
  • operating system: Windows 10

Dear all, thanks a lot for your work in this forum, all thread is very usefull for person like me that is approaching for the first time at mne library.
My question (I suppose) is very easy for you:

i’m using the mne.viz.plot_topomap to visualize datas interpolated after computing PSD with Welch’s Method for each channel. My question is:

it is possible to store datas computed in function plot_topomap, in addition to printing the image?
i want to compute values between channels and append to 2d matrix but i can’t find anything to do that.
Thanks a lot for helping me, and i’m sorry if my english is not perfect, i’m studying also to improve it.

best regards

Hello @daddz17 and welcome to the forum!

Are you sure you’re actually using mne.viz.plot_topomap(), or are you rather using one of the .plot_topomap() methods?

I’m asking because mne.viz.plot_topomap() expects as its first argument the actual data you wish to plot, in the form of an array. So if you’re using this function, you already have the data you’re looking for!

Or am I missing something?

It can also be helpful to share some of your code – might make it easier for others to follow what you intend to do!

Best wishes,

no you are right i’m sorry, i’m using plot_topomap. So i want to extract value interpolated that method uses to plot value inside head, because i have data from channels. My goal is to have a square matrix with the interpolated values inside the scalp, which can then be plotted if desired.

thanks a lot for your answer!

Hello @daddz17, there’s currently no easy way to extract the interpolated data. This magic happens in the private _plot_topomap() function:

You might be able to step through this code and figure out what and why it does how, but I’m afraid it’s not super trivial :frowning:

1 Like

Thanks a lot, yes i have already seen the code and i have understand that it will be not easy things to do! but i will try! I take this opportunity to ask you: if I were to be able to create a function that does this, could I share it with the community?

Yes, of course! Feel free to share anything you have if you think it could be useful to others!

1 Like