All the following sections assume you have a working Mayavi Installation.
As a user there are three primary ways to use Mayavi:
Use the mayavi2 application completely graphically. More information on this is in the Using the Mayavi application section.
Use Mayavi as a plotting engine from simple Python scripts. The mlab scripting API provides a simple way of using Mayavi in batch-processing scripts, see Simple Scripting with mlab for more information on this.
Script the Mayavi application from Python. The Mayavi application itself features a powerful and general purpose scripting API that can be used to adapt it to your needs.
- You can script Mayavi while using the mayavi2 application in order to automate tasks and extend Mayavi’s behavior.
- You can script Mayavi from your own Python based application.
- You can embed Mayavi into your application in a variety of ways either using Envisage or otherwise.
More details on this are available in the Advanced Scripting with Mayavi chapter.
Mayavi uses a pipeline architecture like VTK. As far as a user is concerned this basically boils down to a simple hierarchy.
- The user visualizes data on a TVTK Scene – this is an area where the 3D visualization is performed. New scenes may be created by using the File->New->VTK Scene menu.
- On each scene the user loads data (either using a file or created from a script). Any number of data files or data objects may be opened; these objects are called data sources.
- This data is optionally processed using Filters that operate on the data and visualized using visualization Modules. The Filters and Modules are accessible via the Visualize menu on the UI or may be instantiated as Python objects.
Mayavi is a scientific data visualizer. There are two primary ways to make your data available to it.
- Use a supported file format like VTK legacy or VTK XML files etc. See VTK file formats for more information on the VTK formats.
- Generate a TVTK dataset via numpy arrays or any other sequence.
More information on datasets in general and how to create VTK files or create them from numpy arrays is available in the Creating data for Mayavi section.