#### Abstract

Aiming at the puncture and drainage of clinical intracranial hematoma, we proposed an adaptive bifurcation algorithm based on the hematoma point cloud and optimized the design of the drainage tube. Firstly, based on the CT data of intracranial hematoma patients, a three-dimensional hematoma model was established, the point cloud on the surface of the hematoma was extracted and simplified, and the location of the main drainage tube was located by using the long-axis extraction algorithm. Secondly, the Eight Diagrams algorithm was used to identify the internal point cloud of hematoma, and the positions of multiple absorption points were determined by the K-means clustering algorithm. The locations of the bifurcation points of the main drainage tubes were calculated by the numerical method, and the telescopic lengths and directions of multiple subdrainage tubes were obtained. Finally, connect the main tube and the subtube, design an adaptive bifurcation drainage tube model, and apply it to intracranial hematoma puncture and drainage surgery. The algorithm can accurately determine the puncture point, puncture path, number, and location of subdrainage tubes according to the geometric characteristics of hematoma, achieve a uniform and accurate dose adjustment and drainage of intracranial hematoma, and accelerate the dissolution and drainage speed. The application of an adaptive bifurcation drainage tube can significantly reduce the risk of intracerebral hemorrhage, intracranial infection, and other complications, which has certain guiding significance and application value in clinical practice.

#### 1. Introduction

At present, craniotomy is often used clinically to remove intracranial hematoma in patients. Patients with hematoma have a long anterior and posterior diameter, which is difficult to expose during the operation, requires a larger bone window, and repeatedly stretches the cortex. The operation is more difficult and the hematoma removal rate is low. The patient has a poor prognosis [1]. In recent years, minimally invasive hematoma removal by hematoma puncture and drainage can reduce the surgical incision, facilitate timely removal of hematoma, quickly improve intracranial pressure, do a good job in the prevention, control, and treatment of secondary brain injury, and relieve the damage of hematoma tissue to nerve cells [2]. Neuronavigation hematoma puncture technology can quickly and accurately remove an intracranial hematoma, intraoperative puncture direction, puncture point, and puncture depth can be controlled, and the drainage tube can be easily and accurately placed into the hematoma cavity, avoiding the blindness of traditional puncture [3]. It is an important means for clinical treatment of cerebral hemorrhage and improvement of prognosis. However, the small hole at the end of the traditional drainage tube is embedded in the wall of the main tube, and the diffusion rate is low and slow, thus prolongs the operation time and increases the operation risk. Moreover, uniform administration and drainage in different directions could not be realized according to the shape of hematoma. Therefore, this paper optimized the design of the traditional drainage tube.

At present, the minimally invasive surgery for the elimination of intracranial hematoma in clinical practice uses the traditional drug drainage tube. The total length of the main canal is 14 cm, and the diameter is 0.2 cm. The end of the main canal is closed, among which 1 cm and 1.5 cm away from the end are provided with a hole with a diameter of 1 mm, respectively, these two small holes are symmetrically distributed on both sides of the main channel, as shown in Figure 1.

The small hole at the end of the traditional drainage tube is embedded in the wall of the main tube so that the outer surface of the main tube is fully smooth, thus reducing the friction between the drainage tube and intracranial tissue during the operation and ensuring that the drainage tube can reach the center of the hematoma as quickly, safely, and accurately as possible.

The hemolytic agent can produce the interdiffusion reaction with the hematoma. The hemolytic agent drained by the traditional drainage tube is mainly concentrated in the small hole of the main tube, and the blood concentration in the hematoma is also diffused in the direction of the orifice. As a result, the interdiffusion efficiency of hemolytic agent and hematoma is low and the speed is slow, thus prolongs the operation time and increases the operation risk [4].

Cui proposed a multifunctional drainage tube for intracerebral hematoma with multiple subtubes, which could achieve telescopic subtubes in the common duct and rotation of drug delivery in the common duct, so as to achieve the purpose of multipoint and multidirectional uniform drug delivery and drainage [5]. Pan L proposed an improved adaptive weighted particle swarm optimization point cloud search algorithm to improve the efficiency and accuracy of puncture point identification and applied it to extract the optimal external axis, thus providing the optimal path for hematoma drainage tubes [6]. Zhu puts forward visual analysis of flow and diffusion of hemolytic agents and hematomas, using COMSOL more physical software to simulate the hemolysis agent bifurcate drainage tube in the streamline distribution and hemolysis agent in the diffusion behavior of hematoma [4]. Based on previous studies in our team, the drainage tube was optimized, and the adaptive bifurcation drainage tube was customized according to the geometric characteristics of different intracranial hematomas.

In this paper, an optimization model for the traditional drainage tube was proposed. Based on the long-axis extraction algorithm, the main position was determined, and the clustering points were found according to the K-means clustering analysis to accurately locate the position of the subdrainage tube. The optimized adaptive bifurcation drainage tube can achieve uniform and accurate administration and drainage of hematoma in different directions, reduce blood residue, achieve the purpose of maximum drainage, accelerate the dissolution and drainage of hematoma, and improve the safety of surgery. Three-dimensional real-time software simulation technology is used to reconstruct anatomical sites, such as hematoma, blood vessels, skull, and nerve tract. Clinicians can use the adaptive bifurcated drainage tube designed in this paper to conduct preoperative simulation, avoid important parts of the brain, and achieve accurate puncture of hematoma, thus reducing the risk and time of treatment [7–9].

#### 2. Optimal Design of Main Drainage Tube Based on Long-Axis Extraction Algorithm

##### 2.1. Simplify the Surface Structure of Hematoma

In this paper, CT data of intracranial hematoma patients were extracted and preprocessed to achieve 3D reconstruction, and point cloud datasets were extracted. Due to the complexity of the shape of hematoma, the number of point clouds, the location of scattered and discontinuous, and the difficulty of calculation, and the surface hierarchy of hematoma are simplified. The hematoma data were obtained from Tangshan Gongren Hospital, as shown in Figures 2 and 3.

This paper uses decimation of triangle meshes algorithm, with valuation grid on local topology and geometry properties of lattice; the lattice can be divided into simple types; thus, it can be divided into interior and boundary of two types. The judgment of lattice deletion is based on , is given to allow the deviation value, the interior point is the distance between candidate points to the average plane, and the boundary point is a candidate to second neighbor points of attachment. Finally, the neighborhood of the deleted grid points is repartitioned by the method of the optimal split plane, and the time complexity is linear [10].

By changing the smoothness of the surface of the hematoma, the surface structure of the hematoma is simplified, and the overall structure of the space remains unchanged. The surface point cloud data is reduced, the algorithm is regular and fast, and the effect of fidelity and detail preservation is good. The simplified hematoma model before and after is shown in Figures 4 and 5.

##### 2.2. Puncture Points Were Extracted Using the Optimized Long-Axis Extraction Algorithm

By studying the long-axis problem of complex geometry, it can be reduced to the farthest point pair problem of the point cloud model [11], that is, the line segment with the longest Euclidean distance between any point pair. By using the long-axis extraction algorithm, the distance function of discrete model is maximized to solve the furthest point pair problem. The distance function of the geometric point cloud model is established to maximize the maximum-minimum distance (max-min) and maximum-average distance (max-avg) between any point pairs. Assume that the given point cloud is set (nonnegative N points), the distance between each point pair is the edge weight, and each edge weight is nonnegative. The edge weight of any point with respect to is called . The goal of the discrete problem is to locate points () among *n* points in the point cloud to maximize the function of the distance between point pairs [12].

MAX-MIN points’ dispersion (MMPD): for the nonnegative distance from any point in set to , there exists subset () and an integer so that can obtain the distance function:

Maximizing distance function:

MAX-AVG points’ dispersion (MAPD): there are subsets () and integers which make and get the average distance function:

Maximizing average distance function:

Number of point pairs in the point cloud:

Therefore, the maximized average distance is equal to the sum of the maximized distances.

The distance specified in MMPD or MAPD satisfies the triangle inequality, that is, any three different points , and satisfy

Existence distance functions and average distance functions: there are distance functions and average distance functions:

The distance between pairs of points in space is Euclidean distance:

The above hematoma model was taken as an example to verify the algorithm, as shown in Figures 6 and 7.

From what has been discussed above, the long-axis extraction algorithm can be used to solve the farthest point pair problem in the point cloud model. The long axis of the model is the line segment with the longest Euclidean distance in the point cloud. The algorithm has the advantages of easy model iteration, low time consistency, convenient storage of calculation results, easy expansion, and more consistent with the geometry of the topology.

Preliminary results show that the main drainage tube can determine the direction of puncture and drainage according to the long axis of different hematomas so that the introduction of hemolytic agent and the extraction of hematoma fluid can be precise and avoid important brain functional areas. This design is far away from the dense area of the middle cerebral artery and the important branch of the external carotid artery in the scalp, which has little impact on the normal physiological structure, reduces the difficulty of surgery and reduces the risk of surgery.

##### 2.3. Long-Axis Extraction Compared with the Horizontal Optimization of the Previous Method

When using the long-axis extraction algorithm to extract the point cloud data, because there are many point cloud data in the initial geometry space, the method of simplifying the number of faces is adopted to simplify the hematoma geometry. In order to simplify the influence of different complexity degrees on the long-axis operation time and accuracy, the simplified point cloud data were used to conduct point cloud number statistics and time statistics, and the identification accuracy was compared. Point cloud data with different complexities were shown in Table 1.

The transverse comparison (Table 1 and Figure 8) shows that the number of point clouds is positively correlated with the retrieval time, and the simplified data can meet the accuracy requirements within the allowable range of the calculation time, reduce the calculation time of the long axis of the hematoma as much as possible, and meet the requirements of the calculation of puncture hematoma surgery.

In tests of different levels of complexity, although the same number of iterations is used to find the long axis, it is obviously not enough for graphics with more point cloud data. For a graph with a complexity level of 7, a more accurate long axis can be obtained faster with the same number of iterations on the geometry, as shown in Figure 7.

#### 3. Optimal Design of Adaptive Drainage Branch Tube

##### 3.1. Internal Points of Intracranial Hematoma Were Extracted Based on the Eight Diagrams Algorithm

The internal points of three-dimensional graphics are identified by using the Eight Diagrams algorithm. The points discussed in this paper are composed of contour data points and internal data points on the surface of geometry by graphic files for the 3D point cloud array [13]. The three-dimensional space is divided into the eight diagrams, as shown in Figure 9. When the target is close to the surface of the geometry, the tangent plane is generated. The target point and the geometry on the tangent plane are in the space rectangular coordinate system and at the side of the origin of the tangent plane. On the other side of the plane, there is at least one hexagram without a target and geometry, so the algorithm can be used for hematoma interior-point discriminant Eight Diagrams.

Eight Diagrams algorithm is used in this paper to discriminant of hematoma interior point, as shown in Figure 10. Take any target point , vector representation of all surface points with hematoma, remember to vector , and divide the space where the target point a is; it is divided into eight hexagrams. If the vector exists in all eight hexagrams, it is the internal point of the hematoma. Similarly, if there is no vector in at least one of the hexagrams, it is the surface point or external point of the hematoma.

For example, the target point is zero: .

The collection of surface points of hematoma is

The collection of internal points of the hematoma is

The set of target point and hematoma surface point vector is

To judge the internal point of hematoma, if any hexagrams of the spatial Eight Diagrams contain vectors in set D and the symbols corresponding to each vector include the symbols corresponding to the above Eight Diagrams, then the target point is the internal point of hematoma. If there is at least one hexagram in the spatial Eight Diagrams that does not contain the vector in set D and there is at least one case in which the hexagram corresponding symbol does not contain the vector in set *D*, then the target point is the hematoma surface point or the external point.

Taking the above intracranial hematoma as an example, the Eight Diagrams algorithm was used to distinguish the internal points of hematoma and extract the data set of internal points and surface points of hematoma. The yellow points were internal data points of hematoma, and the red points were surface data points of hematoma. The distribution of internal and surface data points of hematoma is shown in Figures 11–13 .

##### 3.2. Extraction of Hematoma Absorption Points Based on K-Means Clustering Analysis Algorithm

K-means clustering analysis algorithm clustered *n* data objects in the space with K points as the center and classified the target points closest to the center to get K clusters [14]. Through the iteration method, the coordinate values of each cluster center are updated successively so that the similarity of objects in the same cluster is high, while the similarity of objects in different clusters is low, and the optimal cluster center is obtained.

For example, we have *n* variables, , divided into *k* classes, , and is the number of variables in class , , and for the average:(1)Select the initial center of *k* classes.(2)Iterate for any sample, calculate the Euclidean distance to *k* center points, respectively, and group the sample to the class where the center with the shortest distance is located. Euclidean distance: If , among them, , , so assign to class .(3)Use the mean method to update the values of the center of the classes.(4)For all clustering centers, the abovementioned (2) and (3) are repeated until each clustering center no longer changes. The iteration is finished and the classification is completed.

Combined with the above intracranial hematoma data set. K-means clustering analysis algorithm was adopted. The data objects of intracranial hematoma in space were clustered with 4 points as the center, and the target points nearest to the center were divided into 4 clusters. Through the iteration method, the coordinate values of each clustering center are updated successively so that the similarity of objects in the same clustering is higher, while the similarity of objects in different clustering is smaller. Finally, four optimal clustering centers are obtained. The data set is shown in Table 2.

K-means clustering analysis was performed on the internal data points of the hematoma, and the clustering results are shown in Figure 14. The four clusters were yellow, green, purple, and blue, and the four red dots were the clustering centers, namely, the absorption points of the hematoma.

##### 3.3. Determine the Point of Branching of the Hematoma on the Main Drainage Tube

The origin is O at the end of the long axis, the major axis is the *z*-axis, and the outlet direction of the main outlet is the positive direction of the *Z*-axis. Thus, a three-dimensional coordinate system O-XYZ is established. Let the length of the long axis be ; divide the long axis into points and take a point at every interval ; vectors were made with four hematoma absorption sites ; calculate the angle between each vector and the positive direction of the *z*-axis .

Let the supervisor start with .

The main end is .

Then, the leading vector is .

Supervisor above each point is .

The set of vectors composed of each point on the main axis is .

Let the absorption point vector be .

Then, the vector set from each point on the main to each absorption point is

In the error value calculation method, the measured value , is the normal value :

The iterative calculation was carried out to make the error value satisfied by giving the error value . The four points with the smallest error were taken as the branch bifurcation points of the main pipeline. By connecting the bifurcation point and absorption point, the telescopic length and direction of the subdrainage tube were obtained. Then, the overall structure of the bifurcation drainage tube was designed.

#### 4. Result Analysis

In this paper, an adaptive bifurcation algorithm based on hematoma point cloud is proposed. To optimize the design of puncture drainage tube for clinical intracranial hematoma, the following steps are followed: Step 1: based on the CT scan data of patients with intracranial hematoma, 3D reconstruction was performed to establish a 3D hematoma model. The point cloud data set was extracted to simplify the hematoma surface hierarchy and the surface point data set. Step 2: use the long-axis extraction algorithm to select the farthest point pair of Euclidean distance as the two endpoints of the long axis to locate the location of the main drainage tube, and the coordinates of the two ends of the long axis are shown in Table 3; Step 3: Eight Diagrams algorithm was used to extract internal point cloud of hematoma. Step 4: the K-means clustering analysis algorithm is used to determine the position of absorption points. The coordinates of the absorption point are shown in Table 4; Step 5: use numerical solution to calculate the branch point of the upper branch of the main pipe. The coordinates of the bifurcation point are shown in Table 5; Step 6: the expansion direction and length of the adaptive bifurcation drainage tube were obtained by connecting the bifurcation point with the absorption point. Therefore, an adaptive bifurcation drainage tube model was designed, as shown in Figure 15. Step 7: the three-dimensional reconstruction model of intracranial hematoma was imported into COMSOL. On this basis, the adaptive branching drainage tube model was introduced to obtain the visual simulation diagram of the influence of the adaptive branching drainage tube on hematoma, as shown in Figures 16 and 17.

**(a)**

**(b)**

In clinical medicine, the closed adaptive bifurcated drainage tube is delivered to the intracranial hematoma through a catheter, and the drainage tube is automatically stretched in the hematoma. Among them, the drainage pipe for special silicone material is soft in texture and small to tissue damage. When the hemolysis agent passes through the drainage tube into the hematoma, diffusion effect occurs mainly in the export area around the four drainage tubes. Multicast delivery drainage achieves the purpose of uniform dosage and drainage, so as to speed up the blood clot dissolves and drainage. And, pressure is applied to quickly remove the main functional structure of the hematoma to reduce the damage that causes the disease of cerebral hemorrhage.

#### 5. The Error Analysis

##### 5.1. Error Analysis of Simplified Hematoma Surface

Hierarchy Structure Algorithm is used with the function approximation to perform error analysis on the simplified model and solve the geometric similarity measurement problem [15].

and norms are two commonly used error measurement standards. Let the surface point function of the original hematoma be , The simplified surface point function of hematoma is , we give a closed interval . The norm is used to indicate the maximum deviation between two functions:

The norm represents the average deviation between two functions:

After simplification, the surface point function of hematoma is , which is considered to be optimal; the similarity error measure of norm and norm can be used to measure the error between two triangular mesh models. In the triangular mesh model, what is measured is the distance between the nearest point pairs, and the distance from point V to model *M* is defined as the distance between point V and the nearest point W on model *M*; among them, the Euclidean distance between two vectors:

After testing, the original hematoma model was simplified by 60% in this paper, and the geometric similarity of the hematoma was within the error range. The simplified results could better simulate the original hematoma model.

##### 5.2. Error Analysis of Optimized Long-Axis Extraction Algorithm

The beginning end of the long axis and the end are obtained by the initial long-axis algorithm; the beginning end and the end of the long axis are obtained by optimizing the long-axis algorithm.

The long-axis vector obtained by the initial long-axis algorithm .

The long-axis vector obtained by optimizing the long-axis algorithm .

Let , and there are

Through testing, the positions and directions of the two endpoints of the long axis before and after optimization in this paper are within the error range, and the optimized long-axis extraction algorithm has high computational efficiency, which reduces the preoperative planning time.

#### 6. Conclusion

In this paper, the traditional drainage tube was optimized into an adaptive bifurcation drainage tube that could be customized according to different hematoma conditions. It makes the introduction of the hemolytic agent and the derivation of hematoma fluid precise. CT data are obtained from patients with intracranial hematoma to establish a three-dimensional hematoma model and simplify the hematoma surface hierarchy; then, the surface point cloud of hematoma was extracted; using long-axis extraction algorithm, locate the location of the main drainage tube. Accurately determine the entrance and direction of the puncture of the main drainage tube, using the Eight Diagrams algorithm and discriminating the internal data sets of hematomas and the visual processing. The absorption points are determined by K-means clustering analysis algorithm; among them, the number of absorption points can be calculated according to the shape of hematoma. The telescopic direction and length of the subtube were obtained by connecting the absorption point and the bifurcation point. Based on this, the self-adaptive bifurcation drainage tube model was designed and finally applied to the puncture and drainage of intracranial hematoma. The algorithm can accurately determine the puncture point, the puncture path, and the location and number of subdrainage tubes according to the geometric characteristics of hematoma, achieve a uniform and accurate drug administration and drainage of intracranial hematoma, and accelerate the dissolution and drainage speed of hematoma. The adaptive bifurcation algorithm proposed in this paper is based on the idealized state, and it is necessary to consider the distribution of peripheral nerves and other important parts of intracranial hematoma in the application.

The application of adaptive bifurcated drainage tubes can effectively shorten the operative time of patients, reduce intraoperative blood loss, improve the hematoma clearance rate, and improve the neurological function and prognosis of patients, with accurate, minimally invasive, and safe effects [16]. It has clinical significance and application value for the medical treatment of intracranial hematoma and provides preoperative simulation. It can promote the subsequent hematoma deformation research and visualization analysis and provide important guidance and value for the formulation of a puncture surgery plan and the reduction of surgical risk.

#### Data Availability

The data used to support the findings of this study are restricted by the Tangshan Gongren Hospital in order to protect patient privacy. The data are available from the Tangshan Gongren Hospital for researchers who meet the criteria for access to confidential data.

#### Conflicts of Interest

The authors declare that they have no conflicts of interest.

#### Acknowledgments

The authors thank Tangshan Gongren Hospital for their support in obtaining original data. This work was supported by the National Science Foundation of China (51674121 and 61702184), Ministry of Education production university cooperation education project (201802305012), and Tangshan Innovation Team Project (18130209B).