Disclosure of Invention
The invention provides a cardiovascular CT image data segmentation detection method, which aims to solve the existing problems.
The invention relates to a cardiovascular CT image data segmentation detection method, which adopts the following technical scheme:
an embodiment of the present invention provides a cardiovascular CT image data segmentation detection method, which includes the following steps:
collecting cardiovascular CT images of a patient, and obtaining cardiovascular CT gray level images of the patient;
acquiring a plurality of initial points according to gray values of pixel points in a cardiovascular CT gray scale image, and constructing an initial undirected image model according to gray values of neighborhood pixel points of each pixel point in the cardiovascular CT gray scale image by connecting with the pixel point with the minimum difference of gray values in the neighborhood range; according to the shortest path between each pixel point and the initial point and the gray value of the pixel point, removing the pixel points in the initial undirected graph model to obtain an undirected graph model of each pixel point; acquiring starting points of all the pixel points by combining the initial points according to the undirected graph model of all the pixel points, and calculating the probability that each pixel point is a pixel point in a cardiovascular system through the gray level difference between the pixel points and the adjacent pixel points in the shortest path between the starting points of the pixel points;
obtaining morphological processing results after gray morphology optimization according to the probability that each pixel point is a pixel point in a cardiovascular system;
and obtaining a cardiovascular segmentation result according to the morphological processing result after gray morphology optimization.
Preferably, the construction of the initial undirected graph model comprises the following specific steps:
firstly, selecting a pixel point with the highest gray value from a cardiovascular CT gray scale image as an initial point, and obtaining a plurality of initial points; and the initial point must be a pixel point within the cardiovascular system;
then in the cardiovascular CT gray scale imageA pixel point is taken as the center, and a +.>Obtain window of->The gray values of all the pixels except the central pixel in each window are recorded, and the pixel with the smallest gray difference between the pixels except the central pixel in each window and the central pixel is recorded as the eenthpart>Connection points of the pixel points;will be->Pixel dot and->The connection points of the pixel points are connected, the connection point of each pixel point and each pixel point is obtained, and the connection point of each pixel point and the corresponding pixel point is obtained; when one pixel point in the cardiovascular CT gray scale image has a plurality of connection points, all connection points are reserved, a image structure is obtained, and the image structure is recorded as an initial undirected image model.
Preferably, the obtaining the undirected graph model of each pixel point includes the following specific steps:
calculate the firstThe shortest path between each pixel point and all initial points in the initial undirected graph model is calculated by +.>Before the shortest path between each pixel point and all initial points in the initial undirected graph model, eliminating the gray value less than the first +.>Pixel points of gray values of the individual pixel points; if the gray value in the initial undirected graph model is less than +.>After the pixel points with gray values of the pixel points are located, when the pixel points are not connected with any other pixel points, the pixel points which are not connected with any other pixel points are connected with the pixel points in the initial undirected graph model with the nearest path;
obtaining an undirected graph model of each pixel point, the firstThe undirected graph model of the individual pixels is marked as +.>And an undirected graph model.
Preferably, the calculating the probability that each pixel point is a pixel point in a cardiovascular system includes the following specific calculation formula:
in the method, in the process of the invention,indicate->Probability that each pixel is a pixel in a cardiovascular system; />Is->Gray values of starting points of the individual pixel points; />Is->Gray values of the individual pixels; />Is->Pixel dot and->The maximum value of the weight in the shortest path between the starting points of the pixel points; />An exponential function that is based on a natural constant;
said firstPixel dot and->The method for obtaining the weight maximum value in the shortest path between the starting points of the pixel points comprises the following steps: get->Shortest paths between each pixel point and all the initial points, and taking the initial point corresponding to the shortest path among all the shortest paths as the first +.>Starting point of the pixel point, will be +.>Pixel dot and->The gray scale difference between adjacent pixel points in the shortest path between the starting points of the pixel points is marked as weight, and a plurality of weights are obtained.
Preferably, the specific calculation formula included in the obtained morphological processing result after gray morphology optimization is as follows:
in the method, in the process of the invention,to be subjected to expansion operation>Gray values of the individual pixels; />Is->Gray values of the individual pixels; />Is->Gray values of starting points of the individual pixel points; />Indicate->Probability that each pixel is a pixel in a cardiovascular system;
the method comprises the steps of obtaining the expanded gray value of each pixel point, obtaining a cardiovascular CT gray image after expansion operation, carrying out gray image corrosion operation on the cardiovascular CT gray image after expansion operation, and obtaining a morphological processing result after gray morphology optimization.
The technical scheme of the invention has the beneficial effects that: in the existing image watershed segmentation method, when cardiovascular CT segmentation is carried out, gray level morphology processing is combined to carry out cardiovascular segmentation, although cardiovascular is a high gray level part in cardiovascular CT imaging, the gray level value of the cardiovascular is not absolutely uniform along with the prolongation of the cardiovascular part, and further the segmentation effect is still difficult to ensure after the morphological processing of the cardiovascular part, and the effective cardiovascular segmentation effect cannot be obtained. According to the invention, by constructing the graph structure model and combining the characteristics of high and continuous gray levels of the cardiovascular, the probability that each pixel point belongs to the cardiovascular is calculated, and the morphological optimization of the cardiovascular CT gray level graph is carried out according to the probability, so that the final region growth is stable and accurate to the cardiovascular segmentation effect.
Detailed Description
In order to further describe the technical means and effects adopted by the present invention to achieve the preset purposes, the following detailed description refers to specific embodiments, structures, features and effects of a cardiovascular CT image data segmentation detection method according to the present invention with reference to the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" means that the embodiments are not necessarily the same. Furthermore, the particular features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
The following specifically describes a specific scheme of the cardiovascular CT image data segmentation detection method provided by the invention with reference to the accompanying drawings.
Referring to fig. 1, a flowchart illustrating a method for detecting segmentation of cardiovascular CT image data according to an embodiment of the present invention is shown, the method includes the following steps:
step S001: and acquiring cardiovascular CT images of the patient, and acquiring cardiovascular CT gray level images of the patient.
The heart of a patient is scanned through a CT device, a cardiovascular CT image of the patient is obtained, gray-scale treatment is carried out on the cardiovascular CT image of the patient, and a cardiovascular CT gray-scale image of the patient is obtained.
Step S002: and obtaining the probability that each pixel point in the cardiovascular CT gray scale image is a pixel point in the cardiovascular according to the cardiovascular CT gray scale image.
In the cardiovascular CT gray scale image, the gray scale value of the pixel points in the cardiovascular is large, and the cardiovascular is a continuous tissue, so that the gray scale difference value between the pixel points in the cardiovascular is small, and the pixel points in the cardiovascular have good continuity; in order to obtain the probability that all pixels in the cardiovascular CT gray scale map are pixels in the cardiovascular, an undirected map model is required to be constructed for representing the distance and gray scale difference between the pixels in the cardiovascular CT gray scale map.
The specific process for constructing the undirected graph model comprises the following steps: firstly, selecting a pixel point with the highest gray value from a cardiovascular CT gray scale image as an initial point, and obtaining a plurality of initial points; because the gray value of the pixel points in the cardiovascular system is large, the pixel point with the highest gray value in the cardiovascular CT gray map is considered to be the pixel point in the cardiovascular system in the embodiment, namely the initial point is considered to be the pixel point in the cardiovascular system;
then in the cardiovascular CT gray scale imageA pixel point is taken as the center, and a +.>In the present embodiment +.>And->The value of (2) is set to 3, wherein the size of the established window can be set according to the specific situation, and the specific requirement is not made in the embodiment. Get->The gray values of all the pixels except the central pixel in each window are recorded, and the pixel with the smallest gray difference between the pixels except the central pixel in each window and the central pixel is recorded, wherein the difference is the absolute value of the difference and is marked as the (th)>Connection points of the pixel points; will be->Pixel dot and->The connection points of the individual pixel points are connected. And similarly, acquiring the connection point of each pixel point and each pixel point, and connecting each pixel point with the connection point of the corresponding pixel point. When one pixel point in the cardiovascular CT gray-scale image has a plurality of connection points,all connection points are reserved, namely each pixel point is connected with the connection points of all the corresponding pixel points, a graph structure is obtained and is recorded as an initial undirected graph model, and if the pixel points are positioned at the boundary part in the cardiovascular CT gray-scale graph and a complete window cannot be acquired, window completion is not needed, and the pixel points in the acquired window are processed.
It should be further described that, because the initial undirected graph model is constructed by using the minimum gray difference value, the gray difference value between each connected pixel point in the initial undirected graph model is the minimum, and because the gray difference value between the pixel points in the cardiovascular system is small and the pixel points in the cardiovascular system have good continuity; therefore, the probability that all pixel points in the cardiovascular CT gray scale image are pixel points in the cardiovascular can be obtained according to the initial undirected image model.
Specifically, calculate the firstThe shortest path between each pixel and all initial points in the initial undirected graph model is calculated as +.>Before the shortest path between each pixel point and all initial points in the initial undirected graph model, firstly eliminating the gray value less than the +.f in the initial undirected graph model>Pixel points of gray values of the individual pixel points; if the gray value in the initial undirected graph model is less than +.>After the pixel points with gray values of the pixel points are located, when the pixel points are not connected with any other pixel points, the pixel points which are not connected with any other pixel points are connected with the pixel points in the initial undirected graph model with the nearest path; obtaining an undirected graph model of each pixel point +.>Undirected graph model of each pixel pointMarked as->A model of an undirected graph;
then calculate at the firstNo.>The shortest paths between each pixel point and all the initial points are selected by Dijkstra algorithm in this embodiment to obtain the shortest paths between the initial points and all other pixel points in the undirected graph model, where Dijkstra algorithm is a well-known technique, and therefore will not be described in detail in this embodiment. Get->Shortest paths between each pixel point and all the initial points, and the initial point corresponding to the shortest path in all the shortest paths is taken as the +.>Starting point of the pixel point, will be +.>Pixel dot and->The gray scale difference between adjacent pixel points in the shortest path between the starting points of the pixel points is marked as weight, and a plurality of weights are obtained.
Finally through the firstGray value of start point of each pixel point, +.>Gray value of each pixel dot +.>Pixel dot and->Weight maximum value in shortest path between starting points of each pixel point, calculating +.>The probability that each pixel point is a pixel point in a cardiovascular system is calculated as follows:
in the method, in the process of the invention,indicate->Probability that each pixel is a pixel in a cardiovascular system; />Is->Gray values of starting points of the individual pixel points; />Is->Gray values of the individual pixels; />Is->Pixel dot and->The maximum value of the weight in the shortest path between the starting points of the pixel points; />An exponential function based on a natural constant is represented.
Needs to go intoThe step is thatGray value of starting point of each pixel point +.>And->Gray value of each pixel pointThe smaller the difference between +.>The greater the probability that a pixel is within a cardiovascular pixel; but->Indicate->Pixel dot and->The maximum gray difference between adjacent pixel points in the shortest path between the starting points of the pixel points is recorded as the maximum weight, and when the value of the maximum weight is smaller, the description of the +.>Pixel dot and->The smoother the variation of the pixel point in the shortest path between the starting points of the pixel points, i.e +.>Pixel dot and->The better the continuity of the starting point of the individual pixel points, the +.>The greater the probability that a pixel is within a cardiovascular pixel.
To this end, obtain the firstProbability that each pixel is a pixel in a cardiovascular system; and similarly, obtaining the probability that each pixel point in the cardiovascular CT gray scale image is a pixel point in the cardiovascular.
Step S003: and obtaining morphological processing results after gray morphology optimization according to the probability that each pixel point is a pixel point in a cardiovascular system.
It should be noted that, due to the longer cardiovascular length and the reasons of the acquisition equipment, there is a void in the cardiovascular part in the acquired cardiovascular CT gray scale image, and in order to improve the quality of the cardiovascular CT gray scale image, the cardiovascular CT gray scale image needs to be subjected to a closed operation.
It should be further noted that, when the expansion is performed in the closed operation, although the difference between the gray value of the j-th pixel and the gray value of the initial pixel can be reduced by selecting the maximum gray value in the window corresponding to the morphological structural element, the cardiovascular segmentation effect of the later region growing may still be poor due to the longer cardiovascular length, only the part of the cardiovascular near the initial point can be segmented, so that the expanded gray value of each pixel in the cardiovascular CT gray map needs to be obtained according to the gray value of the starting point of each pixel in the cardiovascular CT gray map, the gray value of each pixel and the probability that each pixel is the pixel in the cardiovascular CT gray map.
The calculation formula for specifically obtaining the expanded gray value of each pixel point in the cardiovascular CT gray scale image is as follows:
in the method, in the process of the invention,to be subjected to expansion operation>Gray values of the individual pixels; />Is->Gray values of the individual pixels; />Is->Gray values of starting points of the individual pixel points; />Indicate->The probability that a pixel is a pixel within a cardiovascular vessel.
Further, after the expanded gray value of each pixel point is obtained, a cardiovascular CT gray image after expansion operation is obtained, and then gray image erosion operation is carried out on the cardiovascular CT gray image after expansion operation, so that a morphological processing result after gray morphology optimization is obtained.
It should be noted that, the expansion operation increases the gray value of the local pixel, which leads to the boundary expansion, so that the boundary is then reduced back by the erosion operation. Since the gray image erosion operation is a well-known technique, detailed description is not made in this embodiment.
Thus, the morphological processing result after gray morphology optimization is obtained.
Step S004: and obtaining a cardiovascular segmentation result according to the morphological processing result after gray morphology optimization.
After the morphological processing result after gray morphology optimization is obtained, the embodiment takes the initial point as the initial point of region growth, and further utilizes a region growth algorithm to perform region growth segmentation on the optimized gray image, so as to realize accurate and stable segmentation on the cardiovascular image, wherein a mask region obtained by region growth is the cardiovascular region, and if a cavity exists in the mask region obtained by region growth, the cavity filling is performed by utilizing the existing image cavity filling algorithm; the region growing algorithm and the image hole filling algorithm are known in the art, and therefore will not be described in detail in this embodiment.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather is intended to cover all modifications, equivalents, alternatives, and improvements that fall within the spirit and scope of the invention.