日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

VTK修炼之道3_VTK体系结构2

發(fā)布時(shí)間:2025/3/15 编程问答 12 豆豆
生活随笔 收集整理的這篇文章主要介紹了 VTK修炼之道3_VTK体系结构2 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

上一篇博客主要介紹了VTK的構(gòu)架以及Render Engine。接觸過VTK的同學(xué)都知道,VTK主要有Pipeline和Render Engine兩部分構(gòu)成,這里詳細(xì)介紹了Pipeline部分內(nèi)容。

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主要用于讀取和創(chuàng)造數(shù)據(jù),以及對(duì)現(xiàn)有數(shù)據(jù)進(jìn)行分析和更改、把數(shù)據(jù)寫到磁盤或者通過這個(gè)“管道”把數(shù)據(jù)送到渲染引擎中進(jìn)行顯示。例如,你可以從磁盤中讀取一個(gè)三維數(shù)據(jù)、處理數(shù)據(jù)、進(jìn)行繪制、寫回磁盤。Pipeline一般都是在為Render Engine做準(zhǔn)備工作。 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才用數(shù)據(jù)流的方法將數(shù)據(jù)信息轉(zhuǎn)換為圖形數(shù)據(jù),主要有兩個(gè)類型的對(duì)象參與了這個(gè)過程:vtkDataObject ?vtkAlgorithm

2.vtkDataObject & vtkAlgorithm 數(shù)據(jù)對(duì)象和算法

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支持的屬性數(shù)據(jù):

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。
算法,其實(shí)就是濾波器啦~把它作用在原始數(shù)據(jù)上可以生成新的數(shù)據(jù)對(duì)象。算法和數(shù)據(jù)對(duì)象聯(lián)系在一起就形成了本節(jié)我們要學(xué)的“可視化管道技術(shù)”。 下圖是對(duì)可視化管道技術(shù)的一個(gè)描述:
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.
這張圖像和下圖搭配在一起解釋了一些重要的概念。源算法通過通過讀取過構(gòu)建數(shù)據(jù)產(chǎn)生數(shù)據(jù);濾波器通過攝取一個(gè)或多個(gè)數(shù)據(jù)對(duì)象,生成一個(gè)或多個(gè)數(shù)據(jù)對(duì)象,輸出。映射器得到這些數(shù)據(jù),利用渲染引擎進(jìn)行可視化顯示。

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.

總結(jié)

以上是生活随笔為你收集整理的VTK修炼之道3_VTK体系结构2的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。