VTK实现简单科学可视化

来源:互联网 发布:艾瑞数据分析 编辑:程序博客网 时间:2024/05/16 13:44

VTK(Visualization ToolKit)是一种可视化工具箱,功能强大,能帮我们进行各种图像处理和可视化。本实验利用VTK对尸体头颅体数据进行科学可视化。

实验环境:

VS2015+VTK7.0

VTK的安装有点麻烦,但这是个学习的过程,网上有许多相关教程,多花点时间肯定能成功。

实验数据:

本实验数据来源于:The stanford Volume Data Archive
网站里有头颅数据的详细信息,原始数据信息如下:

Description:    CT study of a cadaver headDimensions:     113 slices of 256 x 256 pixels,                voxel grid is rectangular, and                X:Y:Z aspect ratio of each voxel is 1:1:2Files:          113 binary files, one file per sliceFile format:    16-bit integers (Mac byte ordering),                 file contains   no headerData source:    acquired on a General Electric CT Scanner and provided                courtesy of North Carolina Memorial Hospital

有多种格式的数据,都是从原始数据转化而来的。本实验使用 16-bit TIF格式数据

算法:

主要算法:Marching Cubes

Marching cubes algorithm use for extracting a polygonal mesh of an isosurface from a three-dimensional discrete scalar field (sometimes called voxels). The algorithm proceeds through the scalar field, taking eight neighbor locations at a time (thus forming an imaginary cube), then determining the polygon(s) needed to represent the part of the isosurface that passes through this cube. The individual polygons are then fused into the desired surface.The applications of this algorithm are mainly concerned with medical visualizations such as CT and MRI scan data images, and special effects or 3-D modelling with what is usually called metaballs or other metasurfaces(wiki).

这里写图片描述

结果显示:

渲染了两个表面,一个皮肤,一个骨骼,皮肤的不透明度可以调节。

(1)皮肤不透明度为1

这里写图片描述

(2)不透明度为0.5

这里写图片描述

(3)不透明度为0

图片大小问题无法显示,代码以及详情请看:我的Github

1 0
原创粉丝点击