2d head plot connectivity graph
See original GitHub issueDescribe the new feature or enhancement
It’s a viz feature that enables you to display a visualization of electrode connectivity. To be used in conjunction with the circle.py
feature. I couldn’t find this feature that my employer requested I implement anywhere in the mne library so I made it myself.
Describe your proposed implementation
Describe possible alternatives
Could be implemented with or without the heatmaps.
Additional comments
The heatmaps require the seaborn
library the way I implemented them, and the head-graphs require the networkx
library. These features have also been implemented with sliders so that the user can play with the thresholds --thresholding works differently from circle
in that you don’t specify the number of connections to display you threshold based on connectivity measure, but it would be fairly easy to add that as an option.
I would have to check with my employer if it’s okay before adding this feature to the mne, I think they will be chill, besides we don’t have a legal contract anyway but I would want to check first so as not to break trust.
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (9 by maintainers)
Top GitHub Comments
@larsoner @agramfort are you OK with what I proposed above? namely:
plot_sensors_connectivity(..., kind='3d')
(default, current behavior) andplot_sensors_connectivity(..., kind='topomap')
(new behavior, uses matplotlib)plot_sensors_connectivity(..., ax=None)
(default) that is ignored for 3d plots, and can be amatplotlib.axes.Axes
instance for 2d plots@dcxSt one final note that I forgot to mention earlier is that we’re moving our connectivity functions into a separate package, so you’ll actually want to make the PR into the mne-connectivity package. All the function names and APIs were migrated so everything should look familiar.
cc @adam2392 who has been overseeing the migration to a separate package
To me the best option seems to be expanding
plot_sensors_connectivity
to have akind
option (mne.viz.plot_sensors
haskind='3d'
andkind='topomap'
andkind='select'
, but I don’t think we need “select” here). We can do the heatmap without relying on Seaborn (currently it’s not a dependency) and I’d argue we should do the sensors without nilearn (better to have consistent visual style with our other 2D sensor plots). I’d also try to do it without networkx if we can… ultimately it won’t make a difference to the end-user so again I’d rather avoid the extra dependency.We can always move things around if it makes sense to do so. The API entry point is just
mne.viz
so it would be fine for the public function to have both 2D and 3D options, and under-the-hood it can call private functions that are possibly in different files.I’d split that into a separate PR after the first one is done… it could basically be a thin wrapper for the new 2D-capable
plot_sensors_connectivity
that handled creating the correct number of axes, making sure they all had the right colormap, etc