Skip to content

Conversation

@GuillaumeFavelier
Copy link
Contributor

This PR implements a prototype of integration of the pyvista backend in the jupyter notebook.

Animation:
output

Static images:
image
image
image
image
image

Note: requires the panel package

@larsoner
Copy link
Member

Awesome!

Does it work with a multi-view scene, e.g. stc.plot(hemi='split', views=['lat', 'med'])? If not, is it possible in the future or would it be a nightmare or technically impossible to implement?

@GuillaumeFavelier
Copy link
Contributor Author

GuillaumeFavelier commented Nov 13, 2019

Unfortunately, it's disabled for now. The output will just be the output image. Multi-view will be challenging to add I think so I can't say for now but I don't exclude it since viewport management is normally supported in vtk.js.

@codecov
Copy link

codecov bot commented Nov 13, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@3fafe43). Click here to learn what that means.
The diff coverage is 33.33%.

@@            Coverage Diff            @@
##             master    #7056   +/-   ##
=========================================
  Coverage          ?   89.73%           
=========================================
  Files             ?      440           
  Lines             ?    77780           
  Branches          ?    12620           
=========================================
  Hits              ?    69796           
  Misses            ?     5174           
  Partials          ?     2810

def show(self):
self.figure.display = self.plotter.show()
self.figure.display = self.plotter.show(use_panel=True,
auto_close=False)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this break outside of notebook?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh my! You're right. I will fix this

@GuillaumeFavelier
Copy link
Contributor Author

panel 0.7 is out with some enhancements. I'll update the renderings accordingly after testing more.

@GuillaumeFavelier
Copy link
Contributor Author

This panel example demonstrates multi-view with linked views @larsoner

@larsoner
Copy link
Member

Awesome!

@akaszynski
Copy link

@GuillaumeFavelier, this is perfect. Nice work! I'd like to have multiple plotting backends supported for pyvista as they each carry their own advantages, and some don't work on certain platforms (i.e. itk doesn't work on iOS).

Perhaps adding a backend kwarg to the plot and show methods? That way we can open it up to multiple plotting backends and leave panel as default.

@GuillaumeFavelier
Copy link
Contributor Author

Although I agree no backend is perfect, the cost of maintaining this multi-backend architecture plus ensuring the same standard of quality for all of them can be huge in my opinion. I would recommend to stick with the backend with the best coverage of the needed features and then work hard to fill the gap.

@jona-sassenhagen
Copy link
Contributor

The GIF looks great.

@GuillaumeFavelier
Copy link
Contributor Author

Closing now since we got #7758 working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants