Post-processing method for segmented image of spine X-ray film
By applying spine contour detection, convex bag detection, sticky contour segmentation, and minimum external rectangular fitting in the spinal X -ray image processing, solve the difficulty of extracting the spinal border and corner point information, and realize the clear segmentation of the spine And automatic detection support.
Patent Information
- Application Number
- CN202411257086.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2025-01-24
AI Technical Summary
The prior art is difficult to effectively deal with adhesion problems between adjacent vertebrae bodies in spinal X-ray image processing, resulting in difficulty in extracting information of spinal boundary and corner points.
The spinal X -ray segmentation image is used to discover the spine contour detection, convex bag detection, sticky contour segmentation, and minimum external rectangular fitting method to extract the boundary and corner information of the spine.
The adhesion of adjacent vertebral bodies was successfully solved, each spine was clearly divided, and accurate boundaries and corner information were extracted, and automatic detection of spine bending type and COBB angle supported automatic detection.
Smart Images

Figure CN119359748A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medical image processing, and in particular to a method for post-processing a spinal X-ray segmentation image. Background Art
[0002] Scoliosis, also known as scoliosis, is a spinal disease that is common in adolescents. In addition to affecting appearance, the disease can also cause damage to the patient's nerves or muscle tissues, affect cardiopulmonary function and the patient's physical and mental health. In the process of daily diagnosis and treatment effect evaluation, it is usually necessary to detect the type of scoliosis and the Cobb angle of the spine. Traditional detection methods mainly rely on manual work. Doctors use the patient's spinal X-ray film and surveying tools, and according to their own experience, determine the end cone (the vertebra with the greatest inclination toward the concave side of scoliosis), calibrate and mark the lines, and measure the Cobb angle based on the lines drawn at the upper and lower edges of the end cone. This manual method is time-consuming and labor-intensive and is easily affected by the professional level of the surveyor, subjective factors, etc., which is not conducive to the diagnosis and treatment of scoliosis.
[0003] With the rapid development of computer and artificial intelligence technology, computer-aided diagnosis technology has been widely used in medical image processing. The application of computer-aided diagnosis technology in scoliosis screening mainly analyzes and processes the patient's spinal X-rays through image processing, extracts relevant features of the spine, realizes automatic detection of Cobb angle and scoliosis type, reduces the time and variability of manual measurement, and improves the accuracy and efficiency of detection.
[0004] Image processing of spinal X-rays is a complex task, which aims to extract the spinal structure in the spine for further analysis and diagnosis. Through image preprocessing methods such as deep learning model prediction, a binary image of the spine can be obtained, but the binary image of the spine needs to be further processed to obtain the boundary and corner information of each vertebra in the spine, especially the adhesion problem between adjacent vertebrae, which makes it very difficult to extract the boundary and corner information of the spine. Summary of the invention
[0005] In view of the defects of the prior art, the present invention designs a spinal X-ray segmentation image post-processing method using methods such as spinal contour detection, convex hull detection, adhesion contour segmentation and minimum circumscribed rectangle fitting to extract the boundary and corner point information of each vertebra, providing support for the automatic detection of scoliosis type and Cobb angle.
[0006] In order to achieve the above object, the present invention provides a method for post-processing spinal X-ray segmentation images, which mainly includes the following steps:
[0007] (1) For the X-ray segmentation image, a tracking algorithm is used to extract the contour to obtain a first contour point set;
[0008] (2) performing convex hull defect detection on the contour of the one-end sticking cone in the first contour point set to complete the segmentation of the one-end sticking cone;
[0009] (3) for the X-ray film segmentation image after the segmentation of the cone with one end adhered, use the tracking algorithm to perform a second contour extraction to obtain a second contour point set;
[0010] (4) for the contour of the vertebrae with two ends adhered to each other in the second contour point set, the minimum horizontal rectangle and the minimum circumscribed rectangle are used to detect the contour of the vertebrae with two ends adhered to each other, so as to complete the segmentation of the vertebrae with two ends adhered to each other;
[0011] (5) for the X-ray segmentation image after the segmentation of the cones with adhesions at both ends is completed, a third contour extraction is performed using the tracking algorithm to obtain a spine contour without adhesions;
[0012] (6) Based on the spine contour without adhesion, the minimum circumscribed rectangle is used to fit the spine boundary and corner point information.
[0013] Furthermore, the tracking algorithm adopts the Suzuki tracking algorithm.
[0014] Furthermore, the one-end-adhered cones have only one end of the side surface of the adjacent cones adhered to each other; and the two-end-adhered cones have both ends of the side surface of the adjacent cones adhered to each other.
[0015] Furthermore, in step (2), the Graham algorithm is used to perform the convex hull defect detection, and the segmentation of the cone with one end adhered is specifically as follows:
[0016] (2.1) Place all points of the one-end adhesion cone contour in the Cartesian coordinate system, and select the point with the smallest ordinate as the reference coordinate origin, denoted as P0;
[0017] (2.2) Calculate the argument of each point relative to P0, and sort them in ascending order according to the size of the argument. When the argument of two points is the same, they are sorted according to their distance to the origin, with the point closer in front. The sorted points are recorded as P1, P2, ... Pn;
[0018] (2.3) Put the first point P0 and the second point P1 into the convex hull stack, and let P2 be the current point;
[0019] (2.4) Draw a directed line L based on the first two points on the stack, record Px-1->Px to determine whether the current point is on the right or left side of the directed line L; if it is on the right side of the directed line, execute step (2.5); if it is on the directed line or on the left side of the line, execute step (2.6);
[0020] (2.5) If the top element of the current stack is not a point on the convex hull, remove the top element from the stack, keep the current point unchanged, and return to step (2.4);
[0021] (2.6) The current point is a point on the convex hull, push it into the stack, and continue with step (2.7);
[0022] (2.7) Check whether the current point is the last element of the result in step (2.2); if the current point is the last element, execute step (2.8); if not, use the next point as the new current point and return to step (2.4);
[0023] (2.8) All points in the convex hull stack are connected in order to obtain the convex hull;
[0024] (2.9) A convex hull defect is obtained based on the convex hull and the contour, and a line is connected between the starting point and the end point of the convex hull defect. The point on the convex hull defect that is farthest from the line is set as X0, and then the point on the opposite side of the contour that is closest to X0 is found. The two points are connected to complete the segmentation of the cone with one end stuck.
[0025] Furthermore, the segmentation of the vertebral bodies with adhesions at both ends in step (4) is specifically as follows:
[0026] (4.1) For each of the cone contours in the contours including the vertebral bodies adhered at both ends and the middle gap contour formed by the adhesion of the two ends, arrange them in order from top to bottom to form a contour point set;
[0027] (4.2) Construct the minimum horizontal rectangles of the i-th and i+1-th contours. If the minimum horizontal rectangle of the i+1-th contour is within the minimum horizontal rectangle of the i-th contour, then construct the minimum circumscribed rectangle of the i+1-th contour and calculate its rotation angle. If the minimum horizontal rectangle of the i-th contour is within the minimum horizontal rectangle of the i+1-th contour, then construct the minimum circumscribed rectangle of the i-th contour and calculate its rotation angle. Otherwise, execute step (4.5).
[0028] (4.3) Determine the rotation angle of the minimum circumscribed rectangle. If the rotation angle is positive, it is considered to be a clockwise rotation, and the upper left and lower right corner vertices of the minimum circumscribed rectangle are selected; otherwise, it is a counterclockwise rotation, and the lower left and upper right corner vertices of the minimum circumscribed rectangle are selected;
[0029] (4.4) Draw a line according to the two vertices selected in step (4.3), set the pixel values on the line to zero, and complete the segmentation of the vertebral body with adhesion at both ends;
[0030] (4.5) Let i=i+1, and repeat steps (4.2) to (4.4) to complete the segmentation of all the vertebrae with two ends adhered in the contour containing the vertebrae with two ends adhered.
[0031] Furthermore, the minimum circumscribed rectangle adopts a rotating caliper algorithm, specifically:
[0032] (4.1.1) Find the leftmost, rightmost, topmost and bottommost points of the contour, construct four tangent lines of the contour based on the four points, determine the rotating caliper, i.e. the circumscribed rectangle, and record the current circumscribed rectangle area and circumscribed rectangle position parameters;
[0033] (4.1.2) For all points in the contour, calculate the vector between each point and the next point, and calculate the inverse of the length of the vector, while recording the vector from the leftmost point to the rightmost point and the vector from the bottommost point to the topmost point;
[0034] (4.1.3) Calculate the cross product of the vector from the leftmost point to the rightmost point and the vector from the bottommost point to the topmost point to determine the direction of the point set;
[0035] (4.1.4) For a vertex on the rotating caliper, calculate the vector from it to the next vertex, and calculate the length of the projection of the vector in the direction of the rotating caliper;
[0036] (4.1.5) Find the vertex with the largest projection length and adjust the direction of the rotating caliper to the vector from this vertex to the next vertex;
[0037] (4.1.6) Update the vertex of the rotating caliper to the next vertex of the vertex with the largest projection length;
[0038] (4.1.7) Recalculate the area of the current bounding rectangle. If the current area is smaller than the previous area, update the area of the bounding rectangle and the parameters of the bounding rectangle.
[0039] (4.1.8) Repeat steps (4.1.4)-(4.1.7) until all vertices are updated. The bounding rectangle recorded at this time is the minimum bounding rectangle, and its rotation angle is the angle between the minimum bounding rectangle and the X-axis.
[0040] Furthermore, the minimum horizontal rectangle is specifically: finding the leftmost, rightmost, topmost and bottommost points in the contour, constructing two pairs of tangent lines in the x and y directions, and the rectangle formed by tangent lines to the above four endpoints is the minimum horizontal rectangle.
[0041] Beneficial effects of the present invention:
[0042] The present invention performs post-processing on spinal X-ray segmentation images using methods such as spine contour detection, convex hull detection, adhesion contour segmentation and minimum circumscribed rectangle fitting, thereby solving the adhesion problem between adjacent vertebrae, completing the clear segmentation of each vertebra, and obtaining boundary and corner point information at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1The figure is a flowchart diagram of a method for post-processing spinal X-ray segmentation images according to an embodiment of the present invention.
[0044] Figure 2 Schematic diagram of the pixel matrix of the spinal X-ray segmentation image according to an embodiment of the present invention.
[0045] Figure 3 Schematic diagram of the outer boundary and hole boundary of an embodiment of the present invention.
[0046] Figure 4 Schematic diagram of tracking algorithm iteration according to an embodiment of the present invention.
[0047] Figure 5 Schematic diagram of the Graham scanning method according to an embodiment of the present invention.
[0048] Figure 6 The diagram is a schematic diagram of splitting one end of the adhesion according to an embodiment of the present invention.
[0049] Figure 7 The figure is a schematic diagram of the process of splitting the two-end adhesion according to an embodiment of the present invention.
[0050] Figure 8 Schematic diagram of the minimum circumscribed rectangle (rotating caliper algorithm) result according to an embodiment of the present invention.
[0051] Fig. 9 Schematic diagram of calculating the vertices of the minimum circumscribed rectangle according to an embodiment of the present invention.
[0052] Fig.10 Schematic diagram of the minimum horizontal rectangle of an embodiment of the present invention. DETAILED DESCRIPTION
[0053] In order to make the technical means and effects achieved by the present invention simpler and clearer, the present invention is described in detail below with reference to the accompanying drawings and embodiments.
[0054] Currently, with the help of deep learning models, 17 vertebrae that need to measure the Cobb angle have been successfully identified. However, in order to solve the adhesion problem between adjacent cones on the binary images of the spine, these binary images still need to be post-processed to extract the edge or corner information of the spine.
[0055] Therefore, the embodiment of the present invention uses a series of post-processing technologies such as spine contour detection, convex hull detection, adhesion contour segmentation and minimum circumscribed rectangle fitting to propose a method for post-processing spinal X-ray segmentation images. Figure 1 As shown, the method includes:
[0056] S101 . For an X-ray segmented image, use a tracking algorithm to extract contours of the segmented image to obtain a first contour point set.
[0057] The tracking algorithm uses the Suzuki tracking algorithm, which can be used to detect shapes in binary images, such as edges, lines, and objects, and perform shape analysis, object recognition, and tracking operations through these contours. Due to the complexity of the hierarchical relationship of boundaries, each time a new boundary is found, it is assigned a unique digital label. In this way, all pixels with the same label value are classified as the same boundary, and the hierarchical relationship between different edges is preserved through their label values.
[0058] Figure 2 The pixel matrix of a single cone on a binary image is shown. The following uses this pixel matrix as an example to introduce the implementation process of the Suzuki tracking algorithm:
[0059] The concept of NBD is introduced as a label value to identify different boundaries. Meanwhile, the last number of border (LNBD) is used to indicate the number of the previous contour.
[0060] Scan line by line starting from the upper left corner. If you find Figure 3 The starting point of the boundary is considered to be found in two cases: (a) case indicates that the outer boundary is encountered; (b) case indicates that a hole is encountered.
[0061] The process of finding the boundary is as follows:
[0062] (1) Determine the boundary attributes of the pixel point (outer boundary or hole boundary):
[0063] (1.1) If the current pixel is the starting point of the outer boundary, the point is marked as the tracking starting point, NBD is incremented, and the position of the next point is recorded.
[0064] (1.2) If the current pixel is the starting point of the hole boundary, mark the point as the tracking starting point, increment NBD, and record the position of the next point. If the value of the current pixel is greater than 1, set LNBD to the opposite of the pixel value.
[0065] (1.3) If the current pixel is not a boundary point, ignore it and continue scanning the next point.
[0066] (2) Start boundary tracking based on the newly determined boundary type and LNBD.
[0067] (2.1) Starting from the point to the left of the tracking starting point, look for the first non-zero point clockwise around the tracking starting point. This point is the last point of the boundary.
[0068] (2.2) In the neighborhood of the tracking point, search for the first non-zero point in a counterclockwise direction. If the value of the point is 1 and the point to its right is non-zero, set its value to NBD; if the point to its right is zero, set its value to -NBD.
[0069] (2.3) If you return to the starting point, jump to step (3); otherwise, update the recorded point coordinates and continue to search for the next point.
[0070] (3) If the NBD value of the current pixel is not 1, LNBD is set to the absolute value of the current NBD value, and a new round of scanning starts from the next point. This process continues until the scan reaches the lower right corner of the image, and the algorithm terminates.
[0071] Figure 4 The algorithm is shown step by step in Figure 2 The result of one iteration above.
[0072] S102, performing convex hull defect detection on the contour of the cone with one end stuck in the first contour point set to complete the segmentation of the cone with one end stuck in.
[0073] For the first contour point set, find a contour containing a one-end-adhesive cone, where the one-end-adhesive cone is a cone between adjacent cones with only one end of the side surface being adhered.
[0074] The convex hull defect detection method is an important concept in computational geometry. Convex hull detection is often used after contour analysis. It can construct the convex hull of each contour and return the point set contained in the convex hull after the construction is completed. The convex hull corresponding to the contour can be drawn based on the calculated convex hull point set.
[0075] The convex hull is the smallest convex polygon that contains all given points. Therefore, the points on the convex hull must satisfy the following two conditions: 1) they are points in the given points; 2) they cannot be contained by other convex polygons.
[0076] Convex hull defect detection is performed using the Graham algorithm. The Graham scanning method is an algorithm based on polar angle sorting. The specific steps are as follows:
[0077] (1) Place all points of the contour of the cone with one end glued to it in the Cartesian coordinate system and select the point with the smallest ordinate as the origin of the reference coordinate system, such as Figure 5 P0 in.
[0078] Since p0 is the point with the smallest ordinate, it must lie on the convex hull.
[0079] (2) Calculate the argument of each point relative to the origin P0, and sort them in ascending order according to the size of the argument. When two points have the same argument, they are sorted according to their distance to the origin, with the point closer in front. Figure 5For example, the sorted point set is p1, p2, p3, p4, p5, p6, p7, p8.
[0080] (3) Put the first point P0 and the second point P1 into the convex hull stack, and let P2 be the current point.
[0081] p1 and p8 are the first and last points sorted from smallest to largest in terms of argument relative to p0. Their argument ranges include the argument ranges of all other points, so they must also be on the convex hull.
[0082] (4) Draw a directed line L based on the first two points on the stack, record Px-1->Px to determine whether the current point is on the right or left side of the directed line L; if it is on the right side of the directed line, execute step (5); if it is on the directed line or on the left side of the line, execute step (6).
[0083] (5) If the element at the top of the stack is not a point on the convex hull, remove the element from the stack, leaving the current point unchanged, and return to step (4).
[0084] (6) If the current point is a point on the convex hull, push it into the stack and continue with step (7).
[0085] (7) Check whether the current point is the last element of the result in step (2); if the current point is the last element, execute step (8); if not, take the next point as the new current point and return to step (4);
[0086] (8) All points in the convex hull stack are connected in sequence to obtain the convex hull.
[0087] like Figure 6 As shown in the figure, since the contour contains a cone with one end stuck, there is a convex hull defect in the convex hull. The area between the contour and the convex hull is the convex hull defect. Connect the starting point and the end point of the convex hull defect (Q5 and Q6), set the point on the contour of the convex hull defect that is farthest from the connecting line as X0 (P4), and then find the point on the opposite side of the contour that is closest to X0 (P7), connect the two points, set the pixel value on this line to zero, and complete the segmentation of the cone with one end stuck.
[0088] S103, for the X-ray film segmentation image after the segmentation of the cone with one end adhered, use the tracking algorithm to perform a second contour extraction to obtain a second contour point set.
[0089] After the segmentation of the cone with one end attached is completed, the Suzuki tracking algorithm is also used to perform a second contour extraction on the X-ray segmentation image.
[0090] S104 , for the contour of the second contour point set including the vertebral body with two ends adhered, use the minimum horizontal rectangle and the minimum circumscribed rectangle detection to complete the segmentation of the vertebral body with two ends adhered.
[0091] For the second contour point set, find a contour containing a cone with two ends adhered, where both ends of the side surfaces between adjacent cones are adhered.
[0092] like Figure 7 As shown in the figure, the steps for segmenting the vertebral bodies with adhesions at both ends are as follows:
[0093] (1) For each cone contour in the contour containing the vertebral bodies with two ends adhered together and the contour of the middle gap formed by the adhesion of the two ends, arrange them in sequence from top to bottom to form a contour point set;
[0094] (2) Construct the minimum horizontal rectangles of the i-th and i+1-th contours. If the minimum horizontal rectangle of the i+1-th contour is within the minimum horizontal rectangle of the i-th contour, then construct the minimum circumscribed rectangle of the i+1-th contour and calculate its rotation angle. If the minimum horizontal rectangle of the i-th contour is within the minimum horizontal rectangle of the i+1-th contour, then construct the minimum circumscribed rectangle of the i-th contour and calculate its rotation angle. Otherwise, execute step (5).
[0095] (3) Determine the rotation angle of the minimum circumscribed rectangle. If the rotation angle is positive, it is considered to be a clockwise rotation, and the upper left and lower right corners of the minimum circumscribed rectangle are selected; otherwise, it is a counterclockwise rotation, and the lower left and upper right corners of the minimum circumscribed rectangle are selected;
[0096] (4) Draw a line according to the two vertices selected in step (3), set the pixel values on the line to zero, and complete the segmentation of the vertebral body with two ends adhered;
[0097] (5) Let i=i+1 and repeat steps (2) to (4) to complete the segmentation of all the two-end-adhesion vertebrae in the contour containing the two-end-adhesion vertebrae.
[0098] Among them, the principle of the minimum circumscribed rectangle is mainly the rotating caliper algorithm. The rotating caliper algorithm obtains the minimum circumscribed moment by calculating the diameter of the convex hull. Its basic idea is to sort the points in the convex hull point set according to the polar angle, and then start from the point with the smallest polar angle, and calculate the distance between each point and the point behind it in turn until the two points with the farthest distance are found, that is, the diameter of the convex hull, and then the rectangle formed by the diagonal of these two points is used as the minimum rectangle. The specific implementation steps are as follows:
[0099] (1) Find the leftmost, rightmost, topmost, and bottommost points in the contour point set, such as Figure 8 p0, p1, p3, and p5 in the above equation. Based on these four points, two pairs of tangent lines in the x and y directions are constructed as the rotating caliper, i.e., the circumscribed rectangle, and the current circumscribed rectangle area and circumscribed rectangle position parameters are recorded;
[0100] (2) For each contour point, calculate the vector between it and the next point, and calculate the inverse of the length of the vector. At the same time, record the vector from the leftmost point to the rightmost point and the vector from the bottommost point to the topmost point, that is, and
[0101] (3) Calculate the cross product of the vector from the leftmost point to the rightmost point and the vector from the bottommost point to the topmost point to determine the direction of the point set (clockwise or counterclockwise).
[0102] (4) For each convex hull vertex on the rotating caliper, calculate the vector from it to the next convex hull vertex and calculate the length of the projection of the vector in the direction of the rotating caliper.
[0103] (5) Find the vertex with the largest projection length, such as Figure 8 P1 in . Adjust the direction of the rotating caliper to the vector from this vertex to the next vertex.
[0104] (6) Update the vertex of the rotating caliper to the next vertex of the vertex with the largest projection length.
[0105] (7) Recalculate the area of the circumscribed rectangle at this time. If the current area is smaller than the previous circumscribed rectangle area, update the circumscribed rectangle area and the parameters of the circumscribed rectangle.
[0106] (8) Repeat steps (4)-(7) until all vertices are updated. The bounding rectangle recorded at this time is the minimum bounding rectangle, and its rotation angle is the angle between the minimum bounding rectangle and the X-axis.
[0107] According to the previous rotating caliper algorithm, we can get the center coordinates, length, width and rotation angle of the minimum circumscribed rectangle, such as Fig. 9 (x,y), w, h and θ in .
[0108] The vertices p0, p1, p2, p3 of the minimum enclosing rectangle can be calculated Figure 8 L1, L2, L3, L4, L5, L6, L7 are obtained. L1, L2, L3, L4, L5, L6, L7 respectively satisfy the following formulas:
[0109]
[0110] The coordinates of p0 (x0, y0) satisfy:
[0111]
[0112] The coordinates of p1 (x1, y1) satisfy:
[0113]
[0114] The coordinates of p2 (x2, y2) satisfy:
[0115]
[0116] The coordinates of p3 (x3, y3) satisfy:
[0117]
[0118] The minimum horizontal rectangle is as follows: find the leftmost, rightmost, topmost and bottommost points in the contour, construct two pairs of tangent lines in the x and y directions, and the rectangle formed by the tangent lines to the above four endpoints is the minimum horizontal rectangle, as shown in Fig.10 shown.
[0119] S105, for the X-ray segmentation image after the segmentation of the cone with two ends adhered, use the tracking algorithm to perform a third contour extraction to obtain a spine contour without adhesion.
[0120] After the segmentation of the cones at both ends was completed, the Suzuki tracking algorithm was used to perform the third contour extraction on the X-ray segmentation image, and 17 vertebrae were obtained.
[0121] S106 , according to the spine contour without adhesion, use the minimum circumscribed rectangle to fit the spine boundary and corner point information.
[0122] For the segmented X-ray film, the above minimum circumscribed rectangle method is also used for fitting to obtain the boundary and corner point information of 17 vertebrae.
[0123] Although the content of the present invention has been described in detail through the above preferred embodiments, it should be appreciated that the above description should not be considered as a limitation of the present invention. After reading the above content, it will be apparent to those skilled in the art that various modifications and substitutions of the present invention can be made. Therefore, the protection scope of the present invention should be limited by the attached claims.
Claims
1. A method for post-processing spinal X-ray segmentation images, characterized in that: The steps include: (1) For the X-ray segmentation image, a tracking algorithm is used to extract the contour to obtain a first contour point set; (2) performing convex hull defect detection on the contour of the one-end sticking cone in the first contour point set to complete the segmentation of the one-end sticking cone; (3) for the X-ray film segmentation image after the segmentation of the cone with one end adhered, use the tracking algorithm to perform a second contour extraction to obtain a second contour point set; (4) for the contour of the vertebrae with two ends adhered to each other in the second contour point set, the minimum horizontal rectangle and the minimum circumscribed rectangle are used to detect the contour of the vertebrae with two ends adhered to each other, so as to complete the segmentation of the vertebrae with two ends adhered to each other; (5) for the X-ray segmentation image after the segmentation of the cones with adhesions at both ends is completed, a third contour extraction is performed using the tracking algorithm to obtain a spine contour without adhesions; (6) Based on the spine contour without adhesion, the minimum circumscribed rectangle is used to fit the spine boundary and corner point information.
2. The method for post-processing spinal X-ray segmentation images according to claim 1, characterized in that: The tracking algorithm adopts the Suzuki tracking algorithm.
3. The method for post-processing spinal X-ray segmentation images according to claim 1, characterized in that: The one-end adhesion cone is an adhesion between adjacent vertebrae at only one end on the side; The two-end adhesion cone is formed by adhesion of both ends of the side surfaces between adjacent vertebrae.
4. The method for post-processing spinal X-ray segmentation images according to claim 1, characterized in that: In step (2), the Graham algorithm is used to perform the convex hull defect detection, and the segmentation of the cone with one end adhered is specifically as follows: (2.1) Place all points of the one-end adhesion cone contour in the Cartesian coordinate system, and select the point with the smallest ordinate as the reference coordinate origin, denoted as P0; (2.2) Calculate the argument of each point relative to P0, and sort them in ascending order according to the size of the argument. When the argument of two points is the same, they are sorted according to their distance to the origin, with the point closer in front. The sorted points are recorded as P1, P2, ... Pn; (2.3) Put the first point P0 and the second point P1 into the convex hull stack, and let P2 be the current point; (2.4) Draw a directed line L based on the first two points on the stack, record Px-1->Px to determine whether the current point is on the right or left side of the directed line L; if it is on the right side of the directed line, execute step (2.5); if it is on the directed line or on the left side of the line, execute step (2.6); (2.5) If the top element of the current stack is not a point on the convex hull, remove the top element from the stack, keep the current point unchanged, and return to step (2.4); (2.6) The current point is a point on the convex hull, push it into the stack, and continue with step (2.7); (2.7) Check whether the current point is the last element of the result in step (2.2); if the current point is the last element, execute step (2.8); if not, use the next point as the new current point and return to step (2.4); (2.8) All points in the convex hull stack are connected in order to obtain the convex hull; (2.9) A convex hull defect is obtained based on the convex hull and the contour, and a line is connected between the starting point and the end point of the convex hull defect. The point on the convex hull defect that is farthest from the line is set as X0, and then the point on the opposite side of the contour that is closest to X0 is found. The two points are connected to complete the segmentation of the cone with one end stuck.
5. The method for post-processing spinal X-ray segmentation images according to claim 1, characterized in that: The step (4) of segmenting the vertebral bodies with adhesions at both ends is specifically as follows: (4.1) For each of the cone contours in the contours including the vertebral bodies adhered at both ends and the middle gap contour formed by the adhesion of the two ends, arrange them in order from top to bottom to form a contour point set; (4.2) Construct the minimum horizontal rectangles of the i-th and i+1-th contours. If the minimum horizontal rectangle of the i+1-th contour is within the minimum horizontal rectangle of the i-th contour, then construct the minimum circumscribed rectangle of the i+1-th contour and calculate its rotation angle. If the minimum horizontal rectangle of the i-th contour is within the minimum horizontal rectangle of the i+1-th contour, then construct the minimum circumscribed rectangle of the i-th contour and calculate its rotation angle. Otherwise, execute step (4.5). (4.3) Determine the rotation angle of the minimum circumscribed rectangle. If the rotation angle is positive, it is considered to be a clockwise rotation, and the upper left and lower right corner vertices of the minimum circumscribed rectangle are selected; otherwise, it is a counterclockwise rotation, and the lower left and upper right corner vertices of the minimum circumscribed rectangle are selected; (4.4) Draw a line according to the two vertices selected in step (4.3), set the pixel values on the line to zero, and complete the segmentation of the vertebral body with adhesion at both ends; (4.5) Let i=i+1, and repeat steps (4.2) to (4.4) to complete the segmentation of all the vertebrae with two ends adhered in the contour containing the vertebrae with two ends adhered.
6. The method for post-processing spinal X-ray segmentation images according to claim 1, characterized in that: The minimum circumscribed rectangle adopts the rotating caliper algorithm, which is specifically: (4.1.1) Find the leftmost, rightmost, topmost and bottommost points of the contour, construct four tangent lines of the contour based on the four points, determine the rotating caliper, i.e. the circumscribed rectangle, and record the current circumscribed rectangle area and circumscribed rectangle position parameters; (4.1.2) For all points in the contour, calculate the vector between each point and the next point, and calculate the inverse of the length of the vector, while recording the vector from the leftmost point to the rightmost point and the vector from the bottommost point to the topmost point; (4.1.3) Calculate the cross product of the vector from the leftmost point to the rightmost point and the vector from the bottommost point to the topmost point to determine the direction of the point set; (4.1.4) For a vertex on the rotating caliper, calculate the vector from it to the next vertex, and calculate the length of the projection of the vector in the direction of the rotating caliper; (4.1.5) Find the vertex with the largest projection length and adjust the direction of the rotating caliper to the vector from this vertex to the next vertex; (4.1.6) Update the vertex of the rotating caliper to the next vertex of the vertex with the largest projection length; (4.1.7) Recalculate the area of the current bounding rectangle. If the current area is smaller than the previous area, update the area of the bounding rectangle and the parameters of the bounding rectangle. (4.1.8) Repeat steps (4.1.4)-(4.1.7) until all vertices are updated. The bounding rectangle recorded at this time is the minimum bounding rectangle, and its rotation angle is the angle between the minimum bounding rectangle and the X-axis.
7. The method for post-processing spinal X-ray segmentation images according to claim 1, characterized in that: The minimum horizontal rectangle is specifically: find the leftmost, rightmost, topmost and bottommost points in the contour, construct two pairs of tangent lines in the x and y directions, and the rectangle formed by tangent lines to the above four endpoints is the minimum horizontal rectangle.