Method and device for analyzing angiographic images
By performing image processing and topological refinement on angiographic images, the vascular centerline is obtained and the stenosis rate is calculated, which solves the problem of low analysis accuracy caused by reliance on manual experience in existing technologies and achieves more accurate quantitative analysis of stenosis rate.
Patent Information
- Application Number
- CN202210017847.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-07
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2042-01-07
AI Technical Summary
In the prior art, quantitative analysis of stenosis rate in angiography images relies on manual experience, resulting in low analysis accuracy and being easily affected by the skill level of the personnel.
By performing image extraction, binarization, vascular edge extraction and topological refinement on angiography images, the vascular centerline is obtained, the diameter of each point is measured and the stenosis rate is calculated, reducing dependence on manual experience.
The accuracy of angiography image analysis is improved, the influence of manual experience on the results is reduced, and the precision of data analysis is improved.
Smart Images

Figure CN114418976B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a method and device for analyzing angiographic images. Background Art
[0002] Quantitative coronary arteriography (QCA) analysis of vascular stenosis rates in coronary angiography images, also known as qualitative comparative analysis, can provide information such as the vessel diameter and stenosis rate of the stenotic segment. Conventional QCA analysis relies on manual marking of stenotic segments in angiography images based on human experience. These manually marked points are then measured and calculated using an image ruler to obtain information such as the diameter and stenosis rate of the stenotic segment. This method relies heavily on manual experience, often resulting in analysis failures or low analysis accuracy due to insufficient human experience and inaccurate image selection. Summary of the Invention
[0003] The present invention addresses the shortcomings of the prior art by providing a method, device, electronic device, and computer-readable storage medium for analyzing angiographic images. The method first extracts the stenotic segment of the angiographic image and binarizes the extracted image. The binary image is then used to extract the vessel edges to obtain a vessel image. A topological thinning method is then used to extract the vessel centerline from the vessel image. Based on the geometric relationship between the extracted vessel centerline and the vessel edge, the diameter of each point on the centerline is measured. Based on the obtained diameters at each point, the rate of change in diameter at each point is calculated as the corresponding vessel stenosis rate. This method eliminates reliance on manual experience and improves data analysis accuracy.
[0004] To achieve the above-mentioned object, a first aspect of an embodiment of the present invention provides a method for analyzing angiographic images, the method comprising:
[0005] Acquire angiographic images;
[0006] Detecting a vascular stenosis site on the angiography image, and using a sub-image of the detected stenosis site as a first image;
[0007] performing binarization and image noise reduction processing on the first image to generate a first binary image;
[0008] performing blood vessel recognition processing on the first binary image to generate a corresponding blood vessel image;
[0009] Without changing the topological properties of the vascular image, performing centerline extraction processing on the vascular image of the first binary image based on a topological thinning method to generate a first centerline;
[0010] sorting the pixels on the first center line in a direction from one end point to the other end point of the first center line to generate a first pixel point sequence; the first pixel point sequence includes a plurality of first pixel points;
[0011] According to the blood vessel image, the blood vessel diameter at each of the first pixel points is measured to generate a corresponding first diameter; and the first diameters are sorted in the order of the corresponding first pixel points to generate a first diameter sequence;
[0012] identifying the vascular stenosis rate at each of the first pixel points according to the first diameter sequence to generate a corresponding first stenosis rate; and sorting the first stenosis rates according to the sorting order of the corresponding first pixel points to generate a first stenosis rate sequence;
[0013] The first pixel point sequence, the first diameter sequence, and the first stenosis rate sequence are returned as vascular stenosis analysis data of the angiography image.
[0014] Preferably, the performing binarization and image noise reduction on the first image to generate a first binary image specifically includes:
[0015] Binarization is performed on the first image to generate a corresponding binary image; the pixels of the binary image include foreground pixels and background pixels; the pixel values of the foreground pixels are preset foreground pixel values A, and the pixel values of the background pixels are preset background pixel values B;
[0016] Based on the image closing operation principle of image morphology, an image closing operation is performed on the binary image by first dilation and then erosion, and the operation result is used as the first binary image.
[0017] Preferably, the performing blood vessel recognition processing on the first binary image to generate a corresponding blood vessel image specifically includes:
[0018] Traversing each pixel point on the first binary image whose pixel value is a preset foreground pixel value A; during the traversal, obtaining the pixel values of the eight neighboring pixels of the currently traversed pixel point to generate a corresponding first pixel value set; if at least one pixel value in the first pixel value set is consistent with a preset background pixel value B, marking the currently traversed pixel point as an edge point;
[0019] On the first binary image, the edge points are sequentially connected in a clockwise or counterclockwise direction to form a closed blood vessel edge line; and the blood vessel edge line and the sub-image within the edge line are used as the corresponding blood vessel image.
[0020] Preferably, the step of measuring the blood vessel diameter at each of the first pixel points based on the blood vessel image to generate the corresponding first diameter specifically includes:
[0021] Four straight lines are drawn through each of the first pixel points along four directions connected to the eight area pixel points thereof, respectively intersecting with the blood vessel edge lines of the blood vessel image, thereby obtaining four corresponding intersecting line segments; and a length of the shortest intersecting line segment among the four intersecting line segments is calculated, and the calculated result is used as the first diameter corresponding to the current first pixel point.
[0022] Preferably, the step of identifying the vascular stenosis rate at each of the first pixel points according to the first diameter sequence and generating the corresponding first stenosis rate specifically includes:
[0023] A two-dimensional coordinate space is constructed with the pixel index of the first center line as the horizontal axis and the blood vessel diameter corresponding to the pixel as the vertical axis, and is recorded as a first coordinate space;
[0024] Using the pixel point index of each first pixel point on the first center line as the horizontal axis coordinate and the corresponding first diameter as the vertical axis coordinate, mark the corresponding coordinate point in the first coordinate space as the first coordinate point;
[0025] Connecting the first coordinate points in sequence to obtain a first diameter change curve;
[0026] Connecting the first and last of the first coordinate points with a straight line to obtain a first diameter reference line;
[0027] Draw a perpendicular line to the horizontal axis of the first coordinate space through each of the first coordinate points, and record the vertical coordinate value of the blood vessel diameter at the intersection of the perpendicular line to the horizontal axis and the first diameter reference line as the corresponding first reference diameter;
[0028] The first stenosis rate r corresponding to each first pixel point is calculated, where r=(1-d1 / d2)×100%, d1 is the first diameter corresponding to each first pixel point, and d2 is the first reference diameter corresponding to each first pixel point.
[0029] A second aspect of the embodiments of the present invention provides a device for implementing the method described in the first aspect, comprising: an acquisition module, an image preprocessing module, a centerline extraction module, and a data analysis module;
[0030] The acquisition module is used to acquire angiography images;
[0031] The image preprocessing module is configured to detect vascular stenosis sites on the angiography image and use the detected stenosis site sub-image as a first image; perform binarization and image noise reduction on the first image to generate a first binary image; and perform vessel recognition on the first binary image to generate a corresponding vessel image;
[0032] The centerline extraction module is configured to perform centerline extraction processing on the blood vessel image of the first binary image based on a topological thinning method to generate a first centerline without changing the topological properties of the blood vessel image; and to sort the pixels on the first centerline in a direction from one end point to the other end point of the first centerline to generate a first pixel point sequence; the first pixel point sequence includes a plurality of first pixel points;
[0033] The data analysis module is configured to measure, based on the vascular image, the diameter of the blood vessel at each of the first pixel points to generate a corresponding first diameter; sort the first diameters in a sorting order of the corresponding first pixel points to generate a first diameter sequence; identify, based on the first diameter sequence, the vascular stenosis rate at each of the first pixel points to generate a corresponding first stenosis rate; sort the first stenosis rates in a sorting order of the corresponding first pixel points to generate a first stenosis rate sequence; and return the first pixel sequence, the first diameter sequence, and the first stenosis rate sequence as vascular stenosis analysis data of the angiography image.
[0034] A third aspect of an embodiment of the present invention provides an electronic device, including: a memory, a processor, and a transceiver;
[0035] The processor is configured to be coupled to the memory, read and execute instructions in the memory, so as to implement the method steps described in the first aspect above;
[0036] The transceiver is coupled to the processor, and the processor controls the transceiver to send and receive messages.
[0037] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed by a computer, the computer executes the instructions of the method described in the first aspect above.
[0038] Embodiments of the present invention provide a method, apparatus, electronic device, and computer-readable storage medium for analyzing angiographic images. The method first extracts the stenotic segment of a blood vessel from the angiographic image and binarizes the extracted image. The binary image is then used to extract the vessel edges to obtain a vessel image. A topological thinning method is then used to extract the vessel centerline from the vessel image. Based on the geometric relationship between the extracted vessel centerline and the vessel edge, the diameter of each point on the centerline is measured. Based on the obtained diameters of each point, the rate of change of the diameter at each point is calculated as the corresponding vessel stenosis rate. This method eliminates reliance on manual experience and improves data analysis accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A schematic diagram of a method for analyzing angiographic images provided in Example 1 of the present invention;
[0040] Figure 2 A schematic diagram of a first coordinate space provided in Example 1 of the present invention;
[0041] Figure 3 This is a module structure diagram of a device for analyzing angiographic images provided in the second embodiment of the present invention;
[0042] Figure 4 This is a structural diagram of an electronic device provided in Example 3 of the present invention. DETAILED DESCRIPTION
[0043] To make the objectives, technical solutions, and advantages of the present invention more apparent, the present invention will be further described in detail below with reference to the accompanying drawings. It should be understood that the embodiments described herein are merely some, rather than all, of the present invention. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without inventive effort are intended to fall within the scope of protection of the present invention.
[0044] A method for analyzing angiographic images is provided in a first embodiment of the present invention. Figure 1 A schematic diagram of a method for analyzing angiographic images provided in Example 1 of the present invention is shown. The method mainly includes the following steps:
[0045] Step 1: Acquire angiographic images.
[0046] Here, the angiography image may be a coronary artery angiography image, or an angiography image of other parts or other types of blood vessels.
[0047] Step 2: Detect vascular stenosis on the angiography image, and use the sub-image of the detected stenosis as the first image.
[0048] Here, an embodiment of the present invention uses a target detection model based on machine deep learning technology to detect vascular stenosis in angiography images and output a corresponding target detection frame. The sub-image covered by the target detection frame is extracted and used as the stenosis sub-image, that is, the first image.
[0049] Step 3: performing binarization and image noise reduction processing on the first image to generate a first binary image;
[0050] Here, the recognition accuracy of blood vessel edges can be improved by binarization and image denoising;
[0051] Specifically comprising: step 31, performing binarization processing on the first image to generate a corresponding binarized image;
[0052] The pixels of the binary image include foreground pixels and background pixels; the pixel value of the foreground pixel is a preset foreground pixel value A, and the pixel value of the background pixel is a preset background pixel value B;
[0053] Here, the foreground pixel value A is generally preset to a white grayscale value, and the background pixel value B is generally preset to a black grayscale value; of course, based on design needs, the foreground pixel value A and the background pixel value B can also be set to binary values, for example, using a 0 / 1 binary value to set the foreground pixel value A to 1 and the background pixel value B to 0;
[0054] Step 32: Based on the image closing operation principle of image morphology, perform an image closing operation of first dilation and then erosion on the binary image, and use the operation result as the first binary image.
[0055] Here, the principle of image closing operation in image morphology is to first perform image dilation processing on the image, and then perform image erosion processing. The purpose is to fill the internal holes of the graphics in the original image and make the edges of the graphics smoother without significantly changing the area of each graphic. For the specific implementation principles of image closing operation, image dilation and image erosion, please refer to the relevant technical implementation, and will not be detailed here.
[0056] Step 4: performing blood vessel recognition processing on the first binary image to generate a corresponding blood vessel image;
[0057] Specifically, the step 41 includes traversing each pixel point on the first binary image whose pixel value is a preset foreground pixel value A; during the traversal, obtaining the pixel values of the eight neighboring pixels of the currently traversed pixel point to generate a corresponding first pixel value set; if at least one pixel value in the first pixel value set is consistent with a preset background pixel value B, marking the currently traversed pixel point as an edge point;
[0058] Here, the so-called eight area pixel points are actually eight pixel points, namely, the upper left neighboring pixel point, the upper neighboring pixel point, the upper right neighboring pixel point, the right neighboring pixel point, the lower right neighboring pixel point, the lower left neighboring pixel point, and the left neighboring pixel point of a certain pixel point in the image. In the embodiment of the present invention, when determining whether a foreground pixel point, that is, a pixel point with a pixel value of a preset foreground pixel value A, is an edge point, whether the eight area pixel points include background pixels is identified. As long as one of the eight area pixel points is a background pixel point, that is, the pixel value is a background pixel value B, then the pixel point currently being determined is an edge point.
[0059] Step 42: On the first binary image, edge points are sequentially connected in a clockwise or counterclockwise direction to form a closed blood vessel edge line; and the blood vessel edge line and the sub-image within the edge line are used as the corresponding blood vessel image.
[0060] Step 5: performing centerline extraction processing on the blood vessel image of the first binary image based on a topological thinning method to generate a first centerline without changing the topological properties of the blood vessel image;
[0061] Here, the topological properties of vascular images mainly refer to the connectivity of blood vessels;
[0062] Specifically, it includes: step 51, creating a connectivity judgment rule that maintains the topological properties of the blood vessel image;
[0063] Here, the connectivity judgment rule includes multiple sub-rules, each of which corresponds to one or more 3×3 pixel value template matrices;
[0064] Step 52, copying the first binary image to generate a corresponding second binary image, and recording the blood vessel image region on the second binary image as the blood vessel image region;
[0065] Step 53: Based on the topological shape rule, the pixels in each row of the second binary image are traversed from left to right, and the pixels that do not meet the connectivity judgment rule are marked as non-essential pixels. After completing a traversal of all the pixels in the second binary image, the non-essential pixels whose pixel value is the foreground pixel value A are recorded as newly added background pixels, and the pixel values of all newly added background pixels are set to the background pixel value B. The number of newly added background pixels is counted to obtain a newly added number. If the newly added number is not 0, the pixels in each row of the second binary image after the setting are traversed again from left to right until the newly added number obtained by the traversal is 0. Finally, all the pixels in the blood vessel image area of the second binary image whose pixel value is the foreground pixel value A are marked as necessary pixels.
[0066] Here, the newly added background pixel point is a pixel point whose newly added pixel value is the background pixel value B;
[0067] When traversing each pixel point, the pixel values of the current traversed pixel point and its corresponding eight-area pixel points are extracted to form a 3×3 pixel value matrix recorded as the traversed point pixel matrix. This traversed point pixel matrix is then compared one by one with the template matrices of each sub-rule of the connectivity judgment rule. It should be noted that if the current traversed pixel point is an image boundary pixel point, its eight-area pixel points may be missing. In this case, when constructing the traversed point pixel matrix, the pixel value of the missing point is set to the background pixel value B by default.
[0068] When comparing the traversal point pixel matrix with the template matrix of each sub-rule one by one, when the traversal point pixel matrix completely overlaps with the template matrix of any sub-rule, the current traversal pixel corresponding to the current traversal point pixel matrix is considered to satisfy the connectivity judgment rule. That is, if deleting the current traversal pixel will affect the topological connectivity of the vascular image, the pixel should not be marked as a non-essential pixel. When the traversal point pixel matrix does not overlap with the template matrix of any sub-rule, the current traversal pixel corresponding to the current traversal point pixel matrix is considered to not satisfy the connectivity judgment rule. That is, if deleting the current traversal pixel will not affect the topological connectivity of the vascular image, the pixel should be marked as a non-essential pixel.
[0069] For example, the preset connectivity judgment rule includes the following 5 sub-rules:
[0070] Sub-rule 1: The pixel value template matrix is A is the preset foreground pixel value; this rule specifies that if the traversal point pixel matrix is consistent with the template matrix of the current rule, deleting the current traversal pixel point (corresponding to the center point of the template matrix) will cause holes to appear, thereby affecting the connectivity of the image topology.
[0071] Sub-rule 2: The pixel value template matrix is B is the preset background pixel value; this rule specifies that if the traversal point pixel matrix is consistent with the template matrix of the current rule, deleting the current traversal pixel point (corresponding to the center point of the template matrix) will cause a fault in the upper and lower layers, thereby affecting the connectivity of the image topology.
[0072] Sub-rule 3: The pixel value template matrix is This rule specifies that if the traversal point pixel matrix is consistent with the template matrix of the current rule, deleting the current traversal pixel point (corresponding to the center point of the template matrix) will cause holes to appear, thus affecting the connectivity of the image topology.
[0073] Sub-rule 4: The pixel value template matrix is This rule specifies that if the traversal point pixel matrix is consistent with the template matrix of the current rule, deleting the current traversal pixel point (corresponding to the center point of the template matrix) will cause the upper layer endpoints to be reduced, thereby losing the endpoints of the image connected shape and affecting the connectivity of the image topology properties;
[0074] Sub-rule 5: The pixel value template matrix includes and This rule specifies that if the traversal point pixel matrix is consistent with the template matrix of the current rule, deleting the current traversal pixel point (corresponding to the center point of the template matrix) will cause the connected endpoints to be eliminated, thereby losing the endpoints of the connected shape of the image and affecting the connectivity of the image topology properties;
[0075] If the overall pixel distribution structure of the second binary image is in It is the pixel point of the blood vessel image; perform the first traversal of the pixel points in each row of the second binary image from left to right:
[0076] The first pixel from the left of the first row is a boundary point. By default, the pixel values of the missing points (lower left, left, upper left, upper and upper right) in the eight-area pixel area are set to B, and the corresponding traversal point pixel matrix is The pixel value template matrices of sub-rules 1, 2, 3, 4, and 5 are compared with the traversal point pixel matrices in sequence. If they do not overlap, the first pixel from the left of the first row is considered to be a pixel that does not meet the connectivity judgment rule and is marked as a non-essential pixel. Similarly, the traversal point pixel matrices of the remaining pixels in the first row cannot overlap with the pixel value template matrices of sub-rules 1, 2, 3, 4, and 5, so all pixels in the first row are marked as non-essential pixels.
[0077] Similarly, the traversal point pixel matrices of all pixels in the second row cannot coincide with the pixel value template matrices of sub-rules 1, 2, 3, 4, and 5, so all pixels in the second row are marked as unnecessary pixels;
[0078] The traversal point pixel matrix of the 1st and 2nd pixel points in the 3rd row cannot overlap with the pixel value template matrix of sub-rules 1, 2, 3, 4, and 5, so the 1st and 2nd pixel points in the 3rd row are marked as unnecessary pixels; and the traversal point pixel matrix of the 3rd pixel point in the 3rd row is If the pixel value template matrix of the traversed pixel point coincides with that of sub-rule 1, the 3rd pixel point in the 3rd row is considered to satisfy the connectivity judgment rule and is not marked as a non-essential pixel point. The traversed pixel matrix of the 4th and 5th pixels in the 3rd row cannot coincide with the pixel value template matrix of sub-rules 1, 2, 3, 4, and 5, so the 4th and 5th pixels in the 3rd row are both marked as non-essential pixels.
[0079] The traversal point pixel matrices of the 1st, 2nd, 4th, and 5th pixels in the 4th row cannot overlap with the pixel value template matrices of sub-rules 1, 2, 3, 4, and 5. Therefore, the 1st, 2nd, 4th, and 5th pixels in the 4th row are all marked as unnecessary pixels. The 3rd pixel in the 4th row is similar to the 3rd pixel in the 3rd row, and their corresponding traversal point pixel matrices are The pixel value template matrix of sub-rule 1 coincides with the pixel value template matrix of sub-rule 1, so the third pixel in the fourth row satisfies the connectivity judgment rule and is not marked as a non-essential pixel.
[0080] The traversal point pixel matrices of all pixels in the 5th and 6th rows cannot overlap with the pixel value template matrices of sub-rules 1, 2, 3, 4, and 5, so all pixels in the 5th and 6th rows are marked as unnecessary pixels;
[0081] After processing the last pixel in the 6th row, the first traversal of the second binary image is completed. The unnecessary pixels with the foreground pixel value A are recorded as new background pixels and the pixel values of all new background pixels are set to the background pixel value B. The new second binary image is obtained as The number of newly added background pixels is counted and the number of newly added background pixels is 10. Because the number of newly added background pixels 10 is greater than 0, it is necessary to traverse the pixels in each row of the second binary image from left to right for the second time:
[0082] The traversal point pixel matrices of all pixels in the 1st and 2nd rows cannot overlap with the pixel value template matrices of sub-rules 1, 2, 3, 4, and 5, so all pixels in the 1st and 2nd rows are marked as unnecessary pixels;
[0083] The traversal point pixel matrix of the third pixel in the third row is If it coincides with one of the pixel value template matrices of sub-rule 5, the current traversed pixel, that is, the third pixel in the third row, is considered to satisfy the connectivity judgment rule and is not marked as a non-essential pixel. The traversed point pixel matrices of all pixels except the third pixel in the third row cannot coincide with the pixel value template matrices of sub-rules 1, 2, 3, 4, and 5, so all pixels except the third pixel in the third row are marked as non-essential pixels.
[0084] The traversal point pixel matrix of the third pixel in the fourth row is If it coincides with one of the pixel value template matrices of sub-rule 5, the current traversed pixel, that is, the third pixel in the fourth row, is considered to satisfy the connectivity judgment rule and is not marked as a non-essential pixel. The traversed point pixel matrices of all pixels except the third pixel in the fourth row cannot coincide with the pixel value template matrices of sub-rules 1, 2, 3, 4, and 5, so all pixels except the third pixel in the fourth row are marked as non-essential pixels.
[0085] The traversal point pixel matrices of all pixels in the 5th and 6th rows cannot overlap with the pixel value template matrices of sub-rules 1, 2, 3, 4, and 5, so all pixels in the 5th and 6th rows are marked as unnecessary pixels;
[0086] After processing the last pixel in the 6th row, the first traversal of the second binary image is completed. The unnecessary pixels with the foreground pixel value A are recorded as new background pixels and the pixel values of all new background pixels are set to the background pixel value B. The new second binary image is obtained as This is the same as the binary image after the first traversal. The corresponding number of newly added background pixels is 0. In this case, there is no need to traverse the second binary image again. Instead, all pixels in the blood vessel image area on the final second binary image with the foreground pixel value A are marked as necessary pixels. That is, the third pixel in the third row and the third pixel in the fourth row are marked as necessary pixels.
[0087] Step 54 : Based on the one-to-one correspondence between the pixels of the second binary image and the pixels of the first binary image, sequentially connect the pixels corresponding to the necessary pixels on the first binary image, and use the connecting lines as the first center lines.
[0088] Here, taking step 53 as an example, that is, the third pixel point in the third row and the third pixel point in the fourth row in the first binary image are connected to obtain the first center line.
[0089] It should be noted that, because the original image of the first binary image, that is, the first image, is a local segmentation image of the angiography image, the influence of the segmentation angle may cause the cutting angles at both ends of the blood vessel in the first binary image to be not perpendicular to the direction of the blood vessel, which may cause the positioning of the centerline pixel points at the two ends of the blood vessel to deviate; therefore, after step 54, the positioning accuracy of the pixel points on the first centerline can be improved by deleting a specified proportion of points at both ends of the first centerline, thereby achieving the purpose of improving the positioning accuracy of the first centerline.
[0090] Step 6: Sort the pixels on the first center line in a direction from one end point to the other end point of the first center line to generate a first pixel sequence;
[0091] The first pixel point sequence includes a plurality of first pixel points.
[0092] Step 7: According to the blood vessel image, the blood vessel diameter at each first pixel point is measured to generate a corresponding first diameter; and the first diameters are sorted according to the sorting order of the corresponding first pixel points to generate a first diameter sequence.
[0093] Furthermore, based on the vascular image, the vascular diameter at each first pixel point is measured to generate a corresponding first diameter, specifically including: drawing four straight lines through each first pixel point along four directions connected to its eight area pixel points, respectively intersecting with the vascular edge line of the vascular image, thereby obtaining four corresponding intersecting line segments; and calculating the segment length of the shortest intersecting line segment among the four intersecting line segments, and using the calculated result as the first diameter corresponding to the current first pixel point.
[0094] Here, the four straight lines are line 1 passing through the upper left adjacent pixel point, the first pixel point, and the lower right adjacent pixel point, line 2 passing through the upper adjacent pixel point, the first pixel point, and the lower adjacent pixel point, line 3 passing through the upper right adjacent pixel point, the first pixel point, and the lower left adjacent pixel point, and line 4 passing through the right adjacent pixel point, the first pixel point, and the left adjacent pixel point. The intersections of lines 1, 2, 3, and 4 with the edges of the blood vessels at both ends of the center line are recorded as intersection segments 1, 2, 3, and 4. The length of the shortest of the intersection segments 1, 2, 3, and 4 is taken as the first diameter.
[0095] Step 8: Identify the vascular stenosis rate at each first pixel point according to the first diameter sequence to generate a corresponding first stenosis rate; and sort the first stenosis rates according to the sorting order of the corresponding first pixel points to generate a first stenosis rate sequence.
[0096] Furthermore, based on the first diameter sequence, the vascular stenosis rate at each first pixel point is identified to generate a corresponding first stenosis rate, specifically comprising: constructing a two-dimensional coordinate space, recorded as the first coordinate space, with the pixel point index of the first centerline as the horizontal axis and the vascular diameter corresponding to the pixel point as the vertical axis; marking the corresponding coordinate point in the first coordinate space, recorded as the first coordinate point, with the pixel point index of each first pixel point on the first centerline as the horizontal axis coordinate and the corresponding first diameter as the vertical axis coordinate; sequentially connecting each first coordinate point to obtain a first diameter change curve; connecting the first and last first coordinate points with a straight line to obtain a first diameter reference line; drawing a perpendicular line to the horizontal axis of the first coordinate space through each first coordinate point, and recording the vascular diameter vertical coordinate value at the intersection of the perpendicular line and the first diameter reference line as the corresponding first reference diameter; and calculating the first stenosis rate r corresponding to each first pixel point, where r = (1-d1 / d2) × 100%, where d1 is the first diameter corresponding to each first pixel point, and d2 is the first reference diameter corresponding to each first pixel point.
[0097] Here, with Figure 2Taking the first coordinate space diagram provided in Example 1 of the present invention as an example, the first pixel on the first centerline with a pixel index of x1 corresponds to a first diameter of y1, and the corresponding first coordinate point in the first coordinate space is P1(x1, y1). The intersection of a perpendicular line drawn from the first coordinate point P1(x1, y1) and the first diameter reference line is P2(x1, y2), and the vertical coordinate value of the blood vessel diameter is y2. Therefore, the first stenosis rate corresponding to the first pixel on the first centerline with a pixel index of x1 is r = (1-d1 / d2) × 100% = (1-y1 / y2) × 100%.
[0098] Step 9: Return the first pixel sequence, the first diameter sequence, and the first stenosis rate sequence as vascular stenosis analysis data of the angiography image.
[0099] Here, based on the first pixel point sequence, first diameter sequence, and first stenosis ratio sequence obtained in steps 1-9 above, pixel-level semantic parameters of the vessel centerline, vessel diameter, and vessel stenosis ratio can be added to each vessel sampling point on the angiographic image, thereby improving the recognition accuracy of the angiographic image. A mean or weighted mean can also be calculated for the first stenosis ratio sequence, and the calculated result can be used as the average stenosis ratio of the current vessel segment for statistical analysis by the user. A maximum value can also be extracted from the first stenosis ratio sequence as the maximum stenosis ratio of the current vessel segment for statistical analysis by the user.
[0100] Figure 3 This is a module structure diagram of a device for analyzing angiographic images provided in the second embodiment of the present invention. The device may be a terminal device or server that implements the method of the embodiment of the present invention, or may be a device that implements the method of the embodiment of the present invention connected to the above terminal device or server. For example, the device may be a device or chip system of the above terminal device or server. Figure 3 As shown, the device includes: an acquisition module 201, an image preprocessing module 202, a centerline extraction module 203 and a data analysis module 204.
[0101] The acquisition module 201 is used to acquire angiography images.
[0102] The image preprocessing module 202 is used to detect vascular stenosis sites on the angiography image and use the detected stenosis site sub-image as the first image; perform binarization and image noise reduction on the first image to generate a first binary image; and perform blood vessel recognition on the first binary image to generate a corresponding blood vessel image.
[0103] The centerline extraction module 203 is configured to perform centerline extraction processing on the vascular image of the first binary image based on a topological thinning method to generate a first centerline without changing the topological properties of the vascular image; and to sort the pixels on the first centerline in a direction from one end point to the other end point of the first centerline to generate a first pixel point sequence; the first pixel point sequence includes a plurality of first pixel points.
[0104] The data analysis module 204 is configured to measure the blood vessel diameter at each first pixel point based on the blood vessel image to generate a corresponding first diameter; sort the first diameters according to the sorting order of the corresponding first pixels to generate a first diameter sequence; identify the blood vessel stenosis rate at each first pixel point based on the first diameter sequence to generate a corresponding first stenosis rate; sort the first stenosis rates according to the sorting order of the corresponding first pixels to generate a first stenosis rate sequence; and return the first pixel point sequence, the first diameter sequence, and the first stenosis rate sequence as blood vessel stenosis analysis data of the angiography image.
[0105] An embodiment of the present invention provides an angiography image analysis device that can execute the method steps in the above method embodiment. Its implementation principles and technical effects are similar and will not be described in detail here.
[0106] It should be noted that it should be understood that the division of the various modules of the above device is merely a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. Moreover, these modules can all be implemented in the form of software called by a processing element; or they can all be implemented in the form of hardware; or some modules can be implemented in the form of software called by a processing element, and some modules can be implemented in the form of hardware. For example, the acquisition module can be a separately established processing element, or it can be integrated into a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called by a processing element of the above device to perform the functions of the above determination module. The implementation of other modules is similar. In addition, these modules can all or partly be integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed by the hardware integrated logic circuit in the processor element or by instructions in the form of software.
[0107] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application-specific integrated circuits (ASICs), one or more digital signal processors (DSPs), or one or more field programmable gate arrays (FPGAs). For another example, when a module is implemented by scheduling program code through a processing element, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0108] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in accordance with the embodiment of the present invention is generated in whole or in part. The above-mentioned computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The above-mentioned computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the above-mentioned computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, Bluetooth, microwave, etc.) mode. The above-mentioned computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, solid state disks (SSDs)).
[0109] Figure 4 This is a schematic diagram of the structure of an electronic device provided in the third embodiment of the present invention. The electronic device may be the aforementioned terminal device or server, or may be a terminal device or server connected to the aforementioned terminal device or server to implement the method of the embodiment of the present invention. Figure 4As shown, the electronic device may include: a processor 301 (such as a CPU), a memory 302, and a transceiver 303; the transceiver 303 is coupled to the processor 301, and the processor 301 controls the transceiver 303's transceiver actions. Various instructions may be stored in the memory 302 for performing various processing functions and implementing the methods and processing procedures provided in the above embodiments of the present invention. Preferably, the electronic device involved in the embodiment of the present invention further includes: a power supply 304, a system bus 305, and a communication port 306. The system bus 305 is used to realize communication connections between components. The above-mentioned communication port 306 is used for connecting and communicating between the electronic device and other peripheral devices.
[0110] exist Figure 4 The system bus mentioned in the figure can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface is used to realize communication between the database access device and other devices (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM) and may also include non-volatile memory (Non-Volatile Memory), such as at least one disk storage.
[0111] The above-mentioned processor can be a general-purpose processor, including a central processing unit CPU, a network processor (NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0112] It should be noted that an embodiment of the present invention further provides a computer-readable storage medium, which stores instructions. When the storage medium is run on a computer, it enables the computer to execute the methods and processing procedures provided in the above embodiments.
[0113] An embodiment of the present invention further provides a chip for executing instructions, which is used to execute the methods and processing procedures provided in the above embodiments.
[0114] Embodiments of the present invention provide a method, apparatus, electronic device, and computer-readable storage medium for analyzing angiographic images. The method first extracts the stenotic segment of a blood vessel from the angiographic image and binarizes the extracted image. The binary image is then used to extract the vessel edges to obtain a vessel image. A topological thinning method is then used to extract the vessel centerline from the vessel image. Based on the geometric relationship between the extracted vessel centerline and the vessel edge, the diameter of each point on the centerline is measured. Based on the obtained diameters of each point, the rate of change of the diameter at each point is calculated as the corresponding vessel stenosis rate. This method eliminates reliance on manual experience and improves data analysis accuracy.
[0115] Professionals should also be further aware that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0116] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0117] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for analyzing angiographic images, characterized in that: The method comprises: Acquire angiographic images; Detecting a vascular stenosis site on the angiography image, and using a sub-image of the detected stenosis site as a first image; performing binarization and image noise reduction processing on the first image to generate a first binary image; performing blood vessel recognition processing on the first binary image to generate a corresponding blood vessel image; Without changing the topological properties of the vascular image, performing centerline extraction processing on the vascular image of the first binary image based on a topological thinning method to generate a first centerline; sorting the pixels on the first center line in a direction from one end point to the other end point of the first center line to generate a first pixel point sequence; the first pixel point sequence includes a plurality of first pixel points; According to the blood vessel image, the blood vessel diameter at each of the first pixel points is measured to generate a corresponding first diameter; and the first diameters are sorted in the order of the corresponding first pixel points to generate a first diameter sequence; identifying the vascular stenosis rate at each of the first pixel points according to the first diameter sequence to generate a corresponding first stenosis rate; and sorting the first stenosis rates according to the sorting order of the corresponding first pixel points to generate a first stenosis rate sequence; Returning the first pixel point sequence, the first diameter sequence, and the first stenosis rate sequence as vascular stenosis analysis data of the angiography image; The step of performing centerline extraction processing on the blood vessel image of the first binary image based on a topological thinning method to generate a first centerline without changing the topological properties of the blood vessel image specifically includes: Create connectivity judgment rules that maintain the topological properties of vascular images; copying the first binary image to generate a corresponding second binary image, and recording the blood vessel image region on the second binary image as the current blood vessel image region; Traversing the pixels of each row of the second binary image from left to right, marking the pixels that do not satisfy the connectivity judgment rule as non-essential pixels; after completing a traversal of all the pixels of the second binary image, marking the non-essential pixels whose pixel values are a preset foreground pixel value A as newly added background pixels, setting the pixel values of all the newly added background pixels to a preset background pixel value B, and counting the number of the newly added background pixels to obtain a newly added number; if the newly added number is not 0, traversing the pixels of each row of the set second binary image again from left to right until the newly added number obtained by the current traversal is 0; and marking all the pixels whose pixel values are the foreground pixel value A within the current blood vessel image area on the final second binary image as necessary pixels; According to a one-to-one correspondence between pixels of the second binary image and the first binary image, sequentially connecting pixel points corresponding to each of the necessary pixels on the first binary image, and using the connecting line as the first center line; The connectivity judgment rule includes 5 sub-rules, each of which corresponds to one or more 3×3 pixel value template matrices; the pixel value template matrix of sub-rule 1 is The pixel value template matrix of sub-rule 2 is The pixel value template matrix of sub-rule 3 is The pixel value template matrix of sub-rule 4 is The pixel value template matrix of sub-rule 5 includes and When traversing each pixel point, the pixel values of the current traversal pixel point and its corresponding eight-area pixel points are extracted to form a 3×3 traversal point pixel matrix, and the traversal point pixel matrix is compared one by one with the template matrix of each sub-rule; during the comparison, if the traversal point pixel matrix coincides with the template matrix of one of the sub-rules, it is confirmed that the current traversal pixel point meets the connectivity judgment rule; if the traversal point pixel matrix does not coincide with the template matrix of all sub-rules, it is confirmed that the current traversal pixel point does not meet the connectivity judgment rule.
2. The angiography image analysis method according to claim 1, characterized in that: The performing binarization and image noise reduction on the first image to generate a first binary image specifically includes: Binarization is performed on the first image to generate a corresponding binary image; the pixels of the binary image include foreground pixels and background pixels; the pixel values of the foreground pixels are preset foreground pixel values A, and the pixel values of the background pixels are preset background pixel values B; Based on the image closing operation principle of image morphology, an image closing operation is performed on the binary image by first dilation and then erosion, and the operation result is used as the first binary image.
3. The angiography image analysis method according to claim 1, characterized in that: The performing blood vessel recognition processing on the first binary image to generate a corresponding blood vessel image specifically includes: Traversing each pixel point on the first binary image whose pixel value is a preset foreground pixel value A; during the traversal, obtaining the pixel values of the eight neighboring pixels of the currently traversed pixel point to generate a corresponding first pixel value set; if at least one pixel value in the first pixel value set is consistent with a preset background pixel value B, marking the currently traversed pixel point as an edge point; On the first binary image, the edge points are sequentially connected in a clockwise or counterclockwise direction to form a closed blood vessel edge line; and the blood vessel edge line and the sub-image within the edge line are used as the corresponding blood vessel image.
4. The angiography image analysis method according to claim 1, wherein: The step of measuring the blood vessel diameter at each of the first pixel positions according to the blood vessel image to generate the corresponding first diameter specifically includes: Four straight lines are drawn through each of the first pixel points along four directions connected to the eight area pixel points thereof, respectively intersecting with the blood vessel edge lines of the blood vessel image, thereby obtaining four corresponding intersecting line segments; and a length of the shortest intersecting line segment among the four intersecting line segments is calculated, and the calculated result is used as the first diameter corresponding to the current first pixel point.
5. The angiography image analysis method according to claim 1, characterized in that: The step of identifying the vascular stenosis rate at each of the first pixel points according to the first diameter sequence to generate the corresponding first stenosis rate specifically includes: A two-dimensional coordinate space is constructed with the pixel index of the first center line as the horizontal axis and the blood vessel diameter corresponding to the pixel as the vertical axis, and is recorded as a first coordinate space; Using the pixel point index of each first pixel point on the first center line as the horizontal axis coordinate and the corresponding first diameter as the vertical axis coordinate, mark the corresponding coordinate point in the first coordinate space as the first coordinate point; Connecting the first coordinate points in sequence to obtain a first diameter change curve; Connecting the first and last of the first coordinate points with a straight line to obtain a first diameter reference line; Draw a perpendicular line to the horizontal axis of the first coordinate space through each of the first coordinate points, and record the vertical coordinate value of the blood vessel diameter at the intersection of the perpendicular line to the horizontal axis and the first diameter reference line as the corresponding first reference diameter; The first stenosis rate r corresponding to each first pixel point is calculated, where r=(1-d1 / d2)×100%, d1 is the first diameter corresponding to each first pixel point, and d2 is the first reference diameter corresponding to each first pixel point.
6. A device for implementing the steps of the angiography image analysis method according to any one of claims 1 to 5, characterized in that: The device includes: an acquisition module, an image preprocessing module, a centerline extraction module and a data analysis module; The acquisition module is used to acquire angiography images; The image preprocessing module is configured to detect vascular stenosis sites on the angiography image and use the detected stenosis site sub-image as a first image; perform binarization and image noise reduction on the first image to generate a first binary image; and perform vessel recognition on the first binary image to generate a corresponding vessel image; The centerline extraction module is configured to perform centerline extraction processing on the blood vessel image of the first binary image based on a topological thinning method to generate a first centerline without changing the topological properties of the blood vessel image; and to sort the pixels on the first centerline in a direction from one end point to the other end point of the first centerline to generate a first pixel point sequence; the first pixel point sequence includes a plurality of first pixel points; The data analysis module is configured to measure, based on the vascular image, the diameter of the blood vessel at each of the first pixel points to generate a corresponding first diameter; sort the first diameters in a sorting order of the corresponding first pixel points to generate a first diameter sequence; identify, based on the first diameter sequence, the vascular stenosis rate at each of the first pixel points to generate a corresponding first stenosis rate; sort the first stenosis rates in a sorting order of the corresponding first pixel points to generate a first stenosis rate sequence; and return the first pixel sequence, the first diameter sequence, and the first stenosis rate sequence as vascular stenosis analysis data of the angiography image.
7. An electronic device, characterized in that: include: memory, processors, and transceivers; The processor is configured to be coupled to the memory, read and execute instructions in the memory, so as to implement the method according to any one of claims 1 to 5; The transceiver is coupled to the processor, and the processor controls the transceiver to send and receive messages.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a computer, the computer is caused to execute the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Blood vessel diameter measuring method based on digital image processing technology
CN101984916A
A device and system for determining a sequence of blood vessel condition parameters of a blood vessel by utilizing a computer
CN108830848A
Method for identifying local vascular stenosis degree in DSA coronary artery image
CN110490040A