MAYAVI2(1) | General Commands Manual | MAYAVI2(1) |
mayavi2 - A scientific visualization package for 2-D and 3-D data
mayavi2 [options] [args]
Where arg1, arg2 etc. are optional file names that correspond to saved Mayavi2 visualizations (filename.mv2), Mayavi2 scripts (filename.py) and any data file formats that Mayavi supports.
Mayavi2 is a tool for 2-D and 3-D scientific visualization. Features of Mayavi2 include:
-h
This prints all the available command line options and exits. Also available through --help.
-V
This prints the Mayavi version on the command line and exits. Also available through --version.
-z filename.mv2
This loads a previously saved Mayavi2 visualization. Also available through --viz filename.mv2 or --visualization filename.mv2.
-d datafile.*
Opens any of the supported data file formats or a non-file related data source. This includes VTK file formats (*.vtk, *.xml, *.vt[i,p,r,s,u], *.pvt[i,p,r,s,u]), VRML2 (*.wrl), 3D Studio (*.3ds), PLOT3D (*.xyz), STL, BYU, RAW, PLY, PDB, SLC, FACET, OBJ, AVSUCD (*.inp), GAMBIT (*.neu), Exodus (*.exii), PNG, JPEG, BMP, PNM, DCM, DEM, MHA, MHD, MINC, XIMG, TIFF, and various others that are supported. datafile.* can also be a source object not associated with a file, for example ParametricSurface or PointLoad will load the corresponding data sources into Mayavi. Also available through --data.
-m module-name
A module is an object that actually visualizes the data. The given module-name is loaded in the current ModuleManager. The module name must be a valid one if not you will get an error message.
If a module is specified as 'package.sub.module.SomeModule' then the module (SomeModule) is imported from 'package.sub.module'. Standard modules provided with mayavi2 do not need the full path specification. For example:
In this example 'Outline' is a standard module and 'm2_user_modules.TestModule' is some user defined module. See MAYAVI2 MODULES section below for an exhaustive list of available modules. Also available through --module.
-f filter-name
A filter is an object that filters out the data in some way or the other. The given filter-name is loaded with respect to the current source/filter object. The filter name must be a valid one if not you will get an error message.
If the filter is specified as 'package.sub.filter.SomeFilter' then the filter (`SomeFilter`) is imported from 'package.sub.filter'. Standard modules provided with mayavi2 do not need the full path specification. For example:
In this example 'ExtractVectorNorm' is a standard filter and 'm2_user_filters.TestFilter' is some user defined filter.
See MAYAVI2 FILTERS section below for an exhaustive list of available filters. Also available through --filter.
-M
Starts up a new module manager on the Mayavi pipeline. Also available through --module-mgr.
-n
Creates a new window/scene. Any options passed after this will apply to this newly created scene. Also available through --new-window.
-t
Runs the mayavi2 test suite and exits. If run as such, this runs both the TVTK and Mayavi2 unittests. If any additional arguments are passed they are passed along to the test runner. So this may be used to run other tests as well. For example:
This will run just the tests inside the enthought.persistence package. You can also specify a directory with test files to run with this, for example:
will run the integration tests from the mayavi sources. Also available through --test.
-x script-file
This executes the given script in a namespace where we guarantee that the name 'mayavi' is Mayavi's script instance -- just like in the embedded Python interpreter. Also available through --exec
WARNING: Note that this uses `execfile`, so please note that this can be dangerous if the script does something nasty!
-s python-expression
Execute the expression on the last created object. For example, if the previous object was a module, and we want to set the color of that object one can do -s "actor.property.color = (1,0,0)". One should use quotes for the expression. Also available with --set. For example:
WARNING: Note that this uses `exec`, so please note that this can be dangerous!
In the above examples, heart.vti and fire_ug.vtu VTK files can be found in /usr/share/doc/mayavi2/examples/data. The examples directory (/usr/share/doc/mayavi2/examples/ on Debian) provides several useful examples.
Mayavi was originally developed by Prabhu Ramachandran. Many people have later contributed to it.
More information on Mayavi2 can be obtained from http://code.enthought.com/mayavi2