Three-Dimensional Reconstruction of Two-Dimensional Cardiovascular Angiography Image Sequences by Local Threshold Segmentation Algorithm

.e study focused on the extraction of cardiovascular two-dimensional angiography sequences and the three-dimensional reconstruction based on the local threshold segmentation algorithm. Specifically, the two-dimensional cardiovascular angiography sequence was extracted first, and Gaussian smoothing was adopted for image preprocessing. .en, optimize maximum between-class variance (OSTU) was compared with the traditional two-dimensional OSTU and fast two-dimensional OSTU and applied in the segmentation of cardiovascular angiography images. It was found that the cardiovascular structure itself was continuous, the contrast agent diffused relatively evenly in the blood vessel, and the gray level of the blood vessel was also continuous. .e degree of smoothness was consistent in all directions by Gaussian smoothing, avoiding the direction deviation of the smoothened image. .e operation time (0.59 s) of the optimize OSTU was significantly shorter than that of traditional OSTU (35.68 s) and fast two-dimensional OSTU (6.34 s) (P< 0.05). .e local threshold segmentation algorithm can realize the continuous edge extraction of blood vessels and accurately reflect the stenosis of blood vessels. .e results of blood vessel diameter measurement showed that the diameter from the end of blood vessel to the intersection varied linearly from 5.5mm to 9.0mm. In short, the optimize OSTU demonstrated good segmentation effects and fast calculation time; it successfully extracted continuous two-dimensional cardiovascular angiography images and can be used in three-dimensional reconstruction of cardiovascular images.


Introduction
With the continuous improvement of living standards, cardiovascular diseases have become the first killer threatening human health [1]. Its mortality ranks first, and the prevalence and mortality are still on the rise. Worse still, the patients are becoming younger. According to Report on Cardiovascular Health and Diseases in China 2019: An Updated Summary, the prevention and control of cardiovascular diseases in China is facing serious challenges, and there are estimated 330 million patients with cardiovascular diseases nationwide [2]. In view of the great harm of cardiovascular diseases, research on the prevention and treatment of cardiovascular disease is of great significance [3].
At present, there are mainly two treatment methods for cardiovascular diseases: interventional method and image segmentation. Interventional treatment is direct and effective, but it increases the pain of patients [4]. Image segmentation can only provide two-dimensional image information, so it requires three-dimensional reconstruction of blood vessels, and its effectiveness remains to be evaluated [5]. Segmentation algorithm-based image analysis mainly includes X-ray images and ultrasound images. Compared with ultrasound images, X-ray high-speed contrast imaging has better spatial resolution. In the diagnosis and treatment of cardiovascular diseases, three-dimensional reconstruction can be performed on two-dimensional imaging sequences [6]. e three-dimensional reconstruction of subtraction images is to use computer vision to quantitatively analyze the three-dimensional morphology of blood vessels. e first step is to obtain the digital subtraction image, followed by image segmentation to extract the overall skeleton of the blood vessel. en, the subtraction image is matched at different time points. Finally, three-dimensional reconstruction is performed [7]. e matching of the subtraction image mainly depends on the image segmentation [8].
Maximal variance between clusters (OTSU) is a classic algorithm for threshold segmentation. Two-dimensional OSTU is the generalization of one-dimensional OSTU. Based on the gray information and spatial neighborhood information of the image, it can effectively filter out the noise, but it has the problems of large amount of calculation and poor timeliness [9]. In this regard, the two-dimensional OSTU is optimized by decomposing it into two one-dimensional OSTUs. At the same time, dimensionality reduction is performed to reduce the amount of calculation [10]. e innovation of this study lies in the local threshold segmentation algorithm based on the maximum variance between classes, and the three-dimensional reconstruction of two-dimensional angiocardiography sequence was processed by computer, aiming at providing doctors with a kind of three-dimensional structure to observe blood vessels at any angle and assisting doctors in diagnosing and treating cardiovascular diseases.

Image Processing
2.1. X-Ray Imaging. Figure 1 shows the acquisition of the cardiovascular angiography image. e structure of the cardiovascular system is complicated. During the imaging, the distribution of blood vessels must be fully exposed. In clinical diagnosis, cardiovascular angiography imaging was performed at angles listed in Table 1. Interventional therapy uses stents and balloons to expand the vessel. e stent has a diameter of 4 mm and a length of 16 mm. Figure 2 is a perspective of a Gaussian low-pass filter. First, Gaussian smoothing is performed. A Gaussian low-pass filter is used to convolve the original image to reduce the noise. In order to eliminate the background of the image to highlight the tree-like structure of the cardiovascular system, this study makes full use of the disc structure elements of the mathematical top hat operator. e discrete function of Gaussian smoothing is as follows:

Preprocessing of Cardiovascular Angiography Images.
After Gaussian smoothing and top hat operator processing, 5 horizontal lines are selected on the cardiovascular image, and then the point with the largest gray value in each horizontal line is extracted.
en, according to the gray value, the 5 points are ranked, called the seed point set. With the seed point as a starting point, the complex tree-like structure of the cardiovascular system is tracked.

e Optimize OSTU.
Not interfered by image contrast and brightness is a great advantage in image processing. In this study, a local threshold segmentation algorithm is proposed based on the OSTU. e algorithm decomposes the two-dimensional OSTU into two one-dimensional OSTUs. e method not only reduces the complexity of the algorithm but also occupies less storage space of the computer. Based on the strong correlation between the internal pixels of the target class and the background class, a threshold discriminant function is proposed.
Supposing that the threshold s divides a set of discrete data into two classes, and the variance between the classes is defined as follows: Equation (1) is simplified to obtain the following equation: In equations (2) and (3), m o is the average value of the target class, m 1 is the average value of the background class, v0 is the probability of the target class, and v1 is the probability of the background class. erefore, a larger S q indicates a greater variance between the classes, more obvious partition between the target class and the background class, and better segmentation effects.
Assuming that the threshold s divides a set of discrete data into two classes, the intraclass variances are expressed as follows. q i is the probability of the occurrence of i, u 0 , and u 1 represent the mean values of the two classes, respectively, and w0 and w1 represent the probabilities of the two classes, respectively.
In equations (3) and (4), S 1 and S 2 are two types of discrete data, q i represents the probability of occurrence of i, m o represents the mean value of the target class, and m 1 represents the mean value of the background class. e variance of the two classes of discrete data is as follows: where v0 is the probability of the target class and v1 represents the probability of the background class. S v is the cohesion between the two classes of data. A smaller value indicates better segmentation effects, that is, a larger between-class variance leads to a smaller the intraclass variance, and the segmentation effects will be better. erefore, a new discriminant function is proposed, namely, the intraclass variance ratio method.
If the optimal threshold satisfies S * � arg max S { }, its corresponding gray value is the optimal threshold. Similarly, the optimal threshold t of the neighborhood mean image G (x, y) can be obtained. is method avoids the global search in the L × L dimension and only needs to find the optimal threshold, thereby reducing the amount of calculation. Figure 3 is a flowchart of a local threshold segmentation algorithm based on the OSTU.

Estimation of Cardiovascular Parameters.
e various parameters of the cardiovascular system are estimated based on the differences in the gray values of the cardiovascular system and the background. e radial angle of the cardiovascular system is the angle between the main axis of the heart and the x-axis. e implicit function expression of the radial angle is as follows: where α represents the radial angle and (i, j) represents the seed point. When it is at the minimum value, the equation to calculate the radial angle α is as follows: where α represents the radial angle and φ represents the geometric central moment. In an actual image, the relationship between the radial angle and the quadrant is shown in Figure 4. When α is in the first and third quadrants, α > 0; when α is in the second and fourth quadrants, α < 0.
In the cardiovascular image, the gray values of the cardiovascular and the background are not constant. As for the cardiovascular model, the average gray value of the points on the radial vector is approximate to the cardiovascular gray value; as for the background, the average gray value of 5 points on both sides of the normal vector is approximate to the background gray value.

ree-Dimensional Reconstruction Method of Two-Dimensional Cardiovascular Angiography Images.
e skeleton lines are identified in two contrast images of different angles through three-dimensional reconstruction. In this study, the binary tree structure is used to represent the vascular tree structure, and the vascular segment is encoded to improve the matching accuracy of the vascular skeleton. e basic structure of the blood vessel skeleton mainly includes the bifurcation and intersection, so it is necessary to identify the bifurcation and intersection of the overall skeleton. e bifurcation of the blood vessel refers to the intersection of the blood vessel skeleton due to the branching of the blood vessel. Intersection of blood vessels refers to the overlapping of blood vessels after projection that do not intersect in space. Figure 5 shows the blood vessel bifurcation and intersection ( Figure 5).

Comparison with Other Models.
In order to verify the effectiveness and feasibility of the algorithm in the study, the experimental environment is set to Windows 8.1 cientific Programming Professional Edition, IntelCore (TM) i7-3570 CPU @3.40 GHz, RAM 4.00 GB, MATLAB R2012b. In practice, the background of the acquired image is generally complicated, and the signal-to-noise ratio is low. In order to verify the segmentation effects of the algorithm in this research, the cardiovascular angiography sequence is used as sample data, and the traditional two-dimensional OSTU and fast two-dimensional algorithm are selected for comparison with the algorithm of optimize OSTU.

Statistical
Methods. e data were processed by SPSS19.0, the measurement data were expressed by the mean ± standard deviation (‾x ± s), and the count data were expressed by the percentage (%). Pairwise comparison adopted analysis of variance. P < 0.05 was the threshold for significance. Figure 6 is a cardiovascular angiography image. It was noted that, the cardiovascular system had a tree-like structure. Starting from the coronary arteries, the blood vessels gradually became thicker and extend to various parts of the heart to form many capillaries. In the process of extension, various branches continued to form. e diameter gradually decreased from     the main blood vessel to the capillaries. Different tissue has different attenuation coefficients for X-rays. As a result, the gray values of the final image are uneven, and the shape of some tissue is similar to that of the cardiovascular system, causing structural noise. Since the blood vessel itself is continuous, the contrast agent diffuses uniformly in the blood vessel, so the gray scale of the blood vessel is also continuous. e heart and ribs can be clearly seen in the cardiovascular imaging images. Figure 7 shows the preprocessing results of cardiovascular images. e smoothing degree in all directions is consistent by Gaussian filter, successfully avoiding the direction deviation of the smoothed image. e weight of Gaussian smoothing is related to the distance between the center points. A greater distance leads to a smaller weight. e scale affects the smoothness of the image to a certain extent, and a larger scale leads to greater smoothness.

Comparison of the Calculation Time of the
ree Algorithms. Figure 8 shows the calculation time of the three algorithms. In this study, the operation time (0.59 s) of the optimize OSTU was significantly shorter than that of the traditional OSTU (35.68 s) and the fast two-dimensional OSTU (6.34 s), and the difference was statistically significant (P < 0.05).

Cardiovascular Grayscale Distribution.
e contrast image is mainly composed of blood vessels and nonvascular tissue. e structural size of nonvascular tissue is larger than that of blood vessels. Compared to blood vessels, nonvascular tissue has a lower attenuation rate to X-rays, and the resulting gray values are relatively smooth and change slowly. e gray value distribution on the vertical line of the blood vessel skeleton is shown in Figure 9.

Segmentation Results Comparison of Global reshold and
Local reshold. Figure 10 shows the segmentation results of global threshold and local threshold. Compared with the global threshold segmentation algorithm, the local threshold segmentation algorithm lost less blood vessel information; the small and large blood vessels in the middle area were separated clearly without damage to the large blood vessel structure; and it can avoid the interference of light and contrast dose.

e Extraction of the Central Axis of the Cardiovascular
System. Figure 11 shows the coronary arteries pre-extracted from the arterial image. When thinning the edges of blood vessels, the endpoints cannot be thinned out as edge points. In this study, the thinned end points were extended to the blood vessel area in reverse to reflect the true end points of the blood vessel skeleton. Figure 12 is a cardiovascular margin map. In this study, based on the approximately parallel two edges of the blood vessel, the corresponding blood vessel skeletons with no edges were eliminated to reduce the error in diameter measurement. In order to avoid the distortion of the diameter at the intersection, the intersection was specially treated. It was found that the local threshold segmentation algorithm can achieve continuous edge extraction of blood vessels, which can accurately reflect the stenosis of blood vessels.

The parent vessel
The child blood vessels The child blood vessels (a)

The parent vessel
The child blood vessels The child blood vessels The child blood vessels The child blood vessels (c) Figure 5: Blood vessel bifurcation and intersection. (a) e blood vessel tends to be "Y" type bifurcation; (b) the blood vessel is "Y" type bifurcation; (c) the blood vessels intersect. e thick line represents the two-dimensional image of the cardiovascular system, the arrow represents the direction of blood flow, and the thin line represents the vascular thinning results.

Measurement of Blood Vessel Diameter.
In this study, the simple tree-like structure of blood vessels was simulated and the diameter was measured. Figure 13 shows the measurement results of blood vessel diameter. e abscissa represents the position of the blood vessel sampling point on the blood vessel skeleton line, and the ordinate represents the measured blood vessel diameter. It is found that the diameter of the blood vessel is linear from 5.5 mm at the end to 9.0 mm at the intersection.

Discussion
With the continuous development of computer technology, three-dimensional reconstruction of medical images is currently a research hotspot in medical diagnosis [11][12][13]. In recent years, the morbidity and mortality of cardiovascular diseases have increased year by year, and two-dimensional imaging technology is widely used in the diagnosis and treatment of cardiovascular diseases [14]. During cardiovascular imaging, the angiography image is affected by structured and unstructured noise, and artifacts of other tissue appear, making the background highly nonuniform. In order to avoid noise interference, the original cardiovascular image was preprocessed to highlight the cardiovascular structure [15]. When the three-dimensional object is projected onto a two-dimensional plane, there is spatial ambiguity due to the intersection, bifurcation, and overlap of blood vessels. In this study, aimed at the bifurcation and crossing problems, the relevant parameters were calculated to adjust the radial measurement angle to track the blood vessel.
reshold segmentation is a branch of image segmentation, which is widely used because it is easy to operate. e OSTU is a threshold segmentation algorithm, and its segmentation effects are good [16]. In the study, it was found that the operation time of the optimize OSTU was significantly shorter than that of traditional OSTU and fast twodimensional OSTU (0.59 s VS 35.68 s; 6.34 s, P < 0.05). Compared with the global threshold segmentation algorithm, the local threshold segmentation algorithm lost less blood vessel information, and the small and large blood vessels in the middle area were clearly separated [17,18]. It showed that the algorithm of this research was superior to the other two in segmentation effect and computing time, this is similar to the research results of Suzuki et al. [19].
Ideally, the cross section of the blood vessel can be approximately regarded as a circle, and the blood vessel is approximately tubular. When the three-dimensional blood vessel is projected on a two-dimensional plane, the blood vessel is in a ribbon shape, and the two sides of the blood vessel are approximately parallel [20][21][22].
rough the Gaussian smoothing preprocessing of the original cardiovascular image, the local threshold segmentation algorithm was used to extract the blood vessel region, and the blood vessel skeleton was successfully obtained. As for extraction of edge of the blood vessel, the results showed that the extracted blood vessel edge was continuous, and the local edge can also be optimized to remove the structural noise in the background [23].
After the cardiovascular skeleton and edges were successfully extracted, the blood vessel diameter was identified. e results found that the diameter of the blood vessel changed linearly from 5.5 mm at the end to 9.0 mm at the  en, the degree of vascular stenosis was preliminarily diagnosed based on the diameter information, and the results were found to be consistent with the research results of Liu et al. [24].

Conclusion
In this study, the optimize OSTU was compared with traditional OSTU and fast two-dimensional OSTU and applied to three-dimensional reconstruction of two-dimensional cardiovascular angiography images. It was found that the optimize OSTU demonstrated good segmentation effects and fast calculation time; it successfully extracted continuous two-dimensional cardiovascular angiography images and can be used in three-dimensional reconstruction of cardiovascular images. However, the deficiency of this study is that the edges of the extracted cardiovascular images are jagged and unsmooth, which leads to insufficient accuracy. In the later stage, we need to improve and perfect the cardiovascular edges. In a word, the two-dimensional angiography sequence and three-dimensional reconstruction method of cardiovascular system lay a foundation for the research, diagnosis, and treatment of vascular diseases.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare no conflicts of interest.