Wednesday, August 03, 2011

Chapter 4. Using MayaVi from Python

Chapter 4. Using MayaVi from Python: "import mayavi
v = mayavi.mayavi()
v.load_visualization('heart.mv')
# Do whatever you please with the MayaVi window.

# To make the MayaVi window interact with the user and wait
# till it is closed to proceed, do the following:
v.master.wait_window()

# Now once the previous window is closed if you need
# to open another do this:
v = mayavi.mayavi()
d = v.open_vtk('file.vtk')
# etc.
v.master.wait_window()

# Once the MayaVi window is closed the program will exit."