Movatterモバイル変換


[0]ホーム

URL:


CN103106685B - A kind of abdominal organs three-dimensional visualization method based on GPU - Google Patents

A kind of abdominal organs three-dimensional visualization method based on GPU
Download PDF

Info

Publication number
CN103106685B
CN103106685BCN201310015075.2ACN201310015075ACN103106685BCN 103106685 BCN103106685 BCN 103106685BCN 201310015075 ACN201310015075 ACN 201310015075ACN 103106685 BCN103106685 BCN 103106685B
Authority
CN
China
Prior art keywords
image
abdominal
volume data
ray
gpu
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201310015075.2A
Other languages
Chinese (zh)
Other versions
CN103106685A (en
Inventor
姜慧研
项飞
邹坤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Northeastern University China
Original Assignee
Northeastern University China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Northeastern University ChinafiledCriticalNortheastern University China
Priority to CN201310015075.2ApriorityCriticalpatent/CN103106685B/en
Publication of CN103106685ApublicationCriticalpatent/CN103106685A/en
Application grantedgrantedCritical
Publication of CN103106685BpublicationCriticalpatent/CN103106685B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Landscapes

Abstract

Translated fromChinese

一种基于GPU的腹部脏器三维可视化的方法,属于医学图像处理技术领域,计算机X射线断层扫描设备对人体腹部进行CT扫描;获取腹部CT图像,并对获取的腹部CT图像进行三维可视化处理,得到三维可视化处理的结果图像;对腹部CT图像进行对应点匹配插值得到新插值图像,由新插值图像与原腹部CT图像得到匹配插值后的腹部CT图像即体数据;进行光线投射,得到腹部CT图像光线投射结果图像;将腹部CT图像的三维可视化处理的结果图像在装有独立GPU的计算机屏幕上显示。在对医学图像三维可视化处理时先进行插值,使断层图像的层间隔减小;基于GPU进行光线投射,利用GPU高并发的特性、有效地降低计算时间。

A method for three-dimensional visualization of abdominal organs based on GPU belongs to the technical field of medical image processing. Computer X-ray tomography equipment performs CT scanning on the abdomen of a human body; obtains abdominal CT images, and performs three-dimensional visualization processing on the obtained abdominal CT images. Obtain the result image of three-dimensional visualization processing; perform matching interpolation on the corresponding points of the abdominal CT image to obtain a new interpolation image, and obtain the abdominal CT image after matching interpolation, that is, volume data, from the new interpolation image and the original abdominal CT image; perform ray projection to obtain the abdominal CT Image raycasting result image; the result image of three-dimensional visualization processing of abdominal CT image is displayed on a computer screen equipped with an independent GPU. When processing the 3D visualization of medical images, interpolation is first performed to reduce the layer interval of the tomographic image; ray projection is performed based on the GPU, and the high concurrency feature of the GPU is used to effectively reduce the calculation time.

Description

Translated fromChinese
一种基于GPU的腹部脏器三维可视化方法A 3D visualization method of abdominal organs based on GPU

技术领域technical field

本发明属于医学图像处理技术领域,具体涉及一种基于GPU的腹部脏器三维可视化方法。The invention belongs to the technical field of medical image processing, and in particular relates to a GPU-based three-dimensional visualization method for abdominal organs.

背景技术Background technique

医学影像三维可视化技术是指基于科学计算可视化技术,从一系列二维断层医学图像中重建出三维图像,利用计算机显示并完成三维图像操作的技术。首先,对CT、MRI等医学体数据进行三维重建得到三维模型,对体数据的绘制结果从各个方向进行投影显示,便于医生从不同方向对人体内部结构进行观察,能辅助医生对感兴趣区域或感兴趣器官的大小形状和空间位置获得定量描述,帮助医生了解复杂的解剖细节,提供直观的视觉印象。在此基础上结合实际临床应用,实现计算机与用户的交互,对可视化结果进行任意平面切割,可以帮助实现手术模拟、手术规划和虚拟内窥镜等辅助诊断操作。提高医生诊断的准确率和医院的工作效率。人体内部结构十分复杂,通常医生无法观察到手术进行的实际情况,而且手术具有高危险性,不能预先在人体上进行模拟,利用可视化技术,在重构出的三维图像基础上进行计算机模拟,可以设计、选择最佳手术方案。还可以在手术过程中对手术进行情况在屏幕上予以监视,使医生们做到心中有数,从而提高手术的成功率。其次,目前国内多数医院仍采用传统的胶片形式帮助医生诊断,大量的胶片不但存储是很大问题,也是不小的开支。实现医院数字化,不但方便医生诊断、医院管理,更能节约开支。因而医学图像三维可视化技术对于促进图像处理和可视化技术的发展和应用将起到积极的推动作用,研究并实现二维医学图像的三维可视化,具有重要的价值。The 3D visualization technology of medical imaging refers to the technology of reconstructing 3D images from a series of 2D tomographic medical images based on scientific computing visualization technology, and using computers to display and complete 3D image operations. First of all, 3D reconstruction is performed on medical volume data such as CT and MRI to obtain a 3D model, and the rendering results of the volume data are projected and displayed from various directions, which is convenient for doctors to observe the internal structure of the human body from different directions, and can assist doctors in areas of interest or The size, shape and spatial position of organs of interest are quantitatively described to help doctors understand complex anatomical details and provide intuitive visual impressions. On this basis, combined with the actual clinical application, the interaction between the computer and the user can be realized, and any plane cutting can be performed on the visualization results, which can help realize auxiliary diagnostic operations such as surgical simulation, surgical planning, and virtual endoscopy. Improve the accuracy of doctors' diagnosis and the work efficiency of hospitals. The internal structure of the human body is very complex. Usually, the doctor cannot observe the actual situation of the operation, and the operation is highly risky, so it cannot be simulated on the human body in advance. Using visualization technology, computer simulation can be performed on the basis of the reconstructed 3D image. Design and select the best surgical plan. It can also monitor the progress of the operation on the screen during the operation, so that the doctors can know what they are doing, thereby improving the success rate of the operation. Secondly, at present, most hospitals in China still use traditional films to help doctors diagnose. The storage of a large number of films is not only a big problem, but also a considerable expense. Realizing the digitalization of hospitals not only facilitates doctor diagnosis and hospital management, but also saves expenses. Therefore, the 3D visualization technology of medical images will play a positive role in promoting the development and application of image processing and visualization technology. It is of great value to study and realize the 3D visualization of 2D medical images.

医学数据可视化算法分为两大类,基于构造中间几何图元的面绘制算法和体绘制算法。面绘制需要先从体数据中重建物体的表面模型,然后利用传统图形学技术及硬件实现表面的绘制与显示;而体绘制则直接以体素为基本单元,应用视觉原理,通过对体数据重新采样来合成产生三维图像。Medical data visualization algorithms are divided into two categories, surface rendering algorithms and volume rendering algorithms based on the construction of intermediate geometric primitives. Surface rendering needs to reconstruct the surface model of the object from volume data, and then use traditional graphics technology and hardware to realize the rendering and display of the surface; while volume rendering directly takes voxel as the basic unit, applies the principle of vision, and reconstructs the volume data Sampling to synthesize a 3D image.

面绘制是从3D数据场中抽取有意义和直观信息的一种重要手段。它实际上是把体数据转换成一种逼近面表示,从而可以进一步利用计算机图形学技术,甚至已有的硬件加速技术完成感兴趣信息的提取。由于它借助于面表示这样一个中间转换过程,而不是直接把体数据投向屏幕进行绘制,有时我们又称之为间接体绘制。这种三维几何表达的模型最常用的就是表面模型,一般以平面片特别是三角面片来逼近表示。面绘制重建的方法可分为基于轮廓的表面重建和基于体素的表面重建,基于体素的表面重建最具代表性的是Cuberille算法,Marching Cubes算法和Dividing Cubes算法。Surface rendering is an important means to extract meaningful and intuitive information from 3D data fields. It actually converts volume data into an approximation surface representation, so that computer graphics technology and even existing hardware acceleration technology can be further used to complete the extraction of interesting information. Because it expresses such an intermediate conversion process by means of surfaces, rather than directly throwing volume data to the screen for rendering, sometimes we call it indirect volume rendering. The most commonly used model for this kind of three-dimensional geometric expression is the surface model, which is generally approximated by plane slices, especially triangular faces. Surface rendering and reconstruction methods can be divided into contour-based surface reconstruction and voxel-based surface reconstruction. The most representative voxel-based surface reconstruction is Cuberille algorithm, Marching Cubes algorithm and Dividing Cubes algorithm.

体绘制是以某种方式将整个数据场半透明地投影到2D 屏幕上,并不借助中间几何图形。直接由三维数据场产生屏幕上的二维图像。这种算法能产生三维数据场的整体图像,包括每一个细节,并具有图像质量高、便于并行处理等优点。其主要问题是,计算量很大,且难以利用传统的图形硬件实现绘制,因而计算时间较长。目前应用于医学体数据的体绘制算法主要有基于图像空间的光线投射(Raycasting)算法,基于物体空间扫描的溅射(Splatting)算法,错切-变形(shear-warp)算法,硬件辅助的三维纹理映射(hardware-assisted 3D texture mapping)算法。Volume rendering is somehow translucently projecting the entire data field onto a 2D screen without the aid of intermediate geometry. A two-dimensional image on the screen is generated directly from a three-dimensional data field. This algorithm can generate an overall image of a three-dimensional data field, including every detail, and has the advantages of high image quality and easy parallel processing. The main problem is that the calculation is very heavy, and it is difficult to use traditional graphics hardware to achieve drawing, so the calculation time is long. At present, the volume rendering algorithms applied to medical volume data mainly include Raycasting algorithm based on image space, Splatting algorithm based on object space scanning, shear-warp algorithm, hardware-assisted 3D Texture mapping (hardware-assisted 3D texture mapping) algorithm.

体绘制方法都可以通过积分函数来进行计算,光线投射算法是一种以图像为序的直接体绘制方法,最早由M.Levoy于1988年提出,也是体绘制中最基本和最灵活的算法。其基本思想及特点是:首先对于图像中要绘制的像素,根据视点方向,发射出一条射线,穿过像素中心向物体投射一单束光线,沿着射线,从遇到体数据开始,计算并整合遇到的体数据的光学属性。光线投射算法采用为每个体素分配透明度和颜色值的方法来合成图像,因此有利于保留图像的细节,绘制高品质的图像,特别适用于绘制区域特征模糊,体素特征相关性高的图像。但因为需要遍历每个体素,而且当观察方向发生变化时,数据中的采样点之间的前后关系也发生变化,这样就需要进行重新采样和计算,因此计算量较大。Volume rendering methods can be calculated by integral functions. The ray casting algorithm is a direct volume rendering method in order of images. It was first proposed by M.Levoy in 1988, and it is also the most basic and flexible algorithm in volume rendering. Its basic idea and characteristics are: first, for the pixel to be drawn in the image, according to the direction of the viewpoint, a ray is emitted, and a single ray is projected to the object through the center of the pixel. Integrate the optical properties of the encountered volume data. The ray casting algorithm uses the method of assigning transparency and color values to each voxel to synthesize images, so it is beneficial to retain the details of the image and draw high-quality images, especially suitable for drawing images with fuzzy regional features and high correlation of voxel features. However, because each voxel needs to be traversed, and when the observation direction changes, the relationship between the sampling points in the data also changes, so resampling and calculation are required, so the calculation is relatively large.

随着医学影像技术的发展,成像分辨率日益提升。光线投射法的每一次绘制都需要对整个体数据进行计算和处理,处理数据量巨大,而传统的腹部脏器三维可视化系统主要由基于CPU的编程语言(如C\C++等)实现,运行时间较慢,缺乏可以用于医学诊断的实时性,使得该系统在实际应用中有一定的限制。因此系统中可视化算法性能上的提升,对于整个医学诊断工作和计算机图形图像处理工作都有着极为重要的价值。With the development of medical imaging technology, the imaging resolution is increasing day by day. Each drawing of the ray projection method needs to calculate and process the entire volume data, and the amount of processed data is huge. However, the traditional 3D visualization system of abdominal organs is mainly realized by a CPU-based programming language (such as C\C++, etc.), and the running time It is slow and lacks the real-time performance that can be used for medical diagnosis, which makes the system have certain limitations in practical application. Therefore, the improvement of the performance of the visualization algorithm in the system is of great value to the entire medical diagnosis work and computer graphics and image processing work.

在腹部脏器可视化过程中,存在着高度的并行性,因此适合用GPU来进行加速。与CPU相比,GPU具有并行的计算架构以及超长流水线,这种架构虽然在处理少量数据时速度不及频率更高的CPU,但在处理如医学图像等大量数据时速度远远超过CPU。同时GPU使用SIMD (Single Instruction Multiple Data,单指令多数据流)技术,对于需要并行计算的数据只需编写单个运算操作即可实现并行计算过程。综上所述基于GPU的腹部脏器三维可视化系统相对于传统基于CPU的该系统,运算效率更高,能够保证系统的实时性,具有更高的应用价值。In the visualization process of abdominal organs, there is a high degree of parallelism, so it is suitable to be accelerated by GPU. Compared with the CPU, the GPU has a parallel computing architecture and an ultra-long pipeline. Although this architecture is not as fast as a CPU with a higher frequency when processing a small amount of data, it is much faster than a CPU when processing a large amount of data such as medical images. At the same time, the GPU uses SIMD (Single Instruction Multiple Data) technology. For data that requires parallel computing, it only needs to write a single operation to realize the parallel computing process. In summary, compared with the traditional CPU-based system, the GPU-based 3D visualization system for abdominal organs has higher computing efficiency, can ensure the real-time performance of the system, and has higher application value.

GLSL(The OpenGL Shading Language)是OpenGL着色语言的简称,它是一种用于创建OpenGL着色器的语言。作为OpenGL 2.0标准的一部分,GLSL允许应用程序显式的指定处理顶点和处理片段时进行的操作。借助GLSL能够实现基于GPU的腹部脏器三维可视化方法,提升系统的实时性。GLSL (The OpenGL Shading Language) is the abbreviation of OpenGL Shading Language, which is a language for creating OpenGL shaders. As part of the OpenGL 2.0 standard, GLSL allows applications to explicitly specify what to do when processing vertices and when processing fragments. With the help of GLSL, the 3D visualization method of abdominal organs based on GPU can be realized, and the real-time performance of the system can be improved.

发明内容Contents of the invention

针对现有技术存在的问题,本发明提供一种基于GPU的腹部脏器三维可视化方法。Aiming at the problems existing in the prior art, the present invention provides a GPU-based three-dimensional visualization method for abdominal organs.

本发明的技术方案是:Technical scheme of the present invention is:

一种基于GPU的腹部脏器三维可视化的方法,包括以下步骤:A method for three-dimensional visualization of abdominal organs based on GPU, comprising the following steps:

步骤1:计算机X射线断层扫描设备对人体腹部进行CT扫描;Step 1: Computer X-ray tomography equipment performs a CT scan on the abdomen of the human body;

步骤2:获取腹部CT图像,每组腹部CT图像包含若干张腹部断层扫描图像;Step 2: Obtain abdominal CT images, each group of abdominal CT images includes several abdominal tomographic images;

步骤3:对获取的腹部CT图像进行三维可视化处理,得到三维可视化处理的结果图像;Step 3: performing three-dimensional visualization processing on the acquired abdominal CT image to obtain a result image of the three-dimensional visualization processing;

步骤3.1:对腹部CT图像进行对应点匹配插值,在每相邻前后两张腹部断层扫描图像间得到新插值图像,由新插值图像与原腹部CT图像得到匹配插值后的腹部CT图像即体数据;Step 3.1: Perform corresponding point matching interpolation on the abdominal CT image, and obtain a new interpolation image between each adjacent two abdominal tomographic images, and obtain the abdominal CT image after matching interpolation from the new interpolation image and the original abdominal CT image, that is, the volume data ;

步骤3.2:从人在计算机内的虚拟视点经由光线投射初始空白图像中每一像素点向体数据中发射虚拟光线,进行光线投射,计算每一像素点的光线投射显示结果,所有像素点光线投射显示结果的集合构成腹部CT图像光线投射结果图像;Step 3.2: From the virtual viewpoint of the person in the computer, project each pixel in the initial blank image to the volume data through ray projection, perform ray projection, calculate the ray projection display result of each pixel, and ray projection of all pixels The collection of displayed results constitutes a ray-casting result image of an abdominal CT image;

步骤3.3:对体数据进行任意平面切割,将非感兴趣区域从体数据中切除,对切割后的体数据进行光线投射,得到切割后体数据的光线投射结果图像;Step 3.3: Carry out arbitrary plane cutting on the volume data, cut off the non-interest region from the volume data, perform ray projection on the cut volume data, and obtain the ray projection result image of the cut volume data;

步骤3.4:若需要同时显示多个体数据,则进行多体素光线投射,将不同体数据的光线投射结果图像合成至同一结果图像内作为三维可视化处理的结果图像,否则直接将切割后体数据的光线投射结果图像作为三维可视化处理的结果图像;Step 3.4: If it is necessary to display multiple volume data at the same time, multi-voxel ray projection is performed, and the ray projection result images of different volume data are synthesized into the same result image as the result image of 3D visualization processing; otherwise, the cut volume data is directly The ray casting result image is used as the result image of the 3D visualization process;

步骤4:将腹部CT图像的三维可视化处理的结果图像在装有独立GPU的计算机屏幕上显示。Step 4: The resultant image of the three-dimensional visualization processing of the abdominal CT image is displayed on a computer screen equipped with an independent GPU.

所述步骤3.1对腹部CT图像进行对应点匹配插值,在每相邻前后两张腹部断层扫描图像间得到新插值图像,由新插值图像与原腹部CT图像得到匹配插值后的腹部CT图像即体数据,具体步骤如下:The step 3.1 performs corresponding point matching interpolation on the abdominal CT image, and obtains a new interpolation image between each adjacent two abdominal tomographic images, and obtains the abdominal CT image after matching interpolation from the new interpolation image and the original abdominal CT image. data, the specific steps are as follows:

步骤3.1.1:对腹部CT图像进行匹配插值,在每相邻前后两张腹部断层扫描图像间得到新插值图像;Step 3.1.1: Perform matching interpolation on the abdominal CT image, and obtain a new interpolation image between each adjacent two abdominal tomographic images;

步骤3.1.2:对每个新插值图像上的所有点,计算其相邻前后两张腹部断层扫描图像中对应点的灰度差,并设定灰度差阈值;Step 3.1.2: For all points on each new interpolation image, calculate the gray level difference of corresponding points in the two adjacent abdominal tomographic images, and set the gray level difference threshold;

步骤3.1.3:判断计算出的灰度差是否大于灰度差阈值:是,则设定搜索窗口半径和灰度阈值,在相邻前后两张腹部断层扫描图像中分别以该两张图像的对应点为中心以搜索窗口半径为半径的匹配窗,在匹配窗内选取最佳匹配点以决定当前点的灰度值;否则,通过三次样条插值求当前点的灰度值;Step 3.1.3: Determine whether the calculated gray-scale difference is greater than the gray-scale difference threshold: if yes, set the search window radius and the gray-scale threshold. The corresponding point is the center and the radius of the search window is the matching window, and the best matching point is selected in the matching window to determine the gray value of the current point; otherwise, the gray value of the current point is calculated by cubic spline interpolation;

步骤3.1.4:得到每个新插值图像上的所有点的灰度值;Step 3.1.4: Obtain the gray value of all points on each new interpolation image;

步骤3.1.5:由原腹部CT图像灰度值与每个新插值图像上的所有点的灰度值,得到匹配插值后的腹部CT图像即体数据,体数据中的所有像素点构成一个三维的数据场。Step 3.1.5: From the gray value of the original abdominal CT image and the gray value of all points on each new interpolation image, the abdominal CT image after matching interpolation is obtained, that is, the volume data, and all the pixels in the volume data form a three-dimensional data field.

所述步骤3.2从人在计算机内的虚拟视点经由光线投射初始空白图像中每一像素点向体数据中发射虚拟光线,进行光线投射,计算每一像素点的光线投射显示结果,所有像素点光线投射显示结果的集合构成腹部CT图像光线投射结果图像,具体步骤如下:The step 3.2 is to project each pixel in the initial blank image from the virtual viewpoint of the person in the computer into the volume data through ray projection, perform ray projection, and calculate the ray projection display result of each pixel point, and the light rays of all pixel points The set of projection display results constitutes the result image of the abdominal CT image ray projection, and the specific steps are as follows:

步骤3.2.1:将体数据作为三维纹理加载至GPU的缓存中;Step 3.2.1: Load the volume data as a three-dimensional texture into the cache of the GPU;

步骤3.2.2:设定颜色传递函数与透明度传递函数,并将这两个传递函数作为一维纹理分别加载至GPU的缓存中;Step 3.2.2: Set the color transfer function and the transparency transfer function, and load these two transfer functions as one-dimensional textures into the cache of the GPU;

步骤3.2.3:从人在计算机内的虚拟视点经由光线投射初始空白图像中每一像素点向体数据中发射虚拟光线,进行光线投射;Step 3.2.3: From the virtual point of view of the person in the computer, project each pixel in the initial blank image to the volume data through ray projection, and perform ray projection;

步骤3.2.4:在GPU内并行处理所有投射的光线,沿光线进行重采样,对采样结果进行合成,并根据设定的颜色传递函数与透明度传递函数计算每一像素点的颜色和不透明度,即得到每一像素点的光线投射显示结果;Step 3.2.4: Process all projected rays in parallel in the GPU, resample along the rays, synthesize the sampling results, and calculate the color and opacity of each pixel according to the set color transfer function and transparency transfer function, That is, the ray projection display result of each pixel is obtained;

步骤3.2.5:所有光线投射显示结果的集合构成腹部CT图像光线投射结果图像。Step 3.2.5: The collection of all ray-casting display results constitutes the ray-casting result image of the abdominal CT image.

所述步骤3.3对体数据进行任意平面切割,将非感兴趣区域从体数据中切除,对切割后的体数据进行光线投射,得到切割后体数据的光线投射结果图像,具体步骤如下:The step 3.3 performs arbitrary plane cutting on the volume data, cuts out the non-interest region from the volume data, performs ray projection on the cut volume data, and obtains a ray projection result image of the cut volume data, and the specific steps are as follows:

步骤3.3.1:用户在体数据上选定四个点,以确定切割平面;Step 3.3.1: The user selects four points on the volume data to determine the cutting plane;

步骤3.3.2:将体数据中位于切割平面外的像素点灰度值设为0,即将非感兴趣区域从体数据中切除;Step 3.3.2: Set the gray value of the pixels outside the cutting plane in the volume data to 0, that is, cut off the non-interest region from the volume data;

步骤3.3.3: 从人在计算机内的虚拟视点经由腹部CT图像中每一像素点向体数据中发射虚拟光线,计算每一像素点的光线投射显示结果,所有像素点光线投射显示结果的集合构成切割后体数据的光线投射结果图像。Step 3.3.3: From the virtual viewpoint of the person in the computer, a virtual ray is emitted to the volume data through each pixel in the abdominal CT image, and the ray projection display result of each pixel is calculated, and the collection of all pixel ray projection display results The resulting image of the raycast that constitutes the sliced volume data.

所述步骤3.4中的进行多体素光线投射,将不同体数据的光线投射结果图像合成至同一结果图像内作为三维可视化处理的结果图像,具体方法如下:Perform multi-voxel ray projection in the step 3.4, and synthesize the ray projection result images of different volume data into the same result image as the result image of three-dimensional visualization processing. The specific method is as follows:

将多个体数据置于同一空间,对于多个体数据的未重合区域,多体素光线投射的结果图像与腹部CT图像光线投射的结果图像一致;对于多个体数据的重合区域,设定权重因子ω,多个体数据的重合区域结果图像I计算公式如下:Put multiple volume data in the same space, for the non-overlapping area of multiple volume data, the result image of multi-voxel ray projection is consistent with the result image of abdominal CT image ray projection; for the overlapping area of multiple volume data, set the weight factor ω , the calculation formula of the overlapping area result image I of multiple volume data is as follows:

I = ω·I1 + (1 – ω·α1)·I2I = ω·I1 + (1 – ω·α1 )·I2

其中,I1与I2分别表示两个重合的体数据的光线投射结果图像,α1表示第一幅图像中的不透明度,如果重合区域包含两个以上体数据,则先求两个重合体数据的结果,将得到的结果再与第三个体数据进行计算,以此类推。Among them, I1 and I2 respectively represent the ray-casting result images of two overlapping volume data, α1 represents the opacity in the first image, if the overlapping area contains more than two volume data, first find the two overlapping volumes The result of the data, calculate the result with the third individual data, and so on.

所述步骤3.1.3中的设定搜索窗口半径和灰度阈值,在相邻前后两张腹部断层扫描图像中分别以对应点为中心以搜索窗口半径为半径的匹配窗,在匹配窗内选取最佳匹配点以决定当前点的灰度值,具体步骤如下:In the step 3.1.3, set the search window radius and the gray threshold value, in the two adjacent abdominal tomographic images before and after, respectively take the corresponding point as the center and the search window radius as the matching window, and select within the matching window The best matching point to determine the gray value of the current point, the specific steps are as follows:

步骤3.1.3.1:将相邻前后两张腹部断层扫描图像任意一张设为目标图像,另一张设为参考图像,并设定相异度权重因子,对目标图像匹配窗中灰度大于灰度阈值的点Pk,计算该点与参考图像匹配窗中每一点Pk+1的相异度,并选择相异度最小的点作为Pk的最佳匹配点;Step 3.1.3.1: Set any one of the two adjacent abdominal tomographic images as the target image, and the other as the reference image, and set the dissimilarity weight factor. The grayscale in the matching window of the target image is greater than the grayscale degree threshold point Pk , calculate the degree of dissimilarity between this point and each point Pk+1 in the matching window of the reference image, and select the point with the smallest degree of dissimilarity as the best matching point of Pk ;

步骤3.1.3.2:交换参考图像和目标图像,重新执行步骤3.1.3.1,对于两次结果一致的最佳匹配点进行线性插值,求出新插值图像中点的灰度值,否则使用三次样条插值求新插值图像中点的灰度值。Step 3.1.3.2: Exchange the reference image and the target image, re-execute step 3.1.3.1, perform linear interpolation for the best matching points with the same results twice, and find the gray value of the midpoint of the new interpolated image, otherwise use cubic spline Interpolate finds the gray value of the points in the newly interpolated image.

所述步骤3.2.4在GPU内并行处理所有投射的光线,沿光线进行重采样,对采样结果进行合成,并根据设定的颜色传递函数与透明度传递函数计算每一像素点的颜色和不透明度,即得到每一像素点的光线投射显示结果,具体步骤如下:The step 3.2.4 processes all projected rays in parallel in the GPU, resamples along the rays, synthesizes the sampling results, and calculates the color and opacity of each pixel according to the set color transfer function and transparency transfer function , that is, to obtain the ray projection display result of each pixel, the specific steps are as follows:

步骤3.2.4.1:对于一条投射光线L,获取其在数据场入射点的投影坐标和出射点的投影坐标;Step 3.2.4.1: For a projected ray L, obtain its projected coordinates of the incident point and projected coordinates of the exit point in the data field;

步骤3.2.4.2:设定采样间隔,即在投射光线L进入数据场后每间隔采样间隔距离采样一次;Step 3.2.4.2: Set the sampling interval, that is, after the projected light L enters the data field, it is sampled once at each sampling interval distance;

步骤3.2.4.3:对于一采样点P,将其投影坐标β转换为模型局部坐标α;Step 3.2.4.3: For a sampling point P, transform its projection coordinate β into the model local coordinate α;

步骤3.2.4.4:对采样点P的模型局部坐标α在数据场中进行三维纹理查找,得到P点灰度值;Step 3.2.4.4: Perform a three-dimensional texture search on the model local coordinate α of the sampling point P in the data field to obtain the gray value of point P;

步骤3.2.4.5:对P点灰度值在颜色传递函数与透明度传递函数中分别进行一维纹理查找,得到P点的颜色与透明度;Step 3.2.4.5: Perform one-dimensional texture search for the gray value of point P in the color transfer function and transparency transfer function respectively, and obtain the color and transparency of point P;

步骤3.2.4.6:对透明度进行不透明度修正,消除采样点过密可能导致的过采样现象;Step 3.2.4.6: Perform opacity correction on the transparency to eliminate oversampling phenomenon that may be caused by too dense sampling points;

步骤3.2.4.7:根据Phone光照模型求采样点P的最终颜色I;Step 3.2.4.7: Calculate the final color I of the sampling point P according to the Phone lighting model;

步骤3.2.4.8:对投射光线L上所有采样点的颜色求平均颜色作为在结果图像中对应像素显示的颜色,修正后的透明度求和得到对应像素的透明度。Step 3.2.4.8: Calculate the average color of the colors of all sampling points on the projected light L as the color displayed by the corresponding pixel in the result image, and sum the corrected transparency to obtain the transparency of the corresponding pixel.

所述的基于GPU的腹部脏器三维可视化的方法采用的三维可视化系统,包括装有独立GPU的计算机和计算机X射线断层扫描设备;The three-dimensional visualization system adopted by the method for the three-dimensional visualization of abdominal organs based on GPU includes a computer equipped with an independent GPU and computer X-ray tomography equipment;

所述计算机X射线断层扫描设备用于获取腹部CT图像,并将其传输至装有独立GPU的计算机;The computerized X-ray tomography equipment is used to obtain abdominal CT images and transmit them to a computer equipped with an independent GPU;

所述装有独立GPU的计算机用于对腹部CT图像进行三维可视化图像数据处理。The computer equipped with an independent GPU is used for performing three-dimensional visualization image data processing on abdominal CT images.

有益效果:Beneficial effect:

本发明在对医学图像三维可视化处理时先进行插值,使断层图像的层间隔减小;基于GPU进行光线投射,利用GPU高并发的特性、有效地降低计算时间;引入Phone光照模型完善体绘制效果,增强真实感;对多体数据的多体素光线投射针对原来对全身进行可视化和单个体数据进行绘制的一些不足和弊病,如对全身所有体数据统一设置传递函数、没有针对性,可视化效果不明显等,利用已分割好的腹部脏器,分别显示,分别设置传递函数,有效地对腹部脏器进行了可视化,能显示不同腹部脏器的细节信息;本发明最后给出三维体数据场的任意平面切割的实现方法,能更丰富的反映体数据的内部信息,满足医生对图像质量和交互性能的需要。The present invention performs interpolation first when processing the three-dimensional visualization of medical images, so as to reduce the layer interval of the tomographic image; performs light projection based on the GPU, utilizes the high concurrency characteristics of the GPU, and effectively reduces the calculation time; introduces the Phone illumination model to improve the volume rendering effect , to enhance the sense of reality; the multi-voxel raycasting of multi-volume data aims at some deficiencies and disadvantages of the original visualization of the whole body and the drawing of single-volume data, such as uniformly setting transfer functions for all volume data of the whole body, which is not targeted, and the visualization effect Not obvious, etc., use the segmented abdominal organs to display them separately, set the transfer function separately, effectively visualize the abdominal organs, and can display the detailed information of different abdominal organs; the present invention finally gives the three-dimensional volume data field The implementation method of arbitrary plane cutting can reflect the internal information of volume data more abundantly, and meet the needs of doctors for image quality and interactive performance.

附图说明Description of drawings

图1是本发明的具体实施方式的光线投射示意图;Fig. 1 is a schematic diagram of light projection of a specific embodiment of the present invention;

图2是传统基于CPU的光线投射流程图;Figure 2 is a flow chart of traditional CPU-based ray casting;

图3是本发明的具体实施方式的方法的光线投射流程图;Fig. 3 is a ray projection flowchart of a method according to a specific embodiment of the present invention;

图4是本发明的具体实施方式的基于GPU的腹部脏器三维可视化的方法流程图;Fig. 4 is the method flowchart of the three-dimensional visualization of abdominal organs based on GPU according to the embodiment of the present invention;

图5是本发明的具体实施方式的对获取的腹部CT图像进行三维可视化处理的流程图;Fig. 5 is a flow chart of performing three-dimensional visualization processing on acquired abdominal CT images according to a specific embodiment of the present invention;

图6是本发明的具体实施方式的任意两个角度的光线投射结果图像;Fig. 6 is an image of the light projection results of any two angles of the specific embodiment of the present invention;

图7是本发明的具体实施方式的第一组腹部CT图像进行体数据切割的结果图像,其中(a)为冠状切割结果图像,(b)为横断面切割结果图像,(c)为矢状面切割结果图像,(d)~(f)为任意平面切割结果图像;Fig. 7 is the result image of volume data cutting of the first group of abdominal CT images according to the specific embodiment of the present invention, where (a) is the result image of coronal cutting, (b) is the result image of cross-sectional cutting, and (c) is the result image of sagittal Surface cutting result image, (d)~(f) are arbitrary plane cutting result images;

图8是本发明的具体实施方式的第一组、第四组和第五组腹部CT图像进行多体素光线投射结果图像,其中,(a)为正常可视化结果图像,(b)为突出显示胆囊的可视化结果图像。Fig. 8 is the results of multi-voxel ray projection of the first, fourth and fifth groups of abdominal CT images according to the specific embodiment of the present invention, where (a) is the normal visualization result image, and (b) is the highlighted display Visualization result image of the gallbladder.

具体实施方式Detailed ways

下面结合附图对本发明的具体实施方式做详细说明。The specific implementation manners of the present invention will be described in detail below in conjunction with the accompanying drawings.

本实施方式中,采用的三维可视化系统,包括装有独立GPU的计算机和计算机X射线断层扫描设备;In this embodiment, the three-dimensional visualization system adopted includes a computer equipped with an independent GPU and computer X-ray tomography equipment;

计算机X射线断层扫描设备用于获取腹部CT图像,并将其传输至装有独立GPU的计算机;Computed tomography equipment is used to acquire CT images of the abdomen and transfer them to a computer equipped with a discrete GPU;

装有独立GPU的计算机用于对腹部CT图像进行三维可视化图像数据处理,硬件配置为Intel Core2 Duo T6500 CPU、2GB内存、采用GPU为NVIDIA GeForce GT130M图形显示卡。A computer equipped with an independent GPU is used for three-dimensional visualization image data processing of abdominal CT images. The hardware configuration is Intel Core2 Duo T6500 CPU, 2GB memory, and the GPU is NVIDIA GeForce GT130M graphics card.

一种基于GPU的腹部脏器三维可视化的方法,如图4所示,包括以下步骤:A method for three-dimensional visualization of abdominal organs based on GPU, as shown in Figure 4, comprises the following steps:

步骤1:计算机X射线断层扫描设备对人体腹部进行CT扫描;Step 1: Computer X-ray tomography equipment performs a CT scan on the abdomen of the human body;

步骤2:获取五组腹部CT图像,每组腹部CT图像包含若干张腹部断层扫描图像;Step 2: Obtain five groups of abdominal CT images, each group of abdominal CT images includes several abdominal tomographic images;

腹部CT图像共五组:第一组为肝脏CT图像,包括163张肝脏断层扫描图像,该肝脏CT图像大小为512×512×163,像素间距为0.68×0.68×2mm;第二组为肝脏CT图像,包括85张肝脏断层扫描图像,该肝脏CT图像大小为256×256×85,层间距为0.68×0.68×2mm;第三组为肝脏CT图像,包括185张肝脏断层扫描图像,该肝脏CT图像大小为708×706×185,层间距为0.68×0.68×2mm;第四组为脾脏CT图像,包括98张脾脏断层扫描图像,该脾脏CT图像大小为512×512×98,层间距为0.68×0.68×2mm;第五组为胆囊CT图像,包括46张胆囊断层扫描图像,该胆囊CT图像大小为560×558×46,层间距为0.68×0.68×2mm。There are five groups of abdominal CT images: the first group is liver CT images, including 163 liver tomographic images, the liver CT image size is 512×512×163, and the pixel pitch is 0.68×0.68×2mm; Images, including 85 liver tomographic images, the size of the liver CT images is 256×256×85, and the layer spacing is 0.68×0.68×2mm; the third group is liver CT images, including 185 liver tomographic images, the liver CT The image size is 708×706×185, and the interslice distance is 0.68×0.68×2mm; the fourth group is spleen CT images, including 98 spleen tomographic images, and the spleen CT image size is 512×512×98, and the interslice distance is 0.68 ×0.68×2mm; the fifth group is gallbladder CT images, including 46 gallbladder tomographic images.

步骤3:对获取的五组腹部CT图像进行三维可视化处理,得到三维可视化处理的结果图像,流程如图5所示,步骤如下:Step 3: Perform three-dimensional visualization processing on the acquired five groups of abdominal CT images to obtain the result image of the three-dimensional visualization processing. The process is shown in Figure 5, and the steps are as follows:

步骤3.1:对五组腹部CT图像进行对应点匹配插值,在每相邻前后两张腹部断层扫描图像间得到新插值图像,由新插值图像与原腹部CT图像得到匹配插值后的腹部CT图像即体数据,具体步骤如下:Step 3.1: Carry out corresponding point matching interpolation on the five groups of abdominal CT images, and obtain a new interpolation image between each adjacent two abdominal tomographic images, and obtain the abdominal CT image after matching interpolation from the new interpolation image and the original abdominal CT image. Volume data, the specific steps are as follows:

步骤3.1.1:对腹部CT图像进行匹配插值,在每相邻前后两张腹部断层扫描图像间得到新插值图像,新插值图像上的点记为(xi,yj,z),其相邻前后两张腹部断层扫描图像中对应点分别记为(xi,yj,zk)、(xi,yj,zk+1);Step 3.1.1: Perform matching interpolation on the abdominal CT image, and obtain a new interpolation image between two adjacent abdominal tomographic images. The point on the new interpolation image is marked as (xi , yj , z), and its relative The corresponding points in the two adjacent abdominal tomographic images are respectively recorded as (xi , yj , zk ), (xi , yj , zk+1 );

步骤3.1.2:对每个新插值图像上的所有点,计算其相邻前后两张腹部断层扫描图像中对应点的灰度差Dij,并设定灰度差阈值T为10;Step 3.1.2: For all points on each new interpolation image, calculate the gray level difference Dij of corresponding points in the two adjacent abdominal tomographic images, and set the gray level difference threshold T to 10;

步骤3.1.3:判断计算出的灰度差Dij是否大于灰度差阈值T:是,则设定搜索窗口半径W=5和灰度阈值V=0,在相邻前后两张腹部断层扫描图像中分别以该两张图像的对应点为中心以搜索窗口半径W为半径的匹配窗,在匹配窗内选取最佳匹配点以决定当前点的灰度值;否则,通过三次样条插值求当前点的灰度值;Step 3.1.3: Determine whether the calculated gray-scale difference Dij is greater than the gray-scale difference threshold T: if yes, set the search window radius W=5 and the gray-scale threshold V=0, and perform two adjacent abdominal tomographic scans In the image, the corresponding point of the two images is the center and the search window radius W is the matching window, and the best matching point is selected in the matching window to determine the gray value of the current point; otherwise, the gray value of the current point is determined by cubic spline interpolation. The gray value of the current point;

其中,设定搜索窗口半径W=5和灰度阈值V=0,在相邻前后两张腹部断层扫描图像中分别以对应点为中心以搜索窗口半径W为半径的匹配窗,在匹配窗内选取最佳匹配点以决定当前点的灰度值,具体步骤如下:Among them, the search window radius W=5 and the gray threshold V=0 are set, and the matching windows with the corresponding point as the center and the search window radius W as the radius in the two adjacent abdominal tomographic images respectively, within the matching window Select the best matching point to determine the gray value of the current point, the specific steps are as follows:

步骤3.1.3.1:将相邻前后两张腹部断层扫描图像任意一张设为目标图像,另一张设为参考图像,并设定相异度权重因子u1=0.25,u2=0.25,u3=0.25,u4=0.25,对目标图像匹配窗中灰度大于灰度阈值V的点Pk,计算该点与参考图像匹配窗中每一点Pk+1的相异度,并选择相异度最小的点作为Pk的最佳匹配点;Step 3.1.3.1: Set any one of the two adjacent abdominal tomographic images as the target image, and the other as the reference image, and set the dissimilarity weight factors u1=0.25, u2=0.25, u3=0.25 , u4=0.25, for the point Pk in the matching window of the target image whose gray level is greater than the gray level threshold V, calculate the dissimilarity between this point and every point Pk+1 in the matching window of the reference image, and select the one with the smallest dissimilarity Point as the best matching point of Pk ;

求点Pk、Pk+1间相异度的C(Pk,Pk+1)的公式如下:The formula for calculating C(Pk ,Pk+1 ) of the degree of dissimilarity between points Pk and Pk+1 is as follows:

C(Pk,Pk+1)=u1[f(Pk)-f(Pk+1)]ie+u2[g(Pk)-g(Pk+1)]je+u3[θ(Pk)-θ(Pk+1)]ke+u4D[Pk,Pk+1]leC(Pk ,Pk+1 )=u1 [f(Pk )-f(Pk+1 )]ie +u2 [g(Pk )-g(Pk+1 )]je +u3 [θ(Pk )-θ(Pk+1 )]ke +u4 D[Pk ,Pk+1 ]le

其中,ie、je、ke、le分别表示灰度、梯度、梯度方向和偏移四个方向上的单位向量,f(Pk)表示第k层点的灰度值,g(Pk)表示第k层点的梯度值,θ(Pk)表示第k层点的梯度方向,D[Pk,Pk+1]表示第k层和第k+1层上进行计算的两个点在水平面上投影的距离;Among them, ie , je , ke , andle represent the unit vectors in the four directions of gray, gradient, gradient direction and offset, respectively, f(Pk ) represents the gray value of the k-th layer point, g( Pk ) represents the gradient value of the k-th layer point, θ(Pk ) represents the gradient direction of the k-th layer point, D[Pk , Pk+1 ] represents the calculation on the k-th layer and k+1 layer The distance between two points projected on the horizontal plane;

步骤3.1.3.2:交换参考图像和目标图像,重新执行步骤3.1.3.1,对于两次结果一致的最佳匹配点进行线性插值,求出新插值图像中点(xi,yj,z)的灰度值,否则使用三次样条插值求点(xi,yj,z)的灰度值。Step 3.1.3.2: Exchange the reference image and the target image, re-execute step 3.1.3.1, perform linear interpolation on the best matching points with the same results twice, and find the midpoint (xi , yj , z) of the new interpolation image Gray value, otherwise use cubic spline interpolation to find the gray value of point (xi , yj , z).

步骤3.1.4:得到每个新插值图像上的所有点的灰度值;Step 3.1.4: Obtain the gray value of all points on each new interpolation image;

步骤3.1.5:由原腹部CT图像灰度值与每个新插值图像上的所有点的灰度值,得到匹配插值后的腹部CT图像即体数据,体数据中的所有像素点构成一个三维的数据场。Step 3.1.5: From the gray value of the original abdominal CT image and the gray value of all points on each new interpolation image, the abdominal CT image after matching interpolation is obtained, that is, the volume data, and all the pixels in the volume data form a three-dimensional data field.

对五组腹部CT图像均进行插值,插值后的腹部CT图像数据量增加了一倍,能够有效地增强三维可视化的效果。All five groups of abdominal CT images are interpolated, and the data volume of the interpolated abdominal CT images is doubled, which can effectively enhance the effect of three-dimensional visualization.

步骤3.2:从人在计算机内的虚拟视点经由光线投射初始空白图像中每一像素点向体数据中发射虚拟光线,进行光线投射,如图1所示,计算每一像素点的光线投射显示结果,所有像素点光线投射显示结果的集合构成腹部CT图像光线投射结果图像,光线投射的流程如图3所示,具体步骤如下:Step 3.2: From the virtual viewpoint of the person in the computer, project each pixel in the initial blank image to the volume data through ray projection, and perform ray projection, as shown in Figure 1, calculate the ray projection display result of each pixel , the collection of all pixel ray projection display results constitutes the abdominal CT image ray projection result image, the process of ray projection is shown in Figure 3, and the specific steps are as follows:

步骤3.2.1:将体数据作为三维纹理加载至GPU的缓存中;Step 3.2.1: Load the volume data as a three-dimensional texture into the cache of the GPU;

步骤3.2.2:设定颜色传递函数与透明度传递函数,并将这两个传递函数作为一维纹理分别加载至GPU的缓存中;Step 3.2.2: Set the color transfer function and the transparency transfer function, and load these two transfer functions as one-dimensional textures into the cache of the GPU;

颜色传递函数与透明度传递函数的形式相同,表示如下:The color transfer function has the same form as the transparency transfer function, expressed as follows:

ff((xx))==vv1100<<xx&le;&le;TT11vv22TT11<<xx&le;&le;TT22............vvnnoxx>>TTnno--11

其中,f(x)表示颜色传递函数或透明度传递函数,x表示采样点灰度值,Ti为设定的阈值,vi为设定的采样结果;Wherein, f(x) represents a color transfer function or a transparency transfer function, x represents a sampling point gray value, Ti is a set threshold, and vi is a set sampling result;

本实施方式中,设定颜色传递函数和透明度传递函数如下,In this embodiment, the color transfer function and the transparency transfer function are set as follows,

ff11((xx))==((0,0,00,0,0))00<<xx&le;&le;2020((0.6,0.1,0.10.6,0.1,0.1))2020<<xx&le;&le;6060

ff22((xx))==((0,0,00,0,0))00<<xx&le;&le;2020((0.9,0.6,0.20.9,0.6,0.2))2020<<xx&le;&le;6060

ff33((xx))==((0,0,00,0,0))00<<xx&le;&le;2020((0.1,0.6,0.10.1,0.6,0.1))2020<<xx&le;&le;6060

ff44((xx))==((0,0,00,0,0))00<<xx&le;&le;20201001002020<<xx&le;&le;6060

其中f1(x)、f2(x)、f3(x)分别对应肝脏图像、脾脏图像和胆囊图像的颜色传递函数,f4(x)为所有类型图像共用的透明度传递函数;Among them, f1 (x), f2 (x), and f3 (x) correspond to the color transfer functions of the liver image, spleen image, and gallbladder image, respectively, and f4 (x) is the transparency transfer function shared by all types of images;

步骤3.2.3:从人在计算机内的虚拟视点经由光线投射初始空白图像中每一像素点向体数据中发射虚拟光线,进行光线投射;Step 3.2.3: From the virtual point of view of the person in the computer, project each pixel in the initial blank image to the volume data through ray projection, and perform ray projection;

先建立一张空白的结果图像作为光线投射初始空白图像,用光线投射求结果图像的内容。First create a blank result image as the initial blank image for ray casting, and use ray casting to find the content of the result image.

步骤3.2.4:在GPU内并行处理所有投射的光线,沿光线进行重采样,对采样结果进行合成,并根据设定的颜色传递函数与透明度传递函数计算每一像素点的颜色和不透明度,即得到每一像素点的光线投射显示结果,具体步骤如下:Step 3.2.4: Process all projected rays in parallel in the GPU, resample along the rays, synthesize the sampling results, and calculate the color and opacity of each pixel according to the set color transfer function and transparency transfer function, That is, the ray projection display result of each pixel is obtained, and the specific steps are as follows:

步骤3.2.4.1:对于一条投射光线L,获取其在数据场入射点P1(x2,y2, z2) 的投影坐标和出射点P2(x1, y1, z1)的投影坐标,则投射光线L可表示为:Step 3.2.4.1: For a projection ray L, obtain its projected coordinates of the incident point P1(x2 ,y2 , z2 ) and the projected coordinates of the outgoing point P2(x1 , y1 , z1 ) in the data field, Then the projection ray L can be expressed as:

L = P2(x2, y2, z2) – P1(x1, y1, z1)L = P2 (x2 , y2 , z2 ) – P1 (x1 , y1 , z1 )

步骤3.2.4.2:设定采样间隔delta=0.05,即在投射光线L进入数据场后每间隔delta距离采样一次;Step 3.2.4.2: Set the sampling interval delta=0.05, that is, after the projected light L enters the data field, it is sampled once at every delta distance;

步骤3.2.4.3:对于一采样点P,将其投影坐标β转换为模型局部坐标α,公式如下:Step 3.2.4.3: For a sampling point P, transform its projection coordinate β into the model local coordinate α, the formula is as follows:

α = V-1·Proj-1·βα = V-1 · Proj-1 · β

其中V为模型-视图矩阵,Proj为投影矩阵,均通过访问GPU获取,β的x、y坐标与P1相同,β的z坐标计算公式如下:Among them, V is the model-view matrix, and Proj is the projection matrix, both of which are obtained by accessing the GPU. The x and y coordinates of β are the same as those of P1 , and the calculation formula of the z coordinate of β is as follows:

z = z+ delta·(n-1)z = z1 + delta (n-1)

其中n表示采样点P是投射光线L上的第n个采样点;Where n indicates that the sampling point P is the nth sampling point on the projected light L;

步骤3.2.4.4:对采样点P的模型局部坐标α在数据场中进行三维纹理查找,得到P点灰度值G;Step 3.2.4.4: Perform a three-dimensional texture search on the model local coordinate α of the sampling point P in the data field to obtain the gray value G of point P;

步骤3.2.4.5:对G在颜色传递函数与透明度传递函数中分别进行一维纹理查找,得到P点的颜色C与透明度A;Step 3.2.4.5: Perform a one-dimensional texture search on G in the color transfer function and transparency transfer function to obtain the color C and transparency A of point P;

步骤3.2.4.6:对A进行不透明度修正,消除采样点过密可能导致的过采样现象,不透明度修正的公式如下:Step 3.2.4.6: Correct the opacity of A to eliminate the oversampling phenomenon that may be caused by too dense sampling points. The formula for opacity correction is as follows:

A’ = 1 - (1 - A)delta·NA' = 1 - (1 - A)delta N

其中A’为修正后的透明度,N为人工设定的过采样因子,本实施方式中,设N=2;Wherein A' is the transparency after correction, and N is an oversampling factor set manually. In this embodiment, set N=2;

步骤3.2.4.7:根据Phone光照模型求采样点P的最终颜色I,公式如下:Step 3.2.4.7: Calculate the final color I of the sampling point P according to the Phone lighting model, the formula is as follows:

II==kkddIIaa++kkddIIll((NN&CenterDot;&CenterDot;LL00))++kksthe sIIll((VV&CenterDot;&Center Dot;RR))nnosthe s

其中kd为材质对环境的反射系数,ks为材质的镜面反射系数,在本实施方式中,kd与ks均为C,N表示P点单位法向量,L0表示从屏幕上对应像素指向光源的单位向量,V表示P点到虚拟视点的观察方向,R代表反射光线的方向,Ia与Il分别表示环境光强度与光源强度,均为人工设定,Ia取0.15,Il取1.0,ns表示高光指数,ns=0.5;Where kd is the reflection coefficient of the material to the environment, and ks is the specular reflection coefficient of the material. In this embodiment, both kd and ks are C, N represents the unit normal vector of point P, and L0 represents the corresponding The pixel points to the unit vector of the light source, V represents the observation direction from point P to the virtual viewpoint, R represents the direction of reflected light, Ia and Il represent the ambient light intensity and light source intensity respectively, both of which are artificially set, and Ia takes 0.15, Il is set to 1.0, ns represents the specular index, ns =0.5;

步骤3.2.4.8:对投射光线L上所有采样点的颜色求平均颜色作为在结果图像中对应像素显示的颜色Cxy,修正后的透明度求和得到对应像素的透明度AxyStep 3.2.4.8: Calculate the average color of all sampling points on the projected light L as the color Cxy displayed by the corresponding pixel in the resulting image, and sum the corrected transparency to obtain the transparency Axy of the corresponding pixel.

对第一组、第二组腹部CT图像进行光线投射后,任意两个角度的光线投射结果图像如图6所示。After light projection is performed on the first and second sets of abdominal CT images, the resulting images of light projection from any two angles are shown in FIG. 6 .

步骤3.2.5:所有光线投射显示结果的集合构成腹部CT图像光线投射结果图像。Step 3.2.5: The collection of all ray-casting display results constitutes the ray-casting result image of the abdominal CT image.

传统的基于CPU的光线投射流程如图2所示,基于CPU的光线投射需要循环多次,时间成本高,而本实施方式的基于GPU的光线投射可以直接得出投射结果。The traditional CPU-based ray projection process is shown in FIG. 2 . The CPU-based ray projection needs to be cycled multiple times, and the time cost is high. However, the GPU-based ray projection in this embodiment can directly obtain the projection result.

步骤3.3:对体数据进行任意平面切割,将非感兴趣区域从体数据中切除,对切割后的体数据进行光线投射,得到切割后体数据的光线投射结果图像,具体步骤如下:Step 3.3: Carry out arbitrary plane cutting on the volume data, cut off the non-interest region from the volume data, perform ray projection on the cut volume data, and obtain the ray projection result image of the cut volume data, the specific steps are as follows:

步骤3.3.1:用户在体数据上选定四个点,以确定切割平面,切割平面方程表示如下:Step 3.3.1: The user selects four points on the volume data to determine the cutting plane, and the cutting plane equation is expressed as follows:

Ax + By + Cz + D = 0Ax + By + Cz + D = 0

其中,A、B、C、D均为系数,根据四个点的坐标求解切割平面方程组得到;Among them, A, B, C, and D are coefficients, which are obtained by solving the cutting plane equation group according to the coordinates of the four points;

步骤3.3.2:将体数据中位于切割平面外的像素点灰度值设为0,即将非感兴趣区域从体数据中切除;Step 3.3.2: Set the gray value of the pixels outside the cutting plane in the volume data to 0, that is, cut off the non-interest region from the volume data;

步骤3.3.3: 从人在计算机内的虚拟视点经由腹部CT图像中每一像素点向体数据中发射虚拟光线,计算每一像素点的光线投射显示结果,所有像素点光线投射显示结果的集合构成切割后体数据的光线投射结果图像。Step 3.3.3: From the virtual viewpoint of the person in the computer, a virtual ray is emitted to the volume data through each pixel in the abdominal CT image, and the ray projection display result of each pixel is calculated, and the collection of all pixel ray projection display results The resulting image of the raycast that constitutes the sliced volume data.

对第一组腹部CT图像进行体数据切割的结果如图7所示,分别进行了如图7(a)所示的冠状面切割、如图7(b)所示的横断面切割、如图7 (c)所示的矢状面切割以及图7(d)、(e)、(f)所示的任意平面切割。The results of volume data cutting of the first group of abdominal CT images are shown in Figure 7. The coronal cutting shown in Figure 7(a) and the cross-sectional cutting shown in Figure 7(b) were performed respectively, as shown in Figure 7. Sagittal cuts shown in 7 (c) and arbitrary planar cuts shown in Figures 7 (d), (e), and (f).

步骤3.4:若需要同时显示多个体数据,则进行多体素光线投射,将不同体数据的光线投射结果图像合成至同一结果图像内作为三维可视化处理的结果图像,否则直接将切割后体数据的光线投射结果图像作为三维可视化处理的结果图像;Step 3.4: If it is necessary to display multiple volume data at the same time, multi-voxel ray projection is performed, and the ray projection result images of different volume data are synthesized into the same result image as the result image of 3D visualization processing; otherwise, the cut volume data is directly The ray casting result image is used as the result image of the 3D visualization process;

进行多体素光线投射,将不同体数据的结果合成至同一结果图像内,具体方法如下:Perform multi-voxel ray casting to combine the results of different volume data into the same result image. The specific method is as follows:

将多个体数据置于同一空间,对于多个体数据的未重合区域,多体素光线投射的结果图像与腹部CT图像光线投射的结果图像一致;对于多个体数据的重合区域,设定权重因子ω为0.5,多个体数据的重合区域结果图像I计算公式如下:Put multiple volume data in the same space, for the non-overlapping area of multiple volume data, the result image of multi-voxel ray projection is consistent with the result image of abdominal CT image ray projection; for the overlapping area of multiple volume data, set the weight factor ω is 0.5, the calculation formula of the result image I of the overlapping area of multiple volume data is as follows:

I = ω·I1 + (1 – ω·α1)·I2I = ω·I1 + (1 – ω·α1 )·I2

其中,I1与I2分别表示两个重合的体数据的光线投射结果图像,α1表示第一幅图像中的不透明度,如果重合区域包含两个以上体数据,则先求两个重合体数据的结果,将得到的结果再与第三个体数据进行计算,以此类推。Among them, I1 and I2 respectively represent the ray-casting result images of two overlapping volume data, α1 represents the opacity in the first image, if the overlapping area contains more than two volume data, first find the two overlapping volumes The result of the data, calculate the result with the third individual data, and so on.

对第一组、第四组、第五组腹部CT图像进行多体素光线投射,结果图像如图8所示,其中A表示肝脏,即第一组腹部CT图像结果,B表示脾脏,即第四组腹部CT图像结果,C表示胆囊,即第五组腹部CT图像结果。Multi-voxel ray projection is performed on the abdominal CT images of the first group, the fourth group, and the fifth group, and the resulting images are shown in Fig. Four groups of abdominal CT image results, C represents the gallbladder, which is the fifth group of abdominal CT image results.

在本实施例中,步骤3.3和步骤3.4均为可选步骤,当用户不需要切割体数据时则无需执行步骤3.3,同样地,当用户不需要同时显示多个体数据则无需执行步骤3.4。In this embodiment, step 3.3 and step 3.4 are both optional steps. When the user does not need to cut volume data, step 3.3 does not need to be performed. Similarly, when the user does not need to display multiple volume data at the same time, step 3.4 does not need to be performed.

步骤4:将腹部CT图像的三维可视化处理的结果图像在装有独立GPU的计算机屏幕上显示。Step 4: The resultant image of the three-dimensional visualization processing of the abdominal CT image is displayed on a computer screen equipped with an independent GPU.

Claims (1)

Translated fromChinese
1.一种基于GPU的腹部脏器三维可视化的方法,包括以下步骤:1. A method for three-dimensional visualization of abdominal organs based on GPU, comprising the following steps:步骤1:计算机X射线断层扫描设备对人体腹部进行CT扫描;Step 1: Computer X-ray tomography equipment performs a CT scan on the abdomen of the human body;步骤2:获取腹部CT图像,每组腹部CT图像包含若干张腹部断层扫描图像;Step 2: Obtain abdominal CT images, each group of abdominal CT images includes several abdominal tomographic images;步骤3:对获取的腹部CT图像进行三维可视化处理,得到三维可视化处理的结果图像;Step 3: performing three-dimensional visualization processing on the acquired abdominal CT image to obtain a result image of the three-dimensional visualization processing;步骤3.1:对腹部CT图像进行对应点匹配插值,在每相邻前后两张腹部断层扫描图像间得到新插值图像,由新插值图像与原腹部CT图像得到匹配插值后的腹部CT图像即体数据;Step 3.1: Perform corresponding point matching interpolation on the abdominal CT image, and obtain a new interpolation image between each adjacent two abdominal tomographic images, and obtain the abdominal CT image after matching interpolation from the new interpolation image and the original abdominal CT image, that is, the volume data ;步骤3.2:从人在计算机内的虚拟视点经由光线投射初始空白图像中每一像素点向体数据中发射虚拟光线,进行光线投射,计算每一像素点的光线投射显示结果,所有像素点光线投射显示结果的集合构成腹部CT图像光线投射结果图像;Step 3.2: From the virtual viewpoint of the person in the computer, project each pixel in the initial blank image to the volume data through ray projection, perform ray projection, calculate the ray projection display result of each pixel, and ray projection of all pixels The collection of displayed results constitutes a ray-casting result image of an abdominal CT image;步骤3.2.1:将体数据作为三维纹理加载至GPU的缓存中;Step 3.2.1: Load the volume data as a three-dimensional texture into the cache of the GPU;步骤3.2.2:设定颜色传递函数与透明度传递函数,并将这两个传递函数作为一维纹理分别加载至GPU的缓存中;Step 3.2.2: Set the color transfer function and the transparency transfer function, and load these two transfer functions as one-dimensional textures into the cache of the GPU;步骤3.2.3:从人在计算机内的虚拟视点经由光线投射初始空白图像中每一像素点向体数据中发射虚拟光线,进行光线投射;Step 3.2.3: From the virtual point of view of the person in the computer, project each pixel in the initial blank image to the volume data through ray projection, and perform ray projection;步骤3.2.4:在GPU内并行处理所有投射的光线,沿光线进行重采样,对采样结果进行合成,并根据设定的颜色传递函数与透明度传递函数计算每一像素点的颜色和不透明度,即得到每一像素点的光线投射显示结果;Step 3.2.4: Process all projected rays in parallel in the GPU, resample along the rays, synthesize the sampling results, and calculate the color and opacity of each pixel according to the set color transfer function and transparency transfer function, That is, the ray projection display result of each pixel is obtained;步骤3.2.5:所有光线投射显示结果的集合构成腹部CT图像光线投射结果图像;Step 3.2.5: The collection of all ray-casting display results constitutes the abdominal CT image ray-casting result image;步骤3.3:对体数据进行任意平面切割,将非感兴趣区域从体数据中切除,对切割后的体数据进行光线投射,得到切割后体数据的光线投射结果图像;Step 3.3: Carry out arbitrary plane cutting on the volume data, cut off the non-interest region from the volume data, perform ray projection on the cut volume data, and obtain the ray projection result image of the cut volume data;步骤3.4:若需要同时显示多个体数据,则进行多体素光线投射,将不同体数据的光线投射结果图像合成至同一结果图像内作为三维可视化处理的结果图像,否则直接将切割后体数据的光线投射结果图像作为三维可视化处理的结果图像;Step 3.4: If it is necessary to display multiple volume data at the same time, multi-voxel ray projection is performed, and the ray projection result images of different volume data are synthesized into the same result image as the result image of 3D visualization processing; otherwise, the cut volume data is directly The ray casting result image is used as the result image of the 3D visualization process;步骤4:将腹部CT图像的三维可视化处理的结果图像在装有独立GPU的计算机屏幕上显示;Step 4: display the result image of the three-dimensional visualization processing of the abdominal CT image on a computer screen equipped with an independent GPU;    其特征在于:所述步骤3.2.4在GPU内并行处理所有投射的光线,沿光线进行重采样,对采样结果进行合成,并根据设定的颜色传递函数与透明度传递函数计算每一像素点的颜色和不透明度,即得到每一像素点的光线投射显示结果,具体步骤如下:It is characterized in that: the step 3.2.4 processes all projected rays in parallel in the GPU, resamples along the rays, synthesizes the sampling results, and calculates the color of each pixel according to the set color transfer function and transparency transfer function. Color and opacity, that is, to get the raycasting display result of each pixel, the specific steps are as follows:    步骤3.2.4.1:对于一条投射光线L,获取其在数据场入射点的投影坐标和出射点的投影坐标;  Step 3.2.4.1: For a projection ray L, obtain its projection coordinates of the incident point and the projection coordinates of the exit point in the data field;步骤3.2.4.2:设定采样间隔,即在投射光线L进入数据场后每间隔采样间隔距离采样一次;Step 3.2.4.2: Set the sampling interval, that is, after the projected light L enters the data field, it is sampled once at each sampling interval distance;步骤3.2.4.3:对于一采样点P,将其投影坐标β转换为模型局部坐标α;Step 3.2.4.3: For a sampling point P, transform its projection coordinate β into the model local coordinate α;步骤3.2.4.4:对采样点P的模型局部坐标α在数据场中进行三维纹理查找,得到P点灰度值;Step 3.2.4.4: Perform a three-dimensional texture search on the model local coordinate α of the sampling point P in the data field to obtain the gray value of point P;步骤3.2.4.5:对P点灰度值在颜色传递函数与透明度传递函数中分别进行一维纹理查找,得到P点的颜色与透明度;Step 3.2.4.5: Perform one-dimensional texture search for the gray value of point P in the color transfer function and transparency transfer function respectively, and obtain the color and transparency of point P;步骤3.2.4.6:对透明度进行不透明度修正,消除采样点过密可能导致的过采样现象;Step 3.2.4.6: Perform opacity correction on the transparency to eliminate oversampling phenomenon that may be caused by too dense sampling points;步骤3.2.4.7:根据Phone光照模型求采样点P的最终颜色I;Step 3.2.4.7: Calculate the final color I of the sampling point P according to the Phone lighting model;步骤3.2.4.8:对投射光线L上所有采样点的颜色求平均颜色作为在结果图像中对应像素显示的颜色,修正后的透明度求和得到对应像素的透明度。Step 3.2.4.8: Calculate the average color of the colors of all sampling points on the projected light L as the color displayed by the corresponding pixel in the result image, and sum the corrected transparency to obtain the transparency of the corresponding pixel.
CN201310015075.2A2013-01-162013-01-16A kind of abdominal organs three-dimensional visualization method based on GPUActiveCN103106685B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201310015075.2ACN103106685B (en)2013-01-162013-01-16A kind of abdominal organs three-dimensional visualization method based on GPU

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201310015075.2ACN103106685B (en)2013-01-162013-01-16A kind of abdominal organs three-dimensional visualization method based on GPU

Publications (2)

Publication NumberPublication Date
CN103106685A CN103106685A (en)2013-05-15
CN103106685Btrue CN103106685B (en)2015-08-12

Family

ID=48314510

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201310015075.2AActiveCN103106685B (en)2013-01-162013-01-16A kind of abdominal organs three-dimensional visualization method based on GPU

Country Status (1)

CountryLink
CN (1)CN103106685B (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103455970A (en)*2013-08-302013-12-18天津市测绘院Method for accelerated display of invisible part by three-dimensional digital urban system model
CN104599311A (en)*2013-10-312015-05-06镇江华扬信息科技有限公司GPU (Graphics Processing Unit)-based hybrid visual system of three-dimensional medical image
CN104658028B (en)*2013-11-182019-01-22清华大学 Method and apparatus for rapidly marking objects in three-dimensional images
CN104318057A (en)*2014-09-252015-01-28新乡医学院第一附属医院Medical image three-dimensional visualization system
CN104992444B (en)*2015-07-142018-09-21山东易创电子有限公司A kind of cutting method and system of human body layer data
CN106530382A (en)*2016-12-092017-03-22江西中科九峰智慧医疗科技有限公司Data processing method and system for medical three-dimensional image
CN107146262B (en)*2017-04-182021-01-26广州广华深启科技有限责任公司Three-dimensional visualization method and system for OCT (optical coherence tomography) image
CN107292865B (en)*2017-05-162021-01-26哈尔滨医科大学Three-dimensional display method based on two-dimensional image processing
CN108492299B (en)*2018-03-062022-09-16天津天堰科技股份有限公司Cutting method of three-dimensional image
CN109377549A (en)*2018-09-292019-02-22浙江工业大学 A real-time processing and 3D visualization method of OCT fingertip data
CN109767468B (en)*2019-01-162021-04-20上海长征医院Visceral volume detection method and device
CN113347407A (en)*2021-05-212021-09-03华中科技大学Medical image display system based on naked eye 3D

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN1776747A (en)*2005-11-242006-05-24上海交通大学 Volume Rendering Method Based on GPU Hardware Acceleration in Medical Image
CN101794460A (en)*2010-03-092010-08-04哈尔滨工业大学Method for visualizing three-dimensional anatomical tissue structure model of human heart based on ray cast volume rendering algorithm

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN1776747A (en)*2005-11-242006-05-24上海交通大学 Volume Rendering Method Based on GPU Hardware Acceleration in Medical Image
CN101794460A (en)*2010-03-092010-08-04哈尔滨工业大学Method for visualizing three-dimensional anatomical tissue structure model of human heart based on ray cast volume rendering algorithm

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
医学CT图像的三维分割与可视化研究;张海波;《中国优秀硕士学位论文全文数据库信息科技辑》;20051115(第8期);第13-16页*
医学断层图像插值重建算法的研究;朱杨兴;《中国优秀硕士学位论文全文数据库医学卫生科技辑》;20070415(第4期);第23-25页*
基于GPU的医学图像三维可视化技术研究;卜祥磊;《中国优秀硕士学位论文全文数据库信息科技辑》;20100115(第1期);第29-33页*
基于GPU的器官体数据光线投射算法研究;康健超;《中国优秀硕士学位论文全文数据库信息科技辑》;20110815(第8期);第37-44页*
自适应光线投射直接体绘制算法及实现;金朝阳 等;《中国医学影像技术》;20050430;第21卷(第4期);第634-638页*

Also Published As

Publication numberPublication date
CN103106685A (en)2013-05-15

Similar Documents

PublicationPublication DateTitle
CN103106685B (en)A kind of abdominal organs three-dimensional visualization method based on GPU
Kutter et al.Visualization and GPU-accelerated simulation of medical ultrasound from CT images
Zhang et al.Volume visualization: a technical overview with a focus on medical applications
US4737921A (en)Three dimensional medical image display system
CN100498839C (en)Multi-modality medical data three-dimensional visualization method
US20090322748A1 (en)Methods,systems, and computer program products for GPU-based point radiation for interactive volume sculpting and segmentation
CN103077557B (en)The implementation method that a kind of adaptive layered time big data of chest show
CN103971396A (en)OpenGL ES (open graphics library for embedded system) implementation method for ray casting algorithm under ARM+GPU (advanced RISC machine+graphic processing unit) heterogeneous architecture
Kumar et al.3D reconstruction of face from 2D CT scan images
US20230360314A1 (en)Technique for real-time rendering of medical images using virtual spherical light sources
Zhang et al.Dynamic real-time 4D cardiac MDCT image display using GPU-accelerated volume rendering
Brecheisen et al.Flexible GPU-based multi-volume ray-casting.
Tan et al.Design of 3D visualization system based on VTK utilizing marching cubes and ray casting algorithm
CN103679795B (en)The layer of volume data is shown
CN103745495A (en)Medical volume data based volume rendering method
de Moraes et al.Medical vlume rendering based on gradient information
Adeshina et al.Locating abnormalities in brain blood vessels using parallel computing architecture
Kwon et al.GPU-accelerated 3D mipmap for real-time visualization of ultrasound volume data
WangThree-dimensional medical CT image reconstruction
Solteszova et al.Visibility-Driven Processing of Streaming Volume Data.
Kiss et al.GPU volume rendering in 3D echocardiography: real-time pre-processing and ray-casting
Zhang et al.Real-time dynamic display of registered 4D cardiac MR and ultrasound images using a GPU
Ghobadi et al.Ray casting based volume rendering of medical images
CN101996419A (en)Three-dimensional reconstruction method of ultrasound image and system thereof
Al-Ani et al.3D visualization based on surface estimation techniques

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
C14Grant of patent or utility model
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp