贴子标题/内容
Python中的6个三维可视化工具
<ul><li><span style="font-size: 15px;">Python拥有很多优秀的三维图像可视化工具,主要基于图形处理库WebGL、OpenGL或者VTK。</span></li><li><span style="font-size: 15px;">这些工具主要用于大规模空间标量数据、向量场数据、张量场数据等等的可视化,实际运用场景主要在海洋大气建模、飞机模型设计、桥梁设计、电磁场分析等等。</span></li><li><span style="font-size: 15px;"><strong>本文简单介绍几个Python三维图像可视化工具</strong></span><span style="font-size: 15px;">,工具都有大量demo、完善的使用文档、功能非常强大,系统学习请戳文中链接。</span></li></ul><h2><span style="font-size: 15px;">pyvista</span></h2><p><span style="font-size: 15px;">专注于3D可视化和mesh分析,底层是VTK</span></p><p><span style="font-size: 15px;">VTK: 三维图像处理和可视化利器</span></p><p><img src="https://pica.zhimg.com/v2-914f36eaf5804af0f47c42bcdc466990_720w.jpg?source=d16d100b" alt="动图封面" data-href="" style="width: 100%;"/></p><p><span style="font-size: 15px;">Orbiting1</span></p><p><img src="https://pic1.zhimg.com/v2-6661a441389e755291f70623c9c6f19b_720w.jpg?source=d16d100b" alt="动图封面" data-href="" style="width: 100%;"/></p><p><span style="font-size: 15px;">Orbiting1</span></p><p><img src="https://pic2.zhimg.com/v2-1cda520785bd6fc98d79b6bfb4f27f18_720w.jpg?source=d16d100b" alt="动图封面" data-href="" style="width: 100%;"/></p><p><span style="font-size: 15px;">支持GIF/MP4小电影</span></p><p><img src="https://picx.zhimg.com/v2-562c2cd9c3b31a0fdd70cd501353842f_1440w.jpg" alt="" data-href="" style=""/></p><p><span style="font-size: 15px;">支持多种主题配色</span></p><p><img src="https://pic2.zhimg.com/v2-bd432e1589fe6e2ec23fd8d9bbcbaa03_1440w.jpg" alt="" data-href="" style=""/></p><p><span style="font-size: 15px;">支持多种主题配色</span></p><p><img src="https://picx.zhimg.com/v2-c7b3e87226e8bccbcbd9d880cfaef747_1440w.jpg" alt="" data-href="" style=""/></p><p><span style="font-size: 15px;">Compute Gradients of a Field</span></p><p><img src="https://picx.zhimg.com/v2-518c00dbc2f7dfbe672e44841c8d977b_1440w.jpg" alt="" data-href="" style=""/></p><p><span style="font-size: 15px;">Add Background</span></p><p><img src="https://pic1.zhimg.com/v2-180b727ef4c2428baff950a47f8787e0_1440w.jpg" alt="" data-href="" style=""/></p><p><span style="font-size: 15px;">Plot with Opacity</span></p><p><img src="https://pica.zhimg.com/v2-4aed4bd9b65671b29cc432bc71623dee_1440w.jpg" alt="" data-href="" style=""/></p><p><span style="font-size: 15px;">更多</span></p><ul><li><span style="font-size: 15px;">进一步学习:</span><a href="https://link.zhihu.com/?target=https%3A//github.com/pyvista/pyvista" target="_blank"><span style="font-size: 15px;">https://github.com/pyvista/pyvista</span></a></li></ul><hr/><ul><li></li></ul><h2><span style="font-size: 15px;">Glumpy</span></h2><p><span style="font-size: 15px;">作者为Nicolas P. Rougier,Glumpy是Python、Numpy和OpenGL的完美结合,支持GPU加速,让可视化变得快速、美观、动态、可交互等。</span></p><p><img src="https://pica.zhimg.com/v2-a8bebb85b624c14c472ded582c865e61_720w.jpg?source=d16d100b" alt="动图封面" data-href="" style="width: 100%;"/></p><p><span style="font-size: 15px;">银河系动态模拟</span></p><p><img src="https://pic2.zhimg.com/v2-2bbbef6b4fd5163b4c1ee5be25ea2df9_1440w.jpg" alt="" data-href="" style=""/></p><p><span style="font-size: 15px;">3D曲面图</span></p><p><img src="https://pic3.zhimg.com/v2-64656af025ac5ec8361b09bf67e331c4_1440w.jpg" alt="" data-href="" style=""/></p><p><span style="font-size: 15px;">更多</span></p><ul><li><span style="font-size: 15px;">进一步学习:</span><a href="https://link.zhihu.com/?target=https%3A//github.com/glumpy/glumpy" target="_blank"><span style="font-size: 15px;">https://github.com/glumpy/glumpy</span></a></li></ul><hr/><ul><li></li></ul><h2><span style="font-size: 15px;">itkwidgets</span></h2><p><span style="font-size: 15px;">itkwidgets是Jupyter的一个交互式小部件,主要运用于</span><span style="font-size: 15px;"><strong>可视化图像、点集和mesh</strong></span><span style="font-size: 15px;">。</span></p><p><img src="https://pic2.zhimg.com/v2-4477857e660cdaf9e80f60c64f84c41e_720w.jpg?source=d16d100b" alt="动图封面" data-href="" style="width: 100%;"/></p><p><span style="font-size: 15px;">小demo</span></p><ul><li><span style="font-size: 15px;">进一步学习:</span><a href="https://link.zhihu.com/?target=https%3A//github.com/InsightSoftwareConsortium/itkwidgets" target="_blank"><span style="font-size: 15px;">https://github.com/InsightSoftwareConsortium/itkwidgets</span></a></li></ul><hr/><ul><li></li></ul><h2><span style="font-size: 15px;">vedo</span></h2><p><span style="font-size: 15px;">几行代码实现3D point clouds, meshes and volumes</span></p><p><img src="https://pic3.zhimg.com/v2-4651a841f6f7140566b0dec3d4095a0e_1440w.jpg" alt="" data-href="" style=""/></p><p><span style="font-size: 15px;">1D, 2D and 3D histogramming</span></p><p><img src="https://pic2.zhimg.com/v2-7a333dabcc25d12c2d2651ba056aa317_720w.jpg?source=d16d100b" alt="动图封面" data-href="" style="width: 100%;"/></p><p><span style="font-size: 15px;">更多</span></p><ul><li><span style="font-size: 15px;">进一步学习:</span><a href="https://link.zhihu.com/?target=https%3A//github.com/marcomusy/vedo" target="_blank"><span style="font-size: 15px;">https://github.com/marcomusy/vedo</span></a></li></ul><hr/><ul><li></li></ul><h2><span style="font-size: 15px;">ipyvolume</span></h2><p><span style="font-size: 15px;">可在Jupyter Notebook中渲染3D图,基于WebGL,功能较少。</span></p><p><img src="https://pic3.zhimg.com/v2-8e14e029c19f5f3d9ea70b7b026c862e_720w.jpg?source=d16d100b" alt="动图封面" data-href="" style="width: 100%;"/></p><p><span style="font-size: 15px;">小demo</span></p><p><span style="font-size: 15px;">进一步学习:</span><a href="https://link.zhihu.com/?target=https%3A//github.com/widgetti/ipyvolume" target="_blank"><span style="font-size: 15px;">https://github.com/widgetti/ipyvolume</span></a></p><hr/><p><br></p><h2><span style="font-size: 15px;">mayavi</span></h2><p><img src="https://picx.zhimg.com/v2-aba92c429d04f2b81219f3f8e86d7fa5_1440w.jpg" alt="" data-href="" style="width: 100%;"/></p><p><span style="font-size: 15px;">mayavi主要有两大部分功能:</span></p><ul><li><span style="font-size: 15px;">mayavi.mlab用于处理图形可视化和图形操作,类似于matlab和matplotlib;</span></li><li><span style="font-size: 15px;">mayavi.tools.pipeline用于操作管线对象窗口对象。</span></li><li></li><li><img src="https://pica.zhimg.com/v2-9435b6d271b406d2eb0b9d715a698092_1440w.jpg" alt="" data-href="" style=""/></li><li><span style="font-size: 15px;">z-warped surface</span></li><li></li><li><img src="https://pic2.zhimg.com/v2-688ea04a30cf03a1f8c48bacf6b90ab1_1440w.jpg" alt="" data-href="" style="width: 100%;"/></li><li><span style="font-size: 15px;">protein graph structure</span></li><li></li><li><img src="https://picx.zhimg.com/v2-9ba578e212214c4d5258b81a9ab5eeb9_1440w.jpg" alt="" data-href="" style=""/></li><li><span style="font-size: 15px;">modify the data visualized via an interactive dialog</span></li><li><span style="font-size: 15px;">进一步学习:</span><a href="https://link.zhihu.com/?target=http%3A//docs.enthought.com/mayavi/mayavi/index.html" target="_blank"><span style="font-size: 15px;">http://docs.enthought.com/mayavi/mayavi/index.html</span></a></li></ul>