
VTK:Medical之TissueLens
发布日期:2021-05-08 07:46:08
浏览次数:19
分类:精选文章
本文共 1535 字,大约阅读时间需要 5 分钟。
VTK:Medical之TissueLens
描述
本示例使用两个vtkClipDataSet过滤器来实现"组织透镜"效果。首先,使用vtkSphere隐式函数在用vtkFlyingEdges3D或vtkMarchingCubes提取的等值面中裁剪球形孔。然后,几何vtkSphereSource样品使用原始体积数据vtkProbeFilter。vtkClipDataSet使用所得的标量点数据使用等值面值修剪球体表面。
代码
TissueLens.cxx
// 代码逻辑如下:// 1. 创建隐式函数vtkSpherevtkSphere* sphere = new vtkSphere();sphere->SetRadius(5.0);sphere->SetCenter(0.0, 0.0, 0.0);// 2. 使用vtkFlyingEdges3D或vtkMarchingCubes提取等值面vtkFlyingEdges3D* flyingEdges = new vtkFlyingEdges3D();flyingEdges->SetInputConnection(sphere->GetOutput(), 0);flyingEdges->Update();// 3. 使用vtkProbeFilter获取样品数据vtkProbeFilter* probeFilter = new vtkProbeFilter();probeFilter->SetInputConnection(flyingEdges->GetOutput(), 0);probeFilter->SetProbePoint(0.0, 0.0, 0.0);probeFilter->Update();// 4. 创建vtkSphereSource并设置样品数据vtkSphereSource* sphereSource = new vtkSphereSource();sphereSource->SetRadius(5.0);sphereSource->SetCenter(0.0, 0.0, 0.0);sphereSource->SetSampleRadius(1.0);// 5. 使用vtkClipDataSet进行剪裁vtkClipDataSet* clipDataSet = new vtkClipDataSet();clipDataSet->SetInputConnection(probeFilter->GetOutput(), 0);clipDataSet->SetGeometry(0, 0, 0, 1, sphere->GetCenter()[0], sphere->GetCenter()[1], sphere->GetCenter()[2]);clipDataSet->Update();// 6. 使用等值面值修剪球体表面double* scalarField = new double[sphere->GetRadius()];for (int i = 0; i < sphere->GetRadius(); i++){ scalarField[i] = i;}vtkDoubleArray* scalarArray = new vtkDoubleArray();scalarArray->SetData(scalarField, sphere->GetRadius());clipDataSet->SetScalarField(scalarArray);clipDataSet->Update();
发表评论
最新留言
能坚持,总会有不一样的收获!
[***.219.124.196]2025年03月28日 02时35分53秒
关于作者

喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
02、MySQL—数据库基本操作
2019-03-05
OpenJDK1.8.0 源码解析————HashMap的实现(一)
2019-03-05
MySQL-时区导致的时间前后端不一致
2019-03-05
2021-04-05阅读小笔记:局部性原理
2019-03-05
go语言简单介绍,增强了解
2019-03-05
架构师入门:搭建基本的Eureka架构(从项目里抽取)
2019-03-05
MongoDB 快速扫盲贴
2019-03-05
one + two = 3
2019-03-05
sctf_2019_easy_heap
2019-03-06
PyQt5之音乐播放器
2019-03-06
Redis进阶实践之十八 使用管道模式提高Redis查询的速度
2019-03-06
SQL注入
2019-03-06
MPI Maelstrom POJ - 1502 ⭐⭐ 【Dijkstra裸题】
2019-03-06
Problem 330A - Cakeminator (思维)
2019-03-06
LeetCode75 颜色分类 (三路快排C++实现与应用)
2019-03-06
C语言+easyX图形库的推箱子实现
2019-03-06
调试vs2019代码的流程
2019-03-06
脱壳与加壳-加壳-6-代码实现加密导入表
2019-03-06
Typora配置PicGo时,提示Failed to fetch
2019-03-06
bcolz的新操作
2019-03-06