trame_ex2.py 878 B

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/env python
  2. #
  3. from trame.app import get_server
  4. from trame.ui.vuetify import SinglePageLayout
  5. from trame.widgets import vtk, vuetify
  6. from vedo import Volume, Axes, Plotter, dataurl
  7. vol = Volume(dataurl+"embryo.slc")
  8. plt = Plotter(bg='Wheat')
  9. plt += [vol, Axes(vol)]
  10. plt += vol.isosurface().shift(300,0,0)
  11. # ------------------------------------------------------------
  12. # Web Application setup
  13. # ------------------------------------------------------------
  14. server = get_server()
  15. ctrl = server.controller
  16. with SinglePageLayout(server) as layout:
  17. layout.title.set_text("Hello trame")
  18. with layout.content:
  19. with vuetify.VContainer(
  20. fluid=True,
  21. classes="pa-0 fill-height",
  22. ):
  23. plt.reset_camera()
  24. view = vtk.VtkRemoteView(plt.window)
  25. # view = vtk.VtkLocalView(plt.window)
  26. server.start()