Plotting scatterplots on a 3D surface
See original GitHub issueI’ve been playing around with Freesurfer and the gselu for doing electrode localization in python with ecog grids. It seems to work relatively well, which is really cool.
However, once I’ve got a FS surface model of a brain, as well as electrode positions, the next step is to use them to make brain plots. The two most common ways the ecog world does this is to
A. Make a scatterplot on top of the brain (where size / color represent your effect and location is the electrode position) B. Create some sort of heatmap on the cortical surface model using the electrode positions
It seems relatively straightforward to figure out B, and if an ecog
type is ever added to mne-python I think it’d be a great viz addition. However, I’m not so sure how to do “A” effectively. Right now, I’ve tried using pysurfer to read my surface model. I’ve then tried two methods for plotting, which both fail for different reasons:
- Using Mayavi to plot a trisurface. This creates the brain beautifully, but the only way to create a scatterplot is to create these “spheres” that are rendered in 3D and look really ugly.
- Using matplotlib
plot_trisurf
to do the same thing. In this case, it creates nice “flat” scatterplots in the 3D axis. However, the call toplot_trisurf
takes a really long time, and is unusably slow when it comes to rotating etc.
So I wonder, is there some way to combine the 3D capability of mayavi with the “data plotting” capability of matplotlib? I know that packages like this exist for matlab (e.g., here). These use matlab’s version of plot_trisurf, which I guess is more usable. Any thoughts on how to make this work?
Issue Analytics
- State:
- Created 8 years ago
- Comments:40 (30 by maintainers)
@choldgraf I think we have this now from your PRs, so I’ll close. Feel free to reopen if I’m mistaken
The main thing I’d like to do is:
Basically all the stuff in the gif that I showed above. I’ve got that code working in my own repo but I’m wondering if it would be useful and relatively low-cost to incorporate some of that into MNE (e.g., if you call
plot_sensors
withecog
channel types, it does something different than just plotting them on top of an EEG style topo plot.)