上一篇博客主要介绍了VTK的构架以及Render Engine。接触过VTK的同学都知道,VTK主要有Pipeline和Render Engine两部分构成,这里详细介绍了Pipeline部分内容。

1.前言

The visualization pipeline in VTK can be used to read or create data, analyze and create derivative version of this data, and write the data to disk or pass it along to the rendering engine for display. For example, you may read a 3D volume of data from disk, process it to create a set of triangles representing an isovalued surface through the volume, then write this geometric object back out to disk. Or, you may create a set of spheres and cylinders to represent atoms and bonds, then pass these off to the rendering engine for display.
VTK的pipeline主要用于读取和创造数据,以及对现有数据进行分析和更改、把数据写到磁盘或者通过这个“管道”把数据送到渲染引擎中进行显示。例如,你可以从磁盘中读取一个三维数据、处理数据、进行绘制、写回磁盘。Pipeline一般都是在为Render Engine做准备工作。
The Visualization Toolkit uses a data flow approach to transform information into graphical data. There are two basic types of objects involved in this approach.
VTK才用数据流的方法将数据信息转换为图形数据,主要有两个类型的对象参与了这个过程:vtkDataObject

vtkAlgorithm。

2.vtkDataObject & vtkAlgorithm 数据对象和算法

The attribute data can be associated with the points or cells of the dataset. Cells are topological organizations of points; cells form the atoms of the dataset and are used to interpolate information between points。
下图显示了VTK支持的属性数据:
Algorithms, also referred to generally as filters, operate on data objects to produce new dataobjects. Algorithms and data objects are connected together to form visualization pipelines。
算法,其实就是滤波器啦~把它作用在原始数据上可以生成新的数据对象。算法和数据对象联系在一起就形成了本节我们要学的“可视化管道技术”。
下图是对可视化管道技术的一个描述:
this figure together with  Next Figure  illustrate some important visualization concepts. Source algorithms produce data by reading (reader objects) or constructing one or more data objects (procedural source objects). Filters ingest one or more data objects and generate one or more data objects on output. Mappers take the data and convert it into a visual representation that is displayed by the rendering engine. A writer can be thought of as a type of mapper that writes data to a file or stream.
这张图像和下图搭配在一起解释了一些重要的概念。源算法通过通过读取过构建数据产生数据;滤波器通过摄取一个或多个数据对象,生成一个或多个数据对象,输出。映射器得到这些数据,利用渲染引擎进行可视化显示。

3.several important issues regarding the construction of the visualization pipeline

First, pipeline topology is constructed using variations of the methods which sets the input to the filter aFilter to the output of the filter anotherFilter. (Filters with multiple inputs and outputs have similar methods.) 
aFilter->SetInputConnection( anotherFilter->GetOutputPort() );

We only want to execute those portions of the pipeline necessary to bring the output up to date. The Visualization Toolkit uses a lazy evaluation scheme (executes only when the data is requested) based on an internal modification time of each object.

Third, the assembly of the pipeline requires that only those objects compatible with one another can fit together with the SetInputConnection() and GetOutputPort() methods. VTK produces errors at run-time if the data object types are incompatible. 
Finally, we must decide whether to cache, or retain, the data objects once the pipeline has executed. Since visualization datasets are typically quite large, this is important to the successful application of visualization tools. VTK offers methods to turn data caching on and off, use of reference counting to avoid copying data, and methods to stream data in pieces if an entire dataset cannot be held in memory. 

4. Image Processing 图像处理

VTK supports an extensive set of image processing and volume rendering functionality. In VTK, both 2D (image) and 3D (volume) data are referred to as vtkImageData. An image dataset in VTK is one in which the data is arranged in a regular, axis-aligned array. Images, pixmaps, and bitmaps are examples of 2D image datasets; volumes (a stack of 2D images) is a 3D image dataset.
Algorithms in the imaging pipeline always input and output image data objects. Because of the regular and simple nature of the data, the imaging pipeline has other important features. Volume rendering (体绘制)is used to visualize 3D vtkImageData , and special image viewers are used to view 2D vtkImageData. Almost all algorithms in the imaging pipeline are multithreaded(图像管道中的所有的算法都是多线程的) and are capable of streaming data in pieces to satisfy a user-specified memory limit.Filters automatically sense the number of cores and processors available on the system and create that number of threads during execution as well as automatically separating data into pieces that are streamed through the pipeline.

VTK修炼之道3_VTK体系结构2相关推荐

  1. VTK修炼之道2_VTK体系结构1

    1.OverView综述 The Visualization Toolkit consists of two basic subsystems: a compiled C++ class librar ...

  2. 【转】VTK修炼之道2_VTK体系结构1

    1.OverView综述 The Visualization Toolkit consists of two basic subsystems: a compiled C++ class librar ...

  3. VTK修炼之道83:Pipeline管线执行模型

    1.管线执行模性 请求是VTK执行管线的一个基本操作,一个管线执行模型由多个请求共同完成.管线建立完毕,当显示调用一个Filter的Update()函数时,该Filter的vtkExecutive子类 ...

  4. VTK修炼之道82:VTK管线机制_信息对象类VTKInformation

    1.VTK管线机制 VTK中通过管线机制来实现组合各种算法处理数据.每一种算法是一个Filter,多个Filter连接在一起形成VTK管线.每个Filter可以分为两个组成部分:一个是算法对象,继承自 ...

  5. VTK修炼之道81:VTK开发基础_vtkObject类深入分析

    1.前言 相比于vtkObjectBase,我们接触更多的是vtkObject类. vtkObjectBase类主要实现了引用计数,因此vtkObject及其相关子类都继承了该特性. 与此同时,vtk ...

  6. VTK修炼之道80:VTK开发基础_智能指针与引用计数

    1.引用计数 VTK经过多年的开发与维护,已经形成了一套稳定的框架和开发规则.因此,了解这些规则和框架是定制VTK类的基础,这其中用到了大量面向对象的设计模式,例如对象工程模式.观察者/命令模式:还有 ...

  7. VTK修炼之道79:交互与拾取_单位拾取

    1.单位拾取 示例代码: #include <vtkAutoInit.h> VTK_MODULE_INIT(vtkRenderingOpenGL) VTK_MODULE_INIT(vtkI ...

  8. VTK修炼之道78:交互与拾取_点拾取

    1.拾取 选择拾取是人机交互过程的一个重要功能. 一个最经典的例子就是,在玩3D游戏时,场景中可能会存在多个角色,有时需要用鼠标来选择所要控制的角色,这就要用到拾取功能. 另外,在某些三维图形的编辑软 ...

  9. VTK修炼之道77:交互部件_分割/配准类Widget与其他Widget

    1.分割/配准交互部件 图像分割与配准是数字图像处理技术两大主要的应用领域,特别是在医学图像处理中. 著名的医学图像分割与配准工具包ITK(Insight Segmentation & Reg ...

最新文章

  1. 一步一步学Silverlight 2系列(24):与浏览器交互相关辅助方法
  2. [Deep-Learning-with-Python]神经网络入手学习[上]
  3. SAP关于销售来自可选工厂的解决方案
  4. css网格_我如何记住CSS网格属性
  5. SharePoint自动化部署,利用PowerShell 导入用户至AD——PART II
  6. WARNING: IPv4 forwarding is disabled. Networking will not work.解决方法
  7. python调用百度智能云API请求(以自然语言处理——词法分析为例)
  8. 访问被拒绝:“Interop.jmail”
  9. Python3 - 基础知识、基本了解
  10. Sentinel 哨兵 实现redis高可用
  11. session与cookie的区别和用法
  12. bat文件转换为exe文件
  13. 黑马JAVA P165 代码与文件编码不一致读取乱码的问题、转换流来解决
  14. 【原创】SWOT分析思维的一些基本思考与见解
  15. 图床及管理工具PicGo
  16. 指针的类型(即指针本身的类型)和指针所指向的类型是两个概念
  17. 晶振旁的电阻(并联与串联)和电容的作用
  18. 2017,那些引发关注的新建展馆
  19. Linux shell复习
  20. 龙芯2h芯片不能进入pmon_2HSOCReleaseNotes - 龙芯开源社区

热门文章

  1. php utf8 或gbk 截取字符串乱码解决
  2. 配置通过Apache(httpd)访问Subversion(SVN)1.7资源库
  3. 关于遗留系统维护的讨论
  4. nyoj7街区最短路径问题
  5. pytorch自定义数据集DataLoder
  6. LeetCode 169.求众数
  7. NYOJ 301 递推求值(矩阵快速幂)
  8. 如何在RCP程序中添加一个banner栏
  9. BZOJ1720: [Usaco2006 Jan]Corral the Cows 奶牛围栏
  10. leetcode523 Continuous Subarray Sum