question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

backend parameter of viz._3d.plot_source_estimates needs some love

See original GitHub issue

Describe the bug

Passing backend='pyvista' to plot_source_estimates() currently is not supported, although we do support PyVista: https://github.com/mne-tools/mne-python/blob/6f16c3771d79dda19b5ff0a058396f468a3e57f6/mne/viz/_3d.py#L1750

Also, the backend parameter is not used for anything except for checking whether we should use Matplotlib or not; if backend != 'matplotlib', we simply use _get_3d_backend() to retrieve the backend to use. This means that e.g.if you have PyVista installed, passing backend='mayavi' will still use the pyvista backend.

https://github.com/mne-tools/mne-python/blob/6f16c3771d79dda19b5ff0a058396f468a3e57f6/mne/viz/_3d.py#L1751-L1762

Expected results

  • backend should be allowed to be 'pyvista' as well
  • the value of backend should be honored

Additional information

Also wondering if the backend param should be deprecated or changed. Maybe it could only support matplotlib and 3d or so, and 3d would select the default 3D backend?

Or we deprecate it and if we cannot detect a valid 3D backend, we fall back to Matplotlib. (We already kind of do that, if I’m reading the code correctly)

cc @GuillaumeFavelier

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:16 (16 by maintainers)

github_iconTop GitHub Comments

2reactions
larsonercommented, Feb 3, 2021

What’s the effort needed to revamp/improve the backend?

I don’t think the matplotlib backend can ever be anywhere near feature-complete compared to Brain – matplotlib isn’t really designed to do 3D plotting on this scale. We can keep hacking together bits (foci for example are probably easy as scatter3d) but ultimately it’s not going to provide a very satisfying or usable (let alone visually appealing) experience. To me it’s what you use if you need something very basic and can’t use Brain.

To me it’s probably worth putting effort into figuring out how to get CPU-based rendering using Mesa OpenGL software rendering on any system whose OpenGL isn’t good enough to render 3D properly. Then we can rely on VTK + Brain to do everything. And if this works hopefully we can just kill the matplotlib backend someday. I’ve hacked together solutions like this on other systems so in principle I think it’s possible. I’ve also seen some conda-forge stuff involving osmesa but I don’t know the details – if we could tell people they could install an osmesa variant of VTK rather than the standard one, that might automagically make Brain work for people.

1reaction
agramfortcommented, Feb 3, 2021

It’s not broken it’s partial. I pushed for this to have a solution for master students while teaching and as a fall back when mayavi was really impossible to install / use. Serious work publication oriented cannot be done with matplotlib backend

Read more comments on GitHub >

github_iconTop Results From Across the Web

mne.viz.plot_source_estimates — MNE 1.0.3 documentation
When plotting a standard SourceEstimate (not volume, mixed, or vector) and using the PyVista backend, views='flat' is also supported to plot ...
Read more >
3d plotting - empty plot - Support & Discussions - MNE Forum
I am trying to plot source estimate with a simple line stc.plot(subject). The subject is 'fsaverage'. The output looks like that (below). When...
Read more >
How to visualise massive 3D point clouds in Python
Tutorial for advanced visualization and interaction with big point cloud data in Python. (Bonus) Learn how to create an interactive 3D ...
Read more >
On Search Engine Evaluation Metrics - arXiv
to apply it to a wide range of metrics and metric parameters. ... By estimating the time needed to interact with the search...
Read more >
Solita Data - Insights and practical examples on how to make ...
The Back End – Data Development with Vertical Slices & DataOps automation. Metadata driven data supply chain. Metadata driven data supply chain produces...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found