VTK修炼之道3_VTK体系结构2
生活随笔
收集整理的這篇文章主要介紹了
VTK修炼之道3_VTK体系结构2
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
上一篇博客主要介紹了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的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 什么叫 飞秋
- 下一篇: 飞秋下载2010正式版最新