-
Notifications
You must be signed in to change notification settings - Fork 100
Integrate better with Jupyter notebook #268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Mayavi can render things inside a jupyter notebook as either PNG or X3D. This functionality can be enabled with `mlab.init_notebook()`. This PR adds an `_ipython_display_` hook to the `Brain` class that renders the brain accordgin to the Mayavi notebook integration settings.
Codecov Report
@@ Coverage Diff @@
## master #268 +/- ##
==========================================
- Coverage 75% 74.82% -0.19%
==========================================
Files 7 7
Lines 2517 2526 +9
Branches 506 509 +3
==========================================
+ Hits 1888 1890 +2
- Misses 454 461 +7
Partials 175 175 |
This would be through the |
Oh that's a |
You could also achieve this with PyVista. Cross-post from pyvista/pyvista#146 (comment) Check out all the PyVista examples on http://playground.pyvista.org Or this one: https://mybinder.org/v2/gh/OpenGeoVis/omfvista/master?filepath=Example.ipynb This is enabled by default if |
It would be good to have this mentioned in the documentation. Maybe at the bottom of this page? |
BTW @wmvanvliet I don't hit the bytes/str bug locally, so if you update your |
neat @wmvanvliet ! |
The |
Time to rewrite pysurfer in pyvista? ;) |
I know you were joking, but just in case you're curious -- we've had long discussions about this in #106 and #134. IIRC the consensus was basically that we should start some new neuro-3D-viz package that is more general, and less bound to Freesurfer conventions (but still provides what we need for working with FS). To make some progress in MNE, @GuillaumeFavelier has made some progress implementing Mayavi alternatives (PyVista, ipyvolume, VisPy) for our basic 3D functionality such as |
In the meantime this is great, thanks @wmvanvliet |
Thanks @wmvanvliet! |
Integrate better with Jupyter notebook (nipy#268)
Mayavi can render things inside a jupyter notebook as either PNG or X3D.
This functionality can be enabled with
mlab.init_notebook()
.This PR adds an
_ipython_display_
hook to theBrain
class thatrenders the brain accordgin to the Mayavi notebook integration settings.
This means interactive PySurfer brains in Binder are now possible!
https://mybinder.org/v2/gh/wmvanvliet/SNL_workshop_2019/master?filepath=pysurfer_demo.ipynb