三流Mayavi操作-Mayav-2.1.0.7-对比

秉着边学边写边折腾的原则,开始粗糙的工作。真正掌握还是得讲解给别人听。 先给出网课
https://www.icourse163.org/course/BIT-1001871001
Mayavi官方
http://docs.enthought.com/mayavi/mayavi/genindex.html
(有时候这网站会装死,一般过几个小时就会活过来)
我发现了,光是三流操作还不够,还得加上四流翻译。

这篇文章放在来第二章绘图函数的倒数第二篇,最后一篇留出来,考虑到一些补充。
这个文章是一个总结,因为很明显利用参数的不同来说图像绘制并不合理,只是一定程度上地节约篇幅,仅此而已。
不合理体现在,分类方式,比如imshow居然和plot3d放在一起。

1.重新来分类

一种比较合理的分类就是按照维度进行分类。
http://docs.enthought.com/mayavi/mayavi/mlab_3d_plotting_functions.html
按维度:

1d:

plot3d(),points3d()

2d:

imshow(),surf(),contour_surf(),mesh(),barchart(),triangular_mesh()

3d

contour3d(),quiver3d(),flow(),volume_slice()

2.Mayavi的管线配置很重要

很多时候绘图的参数都可以GUI设置,我不能说直接设置不好。但是每次画一下都要去GUI一下我是挺不乐意的。
好在Mayavi里面有脚本录制,这个我没说,原因是,脚本录制采用的是管线的写法,超出了第二章的范畴。所以。不多说。

3.数据源同样重要

首先要对Data representation数据表示法很熟悉,这个文,我翻了一半。这个文档相当重要。
第二章也没过多涉及数据源的问题,我始终停留在Module层级,数据源层级属于SceneModule的父层级,没有过多涉及。
我们目前绘制的都是直接从numpy生成的干净的数据,直接的数据。而真实情况是,我们往往是从外部读取数据,这里不涉及。后面会慢慢写过来,这是一个很长的过程,需要不少的时间。我也是边学边写,边补充。

-1.写在最后

然后呢,如果系统地看完或者整理过,应该有这样的认识:

0.图像的观察方式,很多都不是用单一的手段,往往是多种绘制有机结合。所以熟悉各种绘制就变得很重要,比如mesh绘制了网格面,为了观察值域范围往往要补充outline,比如volume_slice本身就不是主要的观察手段,而是辅助观察。
1.绘制函数都是被封装好的,如果要绘图尽可能使用接口。有些高级绘制仅仅依靠绘制函数是不够的,如果要绘制更好的效果,需自己一层一层铺设管线来处理更多的细节。
2.从数据到图,这中间经历了很多过程的,而Mayavi做的工作是可视化,也就是将最后的图像结果呈现出来。
3.如果注意到Mayavi的内部,对于这句话应该是有更多的理解的——The tvtk module (also called TVTK) provides a traits enabled version of VTK. TVTK objects wrap around VTK objects but additionally support traits, and provide a convenient Pythonic API. TVTK is implemented mostly in pure Python (except for a small extension module). Here is a list of current features.
TVTK是纯Python编写,那么Mayavi的GUI做得算是相当好了。那么我就不得不思考Mayavi本身是怎么写出来的,界面确实做得很好~这里用的是TraitsUI而非wxPython和Pyqt在文档里面提到过,不过也可以适当考虑一下。

最最后面,暂时没人注意,也没人看,这无所谓的。我也是边学边写,养成输出的习惯。偶尔觉得,写写也挺好玩的。
——做做翻译,画画图,调调代码,一天就过去了。
就这样。

这个想起了又补充。

Mayavi 的参考手册,适合初学者和expert。 User guide: full table of contents An overview of Mayavi Introduction What is Mayavi2? Technical details Using Mayavi as an application, or a library? Scenes, data sources, and visualization modules: the pipeline model Loading data into Mayavi Installation Installing ready-made distributions Requirements for manual installs Doing it yourself: Python packages: Eggs Installing with easy_install Step-by-step instructions to install with eggs under Windows Under Mac OSX Snow Leopard The bleeding edge: Git Testing your installation Troubleshooting Using the Mayavi application Tutorial examples to learn Mayavi Parametric surfaces: a simple introduction to visualization Loading scalar data: the heart.vtk example Visualizing rich datasets: the fire_ug.vtu example Using Mayavi with scipy Exploring a vector field General layout of UI Visualizing data Modules Filters Interaction with the scene Mouse interaction Keyboard interaction From interactive usage to scripting The embedded Python interpreter Recording Mayavi actions to a script Command line arguments mlab: Python scripting for 3D plotting A demo 3D Plotting functions for numpy arrays 0D and 1D data 2D data 3D data Changing the looks of the visual objects created Adding color or size variations Changing the scale and position of objects Changing object properties interactively Figures, legends, camera and decorations Handling several figures Figure decorations Moving the camera Running mlab scripts Using mlab interactively Using together with Matplotlib’s pylab In scripts Animating the data Assembling pipelines with mlab Data sources Modules and filters Case studies of some visualizations Visualizing volumetric scalar data Visualizing a vector field Advanced use of Mayavi Organisation of Mayavi visualizations: the pipeline Anatomy of a Mayavi pipeline The link between different Mayavi entry points A pipeline example examined Data representation in Mayavi Introduction to TVTK datasets The flow of data Retrieving the data from Mayavi pipelines Dissection of the different TVTK datasets Inserting TVTK datasets in the Mayavi pipeline Objects populating the Mayavi pipeline Scene Source Filter ModuleManager: Colors and legends node Module Engine Base class: PipelineBase Class hierarchy Advanced Scripting with Mayavi Design Overview: Mayavi as a visualization framework Scripting the mayavi2 application Using the Mayavi envisage plugins Building applications using Mayavi Custom interactive dialogs Embedding a Mayavi scene in a Traits dialog A scene, with mlab embedded Making the visualization live Integrating in a WxPython application Integrating in a Qt application Tips and Tricks Off screen rendering Avoiding the rendering window Platform Summary Rendering using the virtual framebuffer Using VTK with Mesa for pure software rendering Extending Mayavi with customizations Customizing Mayavi2 Scripting Mayavi without using Envisage Computing in a thread Polling a file and auto-updating Mayavi Serving Mayavi on the network TCP server: the serve_tcp function UDP server: the serve_udp function Animating a visualization Animating a series of images Making movies from a stack of images Scripting from the command line Texture mapping actors Shifting data and plotting Using the UserDefined filter Sharing the same data between scenes Using mlab Using the core Mayavi API Changing the interaction with a scene Accelerating a Mayavi script Miscellaneous Citing Mayavi Getting help Tests for Mayavi Helping out Development quick start Improving the documentation Example gallery Mlab functions gallery Advanced mlab examples Interactive examples Advanced visualization examples Data interaction examples Misc examples MLab reference Plotting functions barchart contour3d contour_surf flow imshow mesh plot3d points3d quiver3d surf triangular_mesh Figure handling functions clf close draw figure gcf savefig screenshot sync_camera Figure decoration functions colorbar scalarbar vectorbar xlabel ylabel zlabel Camera handling functions move pitch roll view yaw Other functions animate axes get_engine orientation_axes outline set_engine show show_engine show_pipeline start_recording stop_recording text text3d title Mlab pipeline-control reference Sources Tools Data Modules and Filters Mayavi API reference Pipeline base objects Scene Source Filter ModuleManager Module PipelineBase Engine Main view and UI objects Scene UIs: DecoratedScene and MayaviScene SceneEditor MlabSceneModel EngineView and EngineRichView Known bugs and issues Changelog Mayavi 3.4.0 (Oct 15, 2010) Enhancements Fixes Mayavi 3.3.2 (May 25, 2010) Enhancements Fixes Mayavi 3.3.1 (Feb 24, 2010) Enhancements Fixes Mayavi 3.3.0 (July 15, 2009) Enhancements Fixes Mayavi 3.2.0 (March 23, 2009) Mayavi 3.1.0 Mayavi 3.0.3 Mayavi 3.0.1 and 3.0.2 Mayavi 3.0.0
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值