# Research on Improved Ray Casting Algorithm and Its Application in Three-Dimensional Reconstruction

Authors: ZheShu Jia; DeYun Chen; Bo Wang
Journal: Shock and Vibration
 (2021)

---

## Abstract

Spinal pathology treatment has become an urgent issue to be solved. How to effectively prevent and treat spinal pathology has become a research hotspot in the field of surgery. Aiming at the problem of too long volume rendering time caused by the trilinear interpolation sampling method in the reconstruction and visualization of the vertebra 3D model, an improved ray projection algorithm is proposed to quickly reconstruct a 3D vertebra model from medical CT vertebra images. This method first classifies CT data, assigns corresponding color values and opacity transfer functions to different types of data, and then uses inverse distance-weighted interpolation (IDWI) sampling to replace the trilinear interpolation sampling method for the voxel where the sampling point is located to accelerate the interpolation operation. The color value and opacity of the sampling points are obtained, and finally, the attributes of all the sampling points are synthesized and calculated to obtain the final rendering effect, and the reconstruction of the three-dimensional vertebra model is completed. Experimental results show that the proposed method not only can obtain higher quality rendered images but also has a certain improvement in rendering speed compared with traditional algorithms.


---

## Body

## 1. Introduction

Nowadays, spine-related diseases are a major problem in modern human society. Modern clinical medicine points out that spinal pathology has become an urgent problem to be solved. Pedicle screw placement is a relatively mature medical method for spinal pathology, and three-dimensional reconstruction of vertebrae is the premise of preoperative simulation and quantification. The three-dimensional vertebral model obtained by medical image visualization can provide more realistic anatomical structure for doctors, so as to help doctors accurately diagnose the disease and design treatment plan, which has important clinical practical value.Medical image visualization [1] is the human body information obtained by digital imaging technology that is intuitively expressed as three-dimensional effect on the computer, so as to provide structural information that cannot be obtained by traditional means. Volume rendering has become an important method to realize the visualization of medical images because it can show the fine structure and small transformation of objects. As a classical method of volume rendering technology, ray casting algorithm has a wide range of applications in the field of 3D reconstruction visualization of medical images, but its rendering speed is slightly insufficient [2]. At present, the common methods to improve the rendering speed can be roughly divided into three types: hardware-based, software-based, and parallel mode [3]. Among them, the premise of hardware-based and parallel methods is to carry out on specific computer hardware, so its portability is greatly reduced. The acceleration method based on software type does not rely too much on the development of hardware, but improves from the angle of algorithm, which has high flexibility. However, this kind of method has some problems, such as too high complexity to achieve ideal acceleration effect and not taking into account both rendering speed and reconstruction quality.In order to speed up volume rendering and improve the quality of reconstruction, we proposed a ray casting algorithm based on inverse distance-weighted interpolation sampling to realize the 3D visualization of the vertebral CT image. Firstly, vertebrae and nonvertebrae are distinguished in the 3D volume data field, and the mapping from data to optical features is realized by transfer function. Then, the inverse distance-weighted interpolation method is used to replace the trilinear interpolation in the traditional ray casting algorithm to speed up the resampling process. Finally, the final color of each pixel is obtained by synthesizing the color value and opacity of all the sampling points, and finally, the three-dimensional reconstruction of the vertebral image is realized.


## 2. Related Work

With the development of computer hardware technology, hardware-based and parallel acceleration methods are first proposed. Cullip and Neumann first proposed a method to accelerate volume rendering using 3D texture hardware [4]. Zhang et al. used GPU-based fast ray casting method for volume rendering in CT 3D reconstruction to shorten the reconstruction time [5]. Ross et al. proposed a CPU-based volume rendering algorithm for 3D ultrasound images, which overcomes the difficulty of low adaptability of GPU-based algorithm [6]. Ma et al. proposed a parallel grid generation algorithm on GPU, which increased the average efficiency by 15 times [7]. Zhou et al. used CUDA to accelerate the implementation of ray casting algorithm, which was 70% faster than GPU [8]. Sans et al. compared the performance of OpenGL, OpenCL, and CUDA for different medical datasets [9].However, both hardware-based and parallel-based acceleration methods are based on the premise of computer hardware, so they have some limitations. In contrast, the acceleration method based on software is more flexible and convenient, which can be transplanted between different machines quickly and has wider applicability. Mehaboobathunnisa et al. proposed a method of grouping rays projected by similar voxels to reduce the computational complexity of rendering algorithm, but the reconstruction result is not smooth enough due to artifacts [10]. Hadwiger et al. proposed the SparseLeap method which is a novel space hopping method and has been proved that it can avoid the problem of unnecessary space debris [11]. Based on the idea of spatial jump method, Deakin and Knackstedt used Chebyshev distance to guide how to effectively skip the blank area in the ray casting algorithm [12], and then they optimized this method and proposed an effective algorithm to generate anisotropic Chebyshev distance map for accelerating ray casting, but these two methods have some shortcomings in the final reconstruction effect [13]. Liu et al. reduced the amount of computation in the rendering process by adjusting the sampling frequency and adopting different interpolation strategies for the sampling points of different classification groups [14]. Bi et al. applied inverse distance-weighted interpolation algorithm to meteorological data visualization and achieved good rendering effect [15]. In order to improve the speed of ray casting algorithm, this paper proposes a ray casting algorithm based on inverse distance-weighted interpolation sampling, which improves the speed of volume rendering on the premise of meeting the quality requirements of 3D reconstruction.


## 3. Improved Ray Casting Algorithm

### 3.1. Traditional Ray Casting Algorithm

The basic idea of the traditional ray casting algorithm can be described as follows: firstly, collecting the sample points of all the voxels in the three-dimensional data field along the ray direction at equal intervals and then obtaining the corresponding color values and opacity values of the sample points, then synthesizing the color values and opacity values of all the sample points on the ray to obtain the final color of the pixel, and finally, calculating each pixel and obtaining the final two-dimensional image. The detailed steps are shown in Table1.Table 1
Traditional ray casting algorithm (TRC).
Input:3D volume data fieldDStep 1:Initial color valueC and opacity per pixel αStep 2:For each voxel in volume data field DDo2.1:If current voxel contains sampling points, then2.2:The valueC and α of each sampling point are obtained by trilinear interpolation2.3:End if2.4:End forStep 3:Compositely calculating the value of andC for each pixelOutput:Opacity per pixelα, color value CIn traditional ray casting algorithm, step 1 is to initialize the color valueC and opacity value α. In step 2, all the voxels in the 3D volume data field are traversed, and the sample points are sampled by trilinear interpolation to obtain the color value and opacity value of the sample points. Finally, the color values and opacity values of all sampling points on the ray are combined in step 3 to get the final projection image.


### 3.2. Inverse Distance-Weighted Interpolation Method

Inverse distance-weighted interpolation (IDWI) is a kind of interpolation method which takes the distance between the sampling point and adjacent point as weight. Figure1 shows the schematic diagram of the IDWI method.Figure 1
Inverse distance-weighted interpolation.The IDWI method considers that each adjacent point will have a certain influence on the sampling point, and the influence is closely related to the distance. The closer the sampling point is, the greater the weight is given to the adjacent point, and the weight contribution is inversely proportional to the distance [16].Suppose that there are other neighboring points in the neighborhood of sampling pointA(x, y, z), denoted as Ai(xi, yi, zi), i = 1, 2, …, n. Let f(A) be the color and opacity value of A, then it can be described as follows:(1)fA=∑i=1nλifAi,where λi is the weight of the distance from each adjacent point to the sampling point and can be calculated as follows:(2)λi=1/d∑i=1n1/d,where di is the Euclidean distance between adjacent points and sampling points and can be calculated as follows:(3)di=x−xi2+y−yi2+z−zi2.Obviously, the sum of all weights is 1, that is,(4)∑i=1nλi=1.


### 3.3. Ray Casting Algorithm Based on IDWI Sampling

In order to improve the efficiency of the TRC, an improved ray casting algorithm is proposed in this paper. The basic idea is to use inverse distance-weighted interpolation instead of trilinear interpolation in interpolation sampling. The improved ray casting algorithm includes the following three steps:(1)
Classification of vertebrae and nonvertebrae: in this step, a three-dimensional volume data field is constructed, and a ray is emitted from the position of each pixel on the screen along the line of sight direction into the data field. According to the different characteristics of the data, the vertebral CT data are classified into different types, that is, vertebral and nonvertebral. In order to show the internal structure of 3D data field more intuitively, it is necessary to assign different color values and opacity to different types of data according to the classification results. The setting of color value and opacity needs to design different transfer functions. The function of transfer function is to complete the mapping from data to optical features (color, opacity, etc.). Formally, the transfer functionT can be defined as follows:(5)T:⟶c,α,x∈Rn,wherec,α is a binary set of color values and opacity, x is the attribute values of volume data, and n is the dimension of x and represents the number of attributes.(2)
Achieving the color and opacity values: after separating the region of vertebrae and nonvertebrae, the sample points of all the voxels in the 3D data field which are penetrated by light are collected at equal intervals along the ray direction, and the corresponding color and opacity values of the sample points are calculated according to the attribute values of the eight vertices of the voxels where the sample points are located. The sampling points are above the ray incident from the pixel to the 3D data field, usually in the voxel mesh they pass through, rather than just at the vertex of the voxel mesh. The inverse distance-weighted interpolation method is used to obtain the color value and opacity of the sampling points.(3)
Synthesizing the color values: in this step, the final color of the pixels is obtained by compositing the color values and opacity values of all the sampling points on the ray. In the process of synthesis, we use the front-to-back strategy. The formulas can be described as follows:(6)Cout=Cin+Ci1−Cin,(7)αout=αin+αi1−αin,whereCout and αout are the color values and opacity values after the cast ray passes through the sample point, respectively. Cin and αin are the color values and opacity values before the incident sampling point i, respectively. Ci and αi are the color values and opacity values of the current sampling point i, respectively. After the above iteration, each pixel is calculated to get the final three-dimensional image. The detailed steps are shown in Table 2.Table 2
Ray casting algorithm based on IDWI sampling (RC-IDWIS).
Input:3D volume data fieldDStep 1:Classification of vertebrae and nonvertebrae1.1:Along the line of sight, emitting a ray from the position of each pixel on the screen to enter the 3D volume data fieldD1.2:According to the different characteristics, the images are classified into vertebral and nonvertebral regions1.3:Set the color value and opacity through the transfer function by using formula (5)Step 2:Achieving the color and opacity values2.1:For each voxel in volume data field DDo2.2:If current voxel contains sampling points, then2.3:The valueC and α of each sampling point are obtained by inverse distance-weighted interpolation sampling2.4:End if2.5:End forStep 3:Synthesizing the color value for each pixel3.1:For each pixel Do3.2:Calculate the value ofC and α by using formulas (6) and (7)3.3:End forOutput:Composite 3D image


### 3.4. Stability Analysis

In the process of image rendering using the classical ray casting algorithm, there are two kinds of situations in which the projected ray travels in the 3D volume data field: the ray travels in the empty voxel and the ray travels in the nonempty voxel. For analyzing the whole rendering process from the rendering data source, the calculation of empty voxels has no contribution to the final 3D reconstruction effect presented on the screen. However, if the same undifferentiated interpolation is applied to the empty voxels, the rendering time of the ray casting algorithm will be increased, and the real-time performance of the algorithm will be affected. Therefore, we use the spatial jump technique to skip the empty voxels in the direction of the projection ray and only interpolate the nonempty voxels in the 3D volume data field. For each empty voxel, first record the nearest distance from it to the opaque voxel, and then, no matter what the direction of the ray is, as long as the distance is a forward step, it will not intersect with the opaque voxel in this distance range when the ray is casting. Based on this, it can significantly reduce the redundant steps of ray casting, improve the efficiency of the algorithm, and has obvious advantages in computing resources and memory requirements.


## 3.1. Traditional Ray Casting Algorithm

The basic idea of the traditional ray casting algorithm can be described as follows: firstly, collecting the sample points of all the voxels in the three-dimensional data field along the ray direction at equal intervals and then obtaining the corresponding color values and opacity values of the sample points, then synthesizing the color values and opacity values of all the sample points on the ray to obtain the final color of the pixel, and finally, calculating each pixel and obtaining the final two-dimensional image. The detailed steps are shown in Table1.Table 1
Traditional ray casting algorithm (TRC).
Input:3D volume data fieldDStep 1:Initial color valueC and opacity per pixel αStep 2:For each voxel in volume data field DDo2.1:If current voxel contains sampling points, then2.2:The valueC and α of each sampling point are obtained by trilinear interpolation2.3:End if2.4:End forStep 3:Compositely calculating the value of andC for each pixelOutput:Opacity per pixelα, color value CIn traditional ray casting algorithm, step 1 is to initialize the color valueC and opacity value α. In step 2, all the voxels in the 3D volume data field are traversed, and the sample points are sampled by trilinear interpolation to obtain the color value and opacity value of the sample points. Finally, the color values and opacity values of all sampling points on the ray are combined in step 3 to get the final projection image.


## 3.2. Inverse Distance-Weighted Interpolation Method

Inverse distance-weighted interpolation (IDWI) is a kind of interpolation method which takes the distance between the sampling point and adjacent point as weight. Figure1 shows the schematic diagram of the IDWI method.Figure 1
Inverse distance-weighted interpolation.The IDWI method considers that each adjacent point will have a certain influence on the sampling point, and the influence is closely related to the distance. The closer the sampling point is, the greater the weight is given to the adjacent point, and the weight contribution is inversely proportional to the distance [16].Suppose that there are other neighboring points in the neighborhood of sampling pointA(x, y, z), denoted as Ai(xi, yi, zi), i = 1, 2, …, n. Let f(A) be the color and opacity value of A, then it can be described as follows:(1)fA=∑i=1nλifAi,where λi is the weight of the distance from each adjacent point to the sampling point and can be calculated as follows:(2)λi=1/d∑i=1n1/d,where di is the Euclidean distance between adjacent points and sampling points and can be calculated as follows:(3)di=x−xi2+y−yi2+z−zi2.Obviously, the sum of all weights is 1, that is,(4)∑i=1nλi=1.


## 3.3. Ray Casting Algorithm Based on IDWI Sampling

In order to improve the efficiency of the TRC, an improved ray casting algorithm is proposed in this paper. The basic idea is to use inverse distance-weighted interpolation instead of trilinear interpolation in interpolation sampling. The improved ray casting algorithm includes the following three steps:(1)
Classification of vertebrae and nonvertebrae: in this step, a three-dimensional volume data field is constructed, and a ray is emitted from the position of each pixel on the screen along the line of sight direction into the data field. According to the different characteristics of the data, the vertebral CT data are classified into different types, that is, vertebral and nonvertebral. In order to show the internal structure of 3D data field more intuitively, it is necessary to assign different color values and opacity to different types of data according to the classification results. The setting of color value and opacity needs to design different transfer functions. The function of transfer function is to complete the mapping from data to optical features (color, opacity, etc.). Formally, the transfer functionT can be defined as follows:(5)T:⟶c,α,x∈Rn,wherec,α is a binary set of color values and opacity, x is the attribute values of volume data, and n is the dimension of x and represents the number of attributes.(2)
Achieving the color and opacity values: after separating the region of vertebrae and nonvertebrae, the sample points of all the voxels in the 3D data field which are penetrated by light are collected at equal intervals along the ray direction, and the corresponding color and opacity values of the sample points are calculated according to the attribute values of the eight vertices of the voxels where the sample points are located. The sampling points are above the ray incident from the pixel to the 3D data field, usually in the voxel mesh they pass through, rather than just at the vertex of the voxel mesh. The inverse distance-weighted interpolation method is used to obtain the color value and opacity of the sampling points.(3)
Synthesizing the color values: in this step, the final color of the pixels is obtained by compositing the color values and opacity values of all the sampling points on the ray. In the process of synthesis, we use the front-to-back strategy. The formulas can be described as follows:(6)Cout=Cin+Ci1−Cin,(7)αout=αin+αi1−αin,whereCout and αout are the color values and opacity values after the cast ray passes through the sample point, respectively. Cin and αin are the color values and opacity values before the incident sampling point i, respectively. Ci and αi are the color values and opacity values of the current sampling point i, respectively. After the above iteration, each pixel is calculated to get the final three-dimensional image. The detailed steps are shown in Table 2.Table 2
Ray casting algorithm based on IDWI sampling (RC-IDWIS).
Input:3D volume data fieldDStep 1:Classification of vertebrae and nonvertebrae1.1:Along the line of sight, emitting a ray from the position of each pixel on the screen to enter the 3D volume data fieldD1.2:According to the different characteristics, the images are classified into vertebral and nonvertebral regions1.3:Set the color value and opacity through the transfer function by using formula (5)Step 2:Achieving the color and opacity values2.1:For each voxel in volume data field DDo2.2:If current voxel contains sampling points, then2.3:The valueC and α of each sampling point are obtained by inverse distance-weighted interpolation sampling2.4:End if2.5:End forStep 3:Synthesizing the color value for each pixel3.1:For each pixel Do3.2:Calculate the value ofC and α by using formulas (6) and (7)3.3:End forOutput:Composite 3D image


## 3.4. Stability Analysis

In the process of image rendering using the classical ray casting algorithm, there are two kinds of situations in which the projected ray travels in the 3D volume data field: the ray travels in the empty voxel and the ray travels in the nonempty voxel. For analyzing the whole rendering process from the rendering data source, the calculation of empty voxels has no contribution to the final 3D reconstruction effect presented on the screen. However, if the same undifferentiated interpolation is applied to the empty voxels, the rendering time of the ray casting algorithm will be increased, and the real-time performance of the algorithm will be affected. Therefore, we use the spatial jump technique to skip the empty voxels in the direction of the projection ray and only interpolate the nonempty voxels in the 3D volume data field. For each empty voxel, first record the nearest distance from it to the opaque voxel, and then, no matter what the direction of the ray is, as long as the distance is a forward step, it will not intersect with the opaque voxel in this distance range when the ray is casting. Based on this, it can significantly reduce the redundant steps of ray casting, improve the efficiency of the algorithm, and has obvious advantages in computing resources and memory requirements.


## 4. Experiments and Analysis

### 4.1. Experimental Setup

The experimental data were obtained from the project cooperation Hospital of Xi’an Zhenwo 3D Technology Co., Ltd., with a total of 77 samples and a resolution of 512 × 512 DICOM format CT image data file, and each CT image interval is 2.5 mm. Hardware environment is Intel (R) core (TM) i5-4590 @ 3.30 GHz, 8 GB, AMD Radon (TM) r5340x, OS is windows10, and all programs are implemented in Python + VTK development environment. In this paper, five vertebrae of lumbar vertebrae are taken as the reconstruction object, and the DICOM format vertebral CT data is used for experiment. The time required by several ray casting algorithms for volume rendering is compared, and the PSNR and SSMI values are used as evaluation indexes to compare the reconstruction quality.


### 4.2. Reconstruction Results and Analysis

In the same experimental environment, two groups of experiments were carried out: the first group took all slices of lumbar CT data as input, compared with the traditional ray casting (TRC), the ray casting based on bounding box optimization (BRC) [17], the ray casting with viewpoint (VRC) [18], and our method (improved ray casting, IRC), the 3D reconstruction results and execute time are given; in the second group, part of CT slices in the data set was taken to reconstruct a single vertebra, and the time-consuming and reconstruction results of the four volume rendering methods were compared.Figures2 and 3 show the comparison of reconstruction effect of lumbar and single vertebral, respectively. In addition, Tables 3 and 4 show the comparison of reconstruction quality indexes to TRC of lumbar and single vertebra, respectively.Figure 2
Comparison of the reconstruction effect of lumbar. (a) TRC. (b) BRC. (c) VRC. (d) IRC.
(a)(b)(c)(d)Figure 3
Comparison of the reconstruction effect of single vertebra. (a) TRC. (b) BRC. (c) VRC. (d) IRC.
(a)(b)(c)(d)Table 3
Comparison of quality indicators to TRC of lumbar reconstruction.
Algorithm contrastPSNRSSIMBRC and TRC25.63130.9318VRC and TRC26.91640.9262IRC and TRC27.89330.9705Table 4
Comparison of quality indicators of lumbar reconstruction.
Algorithm contrastPSNRSSIMBRC and TRC33.08520.9862VRC and TRC31.54430.9860IRC and TRC32.50440.9862From Figures2 and 3, we can see that our method IRC algorithm has no obvious difference in reconstruction quality compared with the other three algorithms. However, from the reconstruction quality indicators in Tables 3 and 4, we can see that the PSNR value of IRC is little different from the other algorithms, and the SSIM value is very close. This shows that our improved method not only ensures the quality of 3D reconstruction but also shows the better reconstruction model. Table 5 shows the running time of the four algorithms in two groups of experiments.Table 5
The running time of the four algorithms in the two sets of experiments.
Experiment subjectTRC (s)BRC (s)VRC (s)IRC (s)Lumbar24.32518.86216.50814.346Single vertebra10.7398.2547.8516.473From Table5, we can see that the running time of TRC, BRC, and VRC algorithm for single vertebra is 10.739 s, 8.254 s, and 7.851 s, respectively, which is slower than 6.473 s of our improved ray casting algorithm. Meanwhile, the running time of IRC for whole lumbar spine is 14.346 s, which is 9.979 s, 4.516 s, and 2.162 s faster than TRC (24.325 s), BRC (18.862 s), and VRC (16.508 s), respectively. Therefore, IRC is better than the other three algorithms in running speed for CT data files of the same experimental object. For each interpolation point, the trilinear interpolation method needs 21 times of multiplication and division and 28 times of addition and subtraction, while the inverse distance-weighted interpolation method only has 16 times of multiplication and division and 7 times of addition and subtraction. Because of the reduction of the amount of computation, the IRC shortens the running time.


## 4.1. Experimental Setup

The experimental data were obtained from the project cooperation Hospital of Xi’an Zhenwo 3D Technology Co., Ltd., with a total of 77 samples and a resolution of 512 × 512 DICOM format CT image data file, and each CT image interval is 2.5 mm. Hardware environment is Intel (R) core (TM) i5-4590 @ 3.30 GHz, 8 GB, AMD Radon (TM) r5340x, OS is windows10, and all programs are implemented in Python + VTK development environment. In this paper, five vertebrae of lumbar vertebrae are taken as the reconstruction object, and the DICOM format vertebral CT data is used for experiment. The time required by several ray casting algorithms for volume rendering is compared, and the PSNR and SSMI values are used as evaluation indexes to compare the reconstruction quality.


## 4.2. Reconstruction Results and Analysis

In the same experimental environment, two groups of experiments were carried out: the first group took all slices of lumbar CT data as input, compared with the traditional ray casting (TRC), the ray casting based on bounding box optimization (BRC) [17], the ray casting with viewpoint (VRC) [18], and our method (improved ray casting, IRC), the 3D reconstruction results and execute time are given; in the second group, part of CT slices in the data set was taken to reconstruct a single vertebra, and the time-consuming and reconstruction results of the four volume rendering methods were compared.Figures2 and 3 show the comparison of reconstruction effect of lumbar and single vertebral, respectively. In addition, Tables 3 and 4 show the comparison of reconstruction quality indexes to TRC of lumbar and single vertebra, respectively.Figure 2
Comparison of the reconstruction effect of lumbar. (a) TRC. (b) BRC. (c) VRC. (d) IRC.
(a)(b)(c)(d)Figure 3
Comparison of the reconstruction effect of single vertebra. (a) TRC. (b) BRC. (c) VRC. (d) IRC.
(a)(b)(c)(d)Table 3
Comparison of quality indicators to TRC of lumbar reconstruction.
Algorithm contrastPSNRSSIMBRC and TRC25.63130.9318VRC and TRC26.91640.9262IRC and TRC27.89330.9705Table 4
Comparison of quality indicators of lumbar reconstruction.
Algorithm contrastPSNRSSIMBRC and TRC33.08520.9862VRC and TRC31.54430.9860IRC and TRC32.50440.9862From Figures2 and 3, we can see that our method IRC algorithm has no obvious difference in reconstruction quality compared with the other three algorithms. However, from the reconstruction quality indicators in Tables 3 and 4, we can see that the PSNR value of IRC is little different from the other algorithms, and the SSIM value is very close. This shows that our improved method not only ensures the quality of 3D reconstruction but also shows the better reconstruction model. Table 5 shows the running time of the four algorithms in two groups of experiments.Table 5
The running time of the four algorithms in the two sets of experiments.
Experiment subjectTRC (s)BRC (s)VRC (s)IRC (s)Lumbar24.32518.86216.50814.346Single vertebra10.7398.2547.8516.473From Table5, we can see that the running time of TRC, BRC, and VRC algorithm for single vertebra is 10.739 s, 8.254 s, and 7.851 s, respectively, which is slower than 6.473 s of our improved ray casting algorithm. Meanwhile, the running time of IRC for whole lumbar spine is 14.346 s, which is 9.979 s, 4.516 s, and 2.162 s faster than TRC (24.325 s), BRC (18.862 s), and VRC (16.508 s), respectively. Therefore, IRC is better than the other three algorithms in running speed for CT data files of the same experimental object. For each interpolation point, the trilinear interpolation method needs 21 times of multiplication and division and 28 times of addition and subtraction, while the inverse distance-weighted interpolation method only has 16 times of multiplication and division and 7 times of addition and subtraction. Because of the reduction of the amount of computation, the IRC shortens the running time.


## 5. Conclusion

This paper proposed an improved ray casting algorithm to solve the problem of too long rendering time of traditional ray casting algorithm in the process of 3D reconstruction of vertebral CT image. According to the shortcomings of trilinear interpolation method in sampling speed, inverse distance-weighted interpolation sampling is used instead of trilinear interpolation sampling. Compared with the other existing methods, our method can reduce the reconstruction time and improve the rendering speed without reducing the reconstruction quality. How to improve the existing methods so as to obtain more fine reconstruction effect of microstructure and further improve the reconstruction accuracy is the next research direction.



---

*Source: 8718523-2021-08-05.xml*