开放式挖掘格式(OMF)的三维可视化
omfvtk的Python项目详细描述
用于Open Mining Format package(omf)的vtk接口,提供 python三维可视化。
示例使用
一定要查看演示omfvtk的Example Notebook! 下面是一个使用OMF repository中托管的示例数据的示例。
importvtkiimportomfvtkproject=omfvtk.load_project('test_file.omf')project
一旦数据从omfvtk加载为vtki.MultiBlock数据集,则 该对象可直接用于来自vtki:
的交互式三维可视化project.plot(notebook=False)
或者可以创建和操纵交互式场景,以创建一个引人注目的 直接在一个笔记本里。首先,从项目中获取元素:
# Grab a few elements of interest and plot em up!vol=project['Block Model']assay=project['wolfpass_WP_assay']topo=project['Topography']dacite=project['Dacite']
然后将vtki中的筛选工具应用于体积数据:
thresher=vtki.Threshold(vol,display_params={'show_edges':False})
那你就可以把它放在一个环境里!
# Grab the active plotting window# from the thresher toolp=thresher.plotter# Add our datasetsp.add_mesh(topo,cmap='gist_earth',show_edges=False,opacity=0.5)p.add_mesh(assay,color='blue',line_width=3)p.add_mesh(dacite,show_edges=False,color='yellow',opacity=0.6)# Add the bounds axisp.add_bounds_axes()
一旦您喜欢“渲染视图”显示的内容,就可以保存屏幕快照:
p.screenshot('wolfpass.png')