I would like to plot a topomap from obtained psd_welch() values.
However I donāt know how to find the channel and position information, so I tried to do the following using a Layout:
But I couldnāt manage to fit the sensors into the blue circle. I tried changing the sphere, but it only affects to the lines drawing the head. Is there any normalization I should apply to the layout positions so they fit the blue circle properly?
Hi @agramfort! Iāve been reviewing it but in the code Iām only using the channels positions used in āVectorview-all.loutā layout included in MNE:
so the position of the sensors that you see in the topomap is correct.
The layout seems not to be in head coordinates. When applying montages the channel positions are transformed to head coordinates. I donāt think you can apply layouts, so you could construct a montage out of this layout and then apply it to the data.
Another, simpler, way would be to center your layout coordinates around zero and then change the sphere radius to something that looks ok. For example:
@agramfort@larsoner
If layouts are supposed to work out of the box when their .pos is passed to mne.viz.plot_topomap then Iād consider the behavior reported by @guiomar to be a bug. WDYT?
I dindāt know how to get the channel positions info from the raw meg data after applying the psd_welch(), so thatās way I tried to go with the layout. How do people usually do this?
Sorry I didnāt want you to change the things, I think with this trick I can manage. Or if you show me a more efficient way to do it, Iād be happy to learn!
I always pass the info to mne.viz.plot_topomap. So if I have epochs object I then do mne.viz.plot_topomap(some_data, epochs.info). I only used this for EEG, but I think it should work for MEG as well. Let us know if the documentation or examples/tutorials should be improved to better expose this approach!
Thanks for pointing to the discussion, @richard, Iāll take a look at it.
@mmagnuski Iām working with resting data which have not been epoched. And the psd_welch() function just returns an array of values, so no more info about the channels.
How should I epoch rest data, with maybe a fixed window length? do you have any example I could look at? Thanks a lot!
Thanks @mmagnuski With the tip you gave me about centering the layout, the issue is solved, So Iāll close the thread Thanks once more for your super fast responses!
Hello @guiomar, Iāve answered to a related question you posted a while back, but I believe this could resolve your issue without having to deal with a layout manually: