Guest User

Untitled

a guest
May 25th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. import os
  2.  
  3. from dipy.data import read_viz_icons, fetch_viz_icons
  4.  
  5. from dipy.viz import ui, window
  6.  
  7. tb = ui.CustomInteractorStyle()
  8.  
  9. def temp(obj, event):
  10. global cnt, actor, show_manager, tb
  11. cnt += 1
  12. tb.message = "Let's count up to 20 and exit :" + str(cnt)
  13. show_manager.render()
  14. if cnt > 19:
  15. show_manager.exit()
  16.  
  17.  
  18.  
  19. current_size = (600, 600)
  20. show_manager = window.ShowManager(size=current_size, title=" Frame Rate")
  21.  
  22. for i in range(10):
  23. sphereSource = window.vtk.vtkSphereSource()
  24. sphereSource.SetCenter(i, 0, 0)
  25.  
  26. mapper = window.vtk.vtkPolyDataMapper()
  27. mapper.SetInputConnection(sphereSource.GetOutputPort())
  28.  
  29. actor = window.vtk.vtkActor()
  30. actor.SetMapper(mapper)
  31.  
  32. show_manager.ren.add(actor)
  33.  
  34.  
  35.  
  36.  
  37. show_manager.add_timer_callback(True, 200, temp)
  38. show_manager.start()
Add Comment
Please, Sign In to add comment