为克服传统算法中体绘制交互速度不流畅、重建耗时长、绘制效果单一的不足,实现了基于图形处理器(GPU)的光线投射算法用于医学层析图像实时体绘制,并能快速切换不同组织器官的绘制效果。首先,读入医学层析图像到计算机内存,构造体素;然后,设置相应体素属性(如插值方式、着色处理、光照参数)等,设计显示不同组织器官的颜色及不透明度传榆函数;最后,GPU加载体素据并进行光线投射算法的计算。实验结果表明,在绘制速度上,GPU加速光线投射算法实现的多功能体绘制技术的绘制速度能达到每秒40帧以上,完全满足临床应用需求。在绘制质量上,用户交互中由于重采样而产生的锯齿现象明显低于CPU端实现的光线投射算法,GPU端与CPU端绘制时间的加速比在9倍左右。
In order to overcome the rendering drawbacks of traditional algorithms that cannot be interacted fluently with the user and have a big time consumption and single rendering result, a ray casting algorithm based on Graphics Process Unit (GPU) was proposed to be used for the real-time volume rendering of medical tomographic images. Different rendering effects can be switched quickly by the proposed algorithm. Firstly, medical tomographie images were read into the computer memory to construct voxels. Mterwards, properties (interpolating, shading and light) of the corresponding voxels were set. The transfer functions of color and opacity were designed to display different organs and tissues. Finally, the volume data were loaded and the ray casting algorithm was executed by GPU. The experiments show that the rendering speed of the proposed algorithm can reach 40 frames per second, which satisfies the clinical application. On the aspect of rendering quality, jags produced in the process of interaction because of resampling on GPU are apparently lower than the ray casting algorithm on CPU. The time consumption of CPU-based ray casting algorithm is about 9 times that of the proposed algorithm.