1MAYAVI2(1)                  General Commands Manual                 MAYAVI2(1)
2
3
4

NAME

6       mayavi2 - A scientific visualization package for 2-D and 3-D data
7

SYNOPSIS

9       mayavi2 [options] [args]
10
11       Where  arg1, arg2 etc. are optional file names that correspond to saved
12       Mayavi2 visualizations (filename.mv2),  Mayavi2  scripts  (filename.py)
13       and any data file formats that Mayavi supports.
14
15

DESCRIPTION

17       Mayavi2 is a tool for 2-D and 3-D scientific visualization. Features of
18       Mayavi2 include:
19
20
21       *      Visualization of scalar and vector data in 2 and 3 dimensions
22
23       *      Easy scriptability using Python
24
25       *      Easy extendability via sources, components,  modules,  and  data
26              filters
27
28       *      Reading several file formats: VTK (legacy and XML), PLOT3D, etc.
29
30       *      Saving of visualizations
31
32       *      Saving rendered visualization in a variety of image formats.
33
34
35

OPTIONS

37       -h
38
39       This  prints  all  the  available command line options and exits.  Also
40       available through --help.
41
42
43       -V
44
45       This prints the Mayavi version on the command  line  and  exits.   Also
46       available through --version.
47
48
49       -z filename.mv2
50
51       This  loads  a  previously saved Mayavi2 visualization.  Also available
52       through --viz filename.mv2 or --visualization filename.mv2.
53
54
55       -d datafile.*
56
57       Opens any of the supported data file formats or a non-file related data
58       source.  This includes VTK file formats (*.vtk, *.xml, *.vt[i,p,r,s,u],
59       *.pvt[i,p,r,s,u]), VRML2 (*.wrl), 3D Studio  (*.3ds),  PLOT3D  (*.xyz),
60       STL,  BYU,  RAW,  PLY,  PDB,  SLC,  FACET,  OBJ, AVSUCD (*.inp), GAMBIT
61       (*.neu), Exodus (*.exii), PNG, JPEG, BMP,  PNM,  DCM,  DEM,  MHA,  MHD,
62       MINC,  XIMG,  TIFF,  and various others that are supported.  datafile.*
63       can also be a source object not associated with  a  file,  for  example
64       ParametricSurface or PointLoad will load the corresponding data sources
65       into Mayavi.  Also available through --data.
66
67
68       -m module-name
69
70       A module is an object that actually visualizes  the  data.   The  given
71       module-name  is  loaded  in the current ModuleManager.  The module name
72       must be a valid one if not you will get an error message.
73
74       If a module is specified as  'package.sub.module.SomeModule'  then  the
75       module  (SomeModule)  is  imported from 'package.sub.module'.  Standard
76       modules provided with mayavi2 do not need the full path  specification.
77       For example:
78
79              mayavi2 -d data.vtk -m Outline -m m2_user_modules.TestModule
80
81       In  this  example  'Outline'  is  a  standard  module and 'm2_user_mod‐
82       ules.TestModule' is some user defined module.  See MAYAVI2 MODULES sec‐
83       tion below for an exhaustive list of available modules.  Also available
84       through --module.
85
86
87       -f filter-name
88
89       A filter is an object that filters out the data  in  some  way  or  the
90       other.   The  given  filter-name  is loaded with respect to the current
91       source/filter object.  The filter name must be a valid one if  not  you
92       will get an error message.
93
94       If  the filter is specified as 'package.sub.filter.SomeFilter' then the
95       filter (`SomeFilter`) is imported from 'package.sub.filter'.   Standard
96       modules  provided with mayavi2 do not need the full path specification.
97       For example:
98
99              mayavi2  -d  data.vtk  -f  ExtractVectorNorm   -f   m2_user_fil‐
100              ters.TestFilter
101
102       In   this   example   'ExtractVectorNorm'  is  a  standard  filter  and
103       'm2_user_filters.TestFilter' is some user defined filter.
104
105       See MAYAVI2 FILTERS section below for an exhaustive list  of  available
106       filters. Also available through --filter.
107
108
109       -M
110
111       Starts  up  a new module manager on the Mayavi pipeline. Also available
112       through --module-mgr.
113
114
115       -n
116
117       Creates a new window/scene. Any options passed after this will apply to
118       this newly created scene.  Also available through --new-window.
119
120
121       -t
122
123       Runs  the mayavi2 test suite and exits.  If run as such, this runs both
124       the TVTK and Mayavi2 unittests.  If any additional arguments are passed
125       they  are  passed along to the test runner.  So this may be used to run
126       other tests as well.  For example:
127
128              mayavi2 -t enthought.persistence
129
130       This will run just the tests inside the enthought.persistence  package.
131       You  can also specify a directory with test files to run with this, for
132       example:
133
134              mayavi2 -t relative_path_to/integrationtests/mayavi
135
136       will run the integration tests from the mayavi sources.    Also  avail‐
137       able through --test.
138
139
140       -x script-file
141
142       This  executes  the given script in a namespace where we guarantee that
143       the name 'mayavi' is Mayavi's script  instance  --  just  like  in  the
144       embedded Python interpreter.  Also available through --exec
145
146       WARNING:  Note  that this uses `execfile`, so please note that this can
147       be dangerous if the script does something nasty!
148
149
150       -s python-expression
151
152       Execute the expression on the last created object.  For example, if the
153       previous  object  was  a  module,  and we want to set the color of that
154       object one can do -s "actor.property.color = (1,0,0)".  One should  use
155       quotes for the expression. Also available with --set.  For example:
156
157
158               mayavi2 -d ParametricSurface -m Outline \
159                -s "actor.property.color = (1,0,0)" \
160                -s "scene.save('test.png', size=(800, 800))"
161
162       WARNING:  Note  that  this uses `exec`, so please note that this can be
163       dangerous!
164
165

MAYAVI2 MODULES

167       Axes   Draws simple axes.
168
169
170       ContourGridPlane
171              A contour grid plane module. This module lets one take  a  slice
172              of input grid data and view contours of the data.
173
174
175       CustomGridPlane
176              A  custom  grid plane with a lot more flexibility than GridPlane
177              module.
178
179
180       DataSetClipper
181              This filter clips the dataset  in  a  area.   The  area  can  be
182              defined interactively as a box, a sphere...
183
184
185       Glyph  Displays  different  types of glyphs oriented and colored as per
186              scalar or vector data at the input points.
187
188
189       GridPlane
190              A simple grid plane module.
191
192
193       HyperStreamline
194              A module that integrates through a tensor field  to  generate  a
195              hyperstreamline.  The integration is along the maximum eigenvec‐
196              tor and the cross section of the hyperstreamline is  defined  by
197              the  two  other eigenvectors. Thus the shape of the hyperstream‐
198              line is "tube-like", with the cross  section  being  elliptical.
199              Hyperstreamlines are used to visualize tensor fields.
200
201
202       ImageActor
203              A simple module to view image data efficiently.
204
205
206       ImagePlaneWidget
207              A simple module to view image data.
208
209
210       IsoSurface
211              A  module  that  allows the user to make contours of input point
212              data.
213
214
215       Labels Allows a user to label the current dataset or the current  actor
216              of the active module.
217
218
219       OrientationAxes
220              Creates  a small axes on the side that indicates the position of
221              the co-ordinate axes and thereby marks the  orientation  of  the
222              scene. Requires VTK-4.5 and above.
223
224
225       Outline
226              A module that draws an outline for the given data.
227
228
229       ScalarCutPlane
230              Takes  a cut plane of any input data set using an implicit plane
231              and plots the data with optional contouring and scalar warping.
232
233
234       SliceUnstructuredGrid
235              This module takes a slice of  the  unstructured  grid  data  and
236              shows the cells that intersect or touch the slice.
237
238
239       Streamline
240              Allows  the user to draw streamlines for given vector data. This
241              supports various types of seed objects (line, sphere, plane  and
242              point  seeds).  It also allows the user to draw ribbons or tubes
243              and further supports different types  of  interactive  modes  of
244              calculating the streamlines.
245
246
247       StructuredGridOutline
248              Draws a grid-conforming outline for structured grids.
249
250
251       Surface
252              Draws a surface for any input dataset with optional contouring.
253
254
255       TensorGlyph
256              Displays  tensor  glyphs  oriented  and colored as per scalar or
257              vector data at the input points.
258
259
260       Text   This module allows the user to place text on the screen.
261
262
263       VectorCutPlane
264              Takes an arbitrary slice of the input data using an implicit cut
265              plane  and places glyphs according to the vector field data. The
266              glyphs may be colored using either the vector magnitude  or  the
267              scalar attributes.
268
269
270       Vectors
271              Displays  different  types of glyphs oriented and colored as per
272              vector data at the input points. This is  merely  a  convenience
273              module that is entirely based on the Glyph module.
274
275
276       Volume The  Volume  module  visualizes  scalar  fields using volumetric
277              visualization techniques.
278
279
280       WarpVectorCutPlane
281              Takes an arbitrary slice of the input data using an implicit cut
282              plane  and  warps  it  according  to  the vector field data. The
283              scalars are displayed on the warped surface as colors.
284
285
286

MAYAVI2 FILTERS

288       CellDerivatives
289              Computes derivatives from input point scalar and vector data and
290              produces  cell  data  on the gradients.  Can be used to approxi‐
291              mately calcuate the vorticity for example.
292
293
294       CellToPointData
295              Transforms cell attribute data to point data  by  averaging  the
296              cell data from the cells at the point.
297
298
299       Contour
300              A contour filter that wraps around the Contour component to gen‐
301              erate iso-surfaces on any input dataset.
302
303
304       CutPlane
305              This class represents a cut plane that  can  be  used  to  slice
306              through  any dataset.  It also provides a 3D widget interface to
307              position and move the slice interactively.
308
309
310       ElevationFilter
311              Creates scalar data corresponding to the elevation of the points
312              along a line.
313
314
315       Delaunay2D
316              Performs a 2D Delaunay triangulation.
317
318
319       Delaunay3D
320              Performs a 3D Delaunay triangulation.
321
322
323       ExtractEdges
324              This filter extracts cell edges from any input data.
325
326
327       ExtractGrid
328              Allows a user to select a part of a structured grid.
329
330
331       ExtractTensorComponents
332              Wraps  the TVTK ExtractTensorComponents filter to extract compo‐
333              nents from a tensor field.
334
335
336       ExtractUnstructuredGrid
337              Allows a user to select a part of an unstructured grid.
338
339
340       ExtractVectorNorm
341              Computes the norm (Eucliedean) of the input  vector  data  (with
342              optional  scaling between [0, 1]). This is useful when the input
343              data has vector input but no scalar data for  the  magnitude  of
344              the vectors.
345
346
347       ExtractVectorComponents
348              Wraps  the TVTK ExtractVectorComponents filter to extract compo‐
349              nents of a vector. This is useful for analysing individual  com‐
350              ponents of a vector data.
351
352
353       GaussianSplatter
354              This  filter  splat  points  into  a  volume with an elliptical,
355              Gaussian distribution.
356
357
358       MaskPoints
359              Selectively passes the input points downstream. This can be used
360              to  subsample  the  input  points.  Note that this does not pass
361              geometry data, this means all grid information is lost.
362
363
364       GreedyTerrainDecimation
365              Approximates a height field (image data) with a  triangle  mesh,
366              keeping the number of triangles minimum.
367
368
369       ImageChangeInformation
370              A  filter  that  can  be  used to change the origin, spacing and
371              extents of an input image  dataset  without  changing  the  data
372              itself.
373
374
375       ImageDataProbe
376              A  filter  that  can be used to probe any dataset using a Struc‐
377              tured Points dataset.  The filter also allows one to convert the
378              scalar  data  to an unsigned short array so that the scalars can
379              be used for volume visualization.
380
381
382       PointToCellData
383              Does the inverse of the CellToPointData filter.
384
385
386       PolyDataNormals
387              Computes normals from input data. This gives meshes  a  smoother
388              appearance.  This  should work for any input dataset. Note: this
389              filter is called  "Compute  Normals"  in  Mayavi2  GUI  (Visual‐
390              ize/Filters/Compute Normals).
391
392
393       QuadricDecimation
394              Reduce  triangles in a mesh, forming a good approximation of the
395              original mesh.
396
397
398       SelectOutput
399              A filter that allows a user to select one among several  of  the
400              outputs  of  a given input.  This is typically very useful for a
401              multi-block data source.
402
403
404       SetActiveAttribute
405              This filter lets a user set the active data attribute  (scalars,
406              vectors  and  tensors)  on  a VTK dataset.  This is particularly
407              useful if you need to do something like compute contours of  one
408              scalar on the contour of another scalar.
409
410
411       Stripper
412              Create  triangle strips and/or poly-lines. Useful for regulariz‐
413              ing broken up surfaces, such as those created by the  Tube  fil‐
414              ter.  .
415
416
417       Threshold
418              A simple filter that thresholds on input data.
419
420
421       TransformData
422              Performs a linear transformation to input data.
423
424
425       TriangleFilter
426              Converts  input  polygons and triangle strips to triangles using
427              the tvtk.TriangleFilter class.  This is useful when you  have  a
428              downstream filter that only processes triangles.
429
430
431       Tube   Turns lines into tubes.
432
433
434       UserDefined
435              This  filter  lets  the  user  define  their  own filter dynami‐
436              cally/interactively.  It is like FilterBase but allows a user to
437              specify the class without writing any code.
438
439
440       Vorticity
441              This  filter  computes  the  vorticity of an input vector field.
442              For convenience, the  filter  allows  one  to  optionally  pass-
443              through  the  given  input vector field.  The filter also allows
444              the user to show the component of the vorticity along a particu‐
445              lar  cartesian co-ordinate axes.  It produces point data on out‐
446              put which is ready to visualize.
447
448
449       WarpScalar
450              Warps the input data along a particular  direction  (either  the
451              normals  or a specified direction) with a scale specified by the
452              local scalar value. Useful for making carpet plots.
453
454
455       WarpVector
456              Warps the input data along a the point vector  attribute  scaled
457              as per a scale factor.  Useful for showing flow profiles or dis‐
458              placements.
459
460

EXAMPLES

462              mayavi2 -d heart.vtk -m Axes -m Outline -m GridPlane -m Contour‐
463              GridPlane -m IsoSurface
464              mayavi2  -d  fire_ug.vtu -m Axes -m Outline -m VectorCutPlane -f
465              MaskPoints -m Glyph
466
467
468       In the above examples, heart.vti and fire_ug.vtu VTK files can be found
469       in   /usr/share/doc/mayavi2/examples/data.   The   examples   directory
470       (/usr/share/doc/mayavi2/examples/ on Debian)  provides  several  useful
471       examples.
472
473

AUTHOR

475       Mayavi  was  originally  developed by Prabhu Ramachandran.  Many people
476       have later contributed to it.
477
478       More    information    on    Mayavi2    can    be     obtained     from
479       http://code.enthought.com/mayavi2
480
481
482
483                                                                    MAYAVI2(1)
Impressum