Fast ray-tracing of rectilinear volume data

Abstract

Tomographic devices often produce data with directionally and spatially dependent resolution. Resampling to cubic voxels is possible at the cost of a significant increase of data volume and rendering time. We present an algorithm for direct ray tracing of rectilinear grids, which enables the implementation of surface rendering with subvoxelsurface detection based on local interpolation, as well as different volume rendering techniques (color compositing, reprojection, maximum intensity projection). Further we presenta faster version of the basic algorithm, based on cubic macro-regions assigned to each background voxel. Each macro-region is defined by its chessboard distance to the nearest foreground voxel and can be skipped during the scene traversal. The speed-up is thus gained by increasing the step along the ray, maintaining 6-connectivity of the ray in the object vicinity, which is necessary for correct surface detection. 1 Volume visualization by ray tracing Ray tracing is now common in the field of computer graphics, and the technique has also gained popularity in volumetric visualization. This is due to its ability to enhance spatial perception of the scene using such effects as transparency, mirroring and shadow casting. Correct understanding of the nature of the processed data further necessitates usage of various visualization techniques. In the framework of its basic scheme, ray tracing enables the implementation of various surface as well as volume rendering techniques (color compositing, reprojection, MIP), which makes it an ideal tool for data exploration. The term surface rendering denotes a set of 3D data visualization techniques where only object surfaces contribute to the rendered image. One possibility is to build a surface model, i.e., to define a set of patches approximating the surface. These patches can then be rendered by some standard technique, usually with a hardware support. The binary volume rendering techniques represent an alternative. Although the image is still only contributed to by surfaces, no explicit surface model is defined. Instead, a trivariate implicit function F = F(P; P ) is given, depending on voxel position P and data samples in some neighborhood P . A continuous surface description can be then obtained by thresholding this function at some level T . In order for there to be a possibility to specify various surface properties (color, reflectivity etc.) for different objects, an object identifier can be assigned to a voxel, either directly during the scan conversion of an analytical object description or as a result of segmentation in the case of scanned data. Voxels with no identifier assigned belong to background and can be ignored during the processing, since they do not contribute to the rendered image. Due to the fact that the scene is defined within a 3D discrete raster, the ray should be represented as a discrete ray, i.e., as an ordered sequence of voxels pierced by the ray, with the following properties: 1. to enable supersampling and recursivity, the ray should be able to start at any point outside of the scene, or inside, and with arbitrary direction and 2. to get correct images, no object voxels along the ray should be missed. Therefore, the ray should, at least in the vicinity of an object, fulfill the demands of 6-connectivity[1]. Traversal of the ray voxels usually has more phases. Background voxels, surrounding the objects, are usually found first. Their traversal stops either when the ray leaves the scene or when the first object voxel is found. In the second case a hit-miss test should be performed in order to know if the ray should continue further by the following object or background voxel, or if a ray-surface intersection should be searched for. The hit-miss test can be performed by evaluation of the interpolating functionF at one or more points lying in the voxel and comparing the results with the threshold value. In order to detect the ray-surface intersection point exactly, a system of equations defined by the ray and the surface F(P; ) = T ) should be solved either analytically or numerically[2]. The probabilistic volume rendering techniques represent an alternative to the surface approaches. Rather than segmenting the scene into objects and background, an opacity and color are assigned to each voxel, based on local properties of the data. The opacity reflects a measure by which the given voxel can contribute to the rendered image. A culling function can be defined, identifying the voxels which cannot contribute to the rendition and which can be discarded from consideration, alike to the background voxels in the surface rendering. Among others, techniques tracing primary rays (ray casting) through the scene were proposed, accumulating color and opacity of voxels or data samples obtained by interpolation along the ray. We can see that visualization of volumetric data by ray tracing is a task which is algorithmically similar to standard ray tracing of analytical objects, if some space subdivision speed up method is used. In this case the object space is subdivided, either hierarchically or uniformly, again into voxels, which can be empty or can contain a list of contributingobjects. The primary goal of the subdivision is to limit the number of ray-object intersection tests, which are themselves costly operations, by only performing tests with objects belonging to voxels pierced by a ray. Ray traversal algorithms designed for the subdivision speed up techniques can therefore also be also for ray tracing volumetric data. However, one difference still exists, namely the voxel scene size. While the optimal subdivision rate for the speed up techniques was found to be low (only hundreds of voxels[3]), data sets which are orders of magnitude larger are processed in visualization tasks. Therefore applicability of these algorithms is only moderate and special techniques for ray tracing volumetric data were developed. 2 Macro-region based voxel traversal algorithms Not all voxels along the ray contribute to the rendered image with the same weight. Only some of them belong to the interesting objects or surfaces, while the others can be traversed rapidly or even totally skipped. This capability is called space-leaping[4] and exploits some kind of coherence inherent to the object and/or image space as well as to a sequence of consecutive images. The macro-region based voxel traversal algorithms exploit the object space coherence, i.e., the tendency of object (background) voxels to occupy connected regions of the space. In this case, background voxels are gathered into cubic, parallelepipedal or spherical macro-regions, which can be skipped in one step thus reducing the number of steps and therefore also the total rendering time. Various schemes for the macro-region definition are possible. Some of them are based on hierarchical encoding of the scene space, others define the macro-regions directly in the original voxel scene. 2.1 Distance based speed up techniques Distance transforms convert a 2D (3D) binary image into an image, where each background pixel (voxel) is assigned a value corresponding to its distance to the nearest object pixel (voxel). Although computing the distances is in principle a global operation, algorithms were developed for approximating the global distances by propagating distances between neighboring pixels[5]. The idea to exploit the distance transforms to speed up the background traversal was introduced by Zuiderveld et al.[6]. The proposed Ray Acceleration by Distance Coding (RADC) scheme works in two phases: Preprocessing: The volume is segmented and the distance information is added to background voxels by a 3D distance transform. Rendering: The floating point 3D DDA algorithm defining the ray as a sequence of equidistant samples is used, exploitingthe distance information for skippingempty regions. Since objects in volumetric data sets tend to be centered in the middle of the volume, rays usually skip rapidly the off-center parts and slow down until they hit an object. For parallel projection, if the ray totally misses the object, the minimal distance along its path can be utilized for further speed up. In such a case, this distance defines a region in the image plane, where it is not necessary to fire new rays, because they all miss the object. The RADC algorithm works with various digital approximations of the ideal Euclidean distance. Since different shapes of thus defined free regions were not taken into account, highest speed has been obtained with the chamfer distance, which is the best approximation of the Euclidean distance. A similar technique was proposed by Cohen and Sheffer[7]. The authors call the free zones defined by the distance transform proximity clouds. Once a ray enters a cloud cell, it can safely skip the distance determined by the cell’s value. The algorithm is also based on the floating point 3D DDA algorithm and it differs from the RADC in that it takes the shape of the free zone into account: the step size depends not only on the distance value, but also on the kind of the distance and the ray direction. If the ray is defined by its direction vector ~r = (rx; ry; rz) and the assigned distance is d then the coordinate increment should be d px D(~r) ; d py D(~r) ; d pz D(~r) (1) where D(~r) is size of the projection vector in the corresponding metrics (Euclidean metrics is used in the case of chamfer distance): D(~r) = 8>><>: jpxj+ jpyj+ jpzj for the city block distance q(p2x + p2y + p2z) for the Euclidean distance max(jpxj; jpyj; jpzj) for the chessboard distance. (2) Authors have shown that the average step for the city block distance can even be a few percent longer than for the Euclidean distance. Another advantage of the city block distance is that its computation is easier than computation of the chamfer distance, which is usually used instead of the Euclidean distance. The proposed technique has two drawbacks: 1. The distances are calculated for the cell centers, while the current location along the ray is not necessarily in the center. Therefore, to avoid skips beyond the free zone, the computed distance d is decreased by 1. 2. The sequence of cells generated by the floating point 3D DDA algorithm does not fulfill the condition of 6-connectivity, which may cause some of the object voxels to be missed. Therefore, in the object’s vicinity, the algorithm is switched to the incremental cell traversal algorithm[3] generating the 6-connected sequence. A different method, the CD voxel traversal algorithm[2], relies exclusively on cubic macro-regions defined by the chessboard distance (CD). In this case, the ray is defined as a sequence of nonuniform samples at its intersections with the macro-region walls. This precision allows the utilization of the full size of the macro-region and overcomes the first drawback of the previous “proximity clouds” technique. In the close vicinity of an object, where CD equals zero, the macro-regions are identical to single voxels. Since the samples lie on their faces, a 6-connected sequence of voxels is defined, overcoming the second drawback. The algorithm has two control variables: faceType (face isX type if it is perpendicular to the x axis) and relative position P = (px; py; pz) of the sample with respect to the voxel vertex. Its main loop is based on the following observation: for each ray direction and each assigned CD there is some threshold txy(n) (assuming X is the actual face type and n is the assigned CD) of the px coordinate. If px < txy , then the macro-region exit face is alsoX type, otherwise it is Y type. The algorithmtherefore distinguishesbetween two step types, those with equal and those with different entry and exit face types. The fact that the sample coordinate is maintained during the traversal can speed up detection of the ray-surface intersection point[8]. 3 Traversal of rectilinear grids by cubic macro-regions In the previous section we described algorithms speeding up a binary scene traversal by exploiting distance information, assigned to each background voxel. Their common feature was that they assumed cubic voxels. In this section we introduce an algorithm which speeds up the traversal of scenes defined by a rectilinear grid. It is similar to the CD algorithm described above, in that it is also based on cubic macro-regions. However, in this case we assign the distances to background voxels of a secondary scene with cubic voxels and the same dimensions. Thus, parallelepipedal empty regions are defined in the original scene. The exact voxel dimensions are taken into account during the traversal. Let G be a 3D grid of (Nx + 1) (Ny + 1) (Nz + 1) points pijk: G = fpijk = (Si x; Sj y; Sk z ) : 0 i Nx; 0 j Ny; 0 k Nzg; (3) where i, j and k are integers, Sm = m Xi=1 i 1 ; = x; y or z (4) are sample coordinates (S0 = 0) and 0x; 1x; : : : ; Nx x , 0y; 1x; : : : ; Ny y and 0z; 1z; : : : ; Nz z is the spacing between samples along each coordinate axis. Let a voxel be a tuple Vijk = (vijk; hijk), where vijk = (Si x; Si+1 x ) (Sj y ; Sj+1 y ) (Sk z ; Sk+1 z ) is voxel volume and hijk 2 f0; 1g is its value. Grid points pijk are defined in voxel vertices, and therefore the voxel scene V: V = fVijk : 0 i < Nx; 0 j < Ny; 0 k < Nzg; (5) has one element less along each axis than G. The voxel value h = 1means that the voxel can contribute to the image: either an object surface passes through its volume (binary volume rendering) or it can contribute with nonzero color and opacity in probabilistic volume rendering. The value h = 0 means, that the voxel cannot contribute, and therefore it can be skipped during the traversal without processing. We denote voxels with values equal to 0 (resp. 1) 0-voxels (resp. 1-voxels). Let the secondary voxel scene V0 consist of the same number of unit cubic voxels along each axis and let the corresponding voxels have equal values: h0ijk = hijk (6) If we assign now to each 0-voxelVijk its chessboard distance n to the nearest 1-voxel, we define a cubic macro-region in V0: O0 n(Vijk) = fh0pqr = 0 : i n p i+n; j n q j+n; k n r k+ng (7) with its center in Vijk and with side size 2n+1. A corresponding macro-region is defined in V: On(Vijk) = fhpqr = 0 : Si n x p Si+n x ; Sj n y q Sj+n y ; Sk n z r Sk+n z g; (8)

6 Figures and Tables

Cite this paper

@inproceedings{Srmek1996FastRO, title={Fast ray-tracing of rectilinear volume data}, author={Milos Sr{\'a}mek}, year={1996} }