Modules 可视化模块及 Filters 滤波器/变换器

对于Mayavi的每一个module可视化层级或filter滤波变换层级都有一个相应的`mlab.pipeline` 函数,它将其作为输入参数,在数据源source基础上添加新的可视化层级及滤波变换器,它最终将以对象的形式返回。层级的名字默认是和创建其层级的函数相同,注意它们是用下划线分开,而不是大小写字母命名方式。

The input object, if it is a data source (Mayavi data source or VTK dataset), does not need to be already present in the figure, it will be automatically added if necessary.

通过给函数追加参数,它将给其对象的属性赋值并添加到pipeline管线中。

举例来说,`ScalarCutPlane`是一个标量截面可视化层级,其属性可以用下面的方式添加:

mayavi.tools.modules.scalar_cut_plane(*args, **kwargs)

然后,ScalarCutPlane 可视化层级以此创建完成,它将被添加到data source数据源层级的子层级中(数据源可以是Mayavi数据源,由Python的numpy等完成;也可以来自VTK数据集。)。

关键字:

color 颜色:

用于设置vtk对象的颜色。当您指定颜色后,它将覆盖原来的颜色。它接受一个元组形式的范围0到1浮点数,比如(1,1,1)表示白色。

colormap 配色表:

设定配色方案。

extent 可视化范围:

接受一个列表的形式,形式为[xmin, xmax, ymin, ymax, zmin, zmax]。其默认是x, y, z数组的值域范围。使用extent关键词可以改变对象的可视化范围。

figure 图像参数:

只接受Scene或者None

line_width 线宽设置:

调整线条的粗细。接受浮点数,默认为2.0.

name 对象命名:

对创建的vtk对象进行重命名。 译者注:vtk对象都有默认的名,即其层级名。

opacity 透明度设置:

设定vtk对象的透明度,接受浮点数,默认值:1.0 译者注:1.0为不透明。可对同属一个filter不同的module可视化模块采用不同的透明度。

plane_orientation:

the orientation of the plane Must be a legal value. Default: x_axes

reset_zoom:

Reset the zoom to accomodate the data newly added to the scene. Defaults to True.

transparent:

make the opacity of the actor depend on the scalar.

view_controls:

Whether or not the controls of the cut plane are shown. Must be a boolean. Default: True

vmax 可视化范围,上界设置:

vmax将设定图像的配色区间,将图像对应vmax值的部分设定成配色表中的上界颜色。如果不设置,默认使用数据中值域上界作为vmax。

vmin 可视化范围,下界设置:

vmin将设定图像的配色区间,将图像对应vmin值的部分设定成配色表中的下界颜色。如果不设置,默认使用数据中值域下界作为vmin。

As the list is long, we shall not enumerate here all the factory function for adding modules or filters. You are invited to refer to their docstring for information on the keyword arguments they accept.