Disclosure of Invention
In order to solve the above technical problems, the present invention aims to provide a method and a device for identifying the heart position in a chest X-ray plain.
The first technical scheme adopted by the invention is as follows:
a method for identifying the position of the heart in a chest X-ray surview, comprising the steps of:
extracting a lung tissue outline from a chest X-ray plain film;
calculating the slope of each point of the lung tissue outline;
the apex location is determined from the calculated slope.
Further, the chest X-ray flat sheet is provided with a mark for indicating the body orientation of the shot, and after the position of the apex of the heart is determined, the method further comprises the following steps:
comparing the apex location with the marker, thereby obtaining a comparison result; the comparison result comprises that the apex position and the mark are both positioned on the same side relative to the midline of the human body, and the apex position and the mark are respectively positioned on different sides relative to the midline of the human body;
and sending out corresponding information according to the comparison result.
Further, the mark is used for marking the right side of the body of the photographed person, and the step of sending out a corresponding message according to the comparison result specifically includes:
if the apex position and the mark are on the same side with respect to the human body, a warning message for warning of an error in the photographing process or a physical abnormality of the subject is issued.
Further, the step of extracting the lung tissue contour from the chest X-ray plain film specifically comprises:
dividing the chest X-ray plain film into parts respectively corresponding to lung tissues, soft tissues and a background according to the gray level of each point on the chest X-ray plain film;
and extracting the boundary between the part corresponding to the lung tissue and the part corresponding to the soft tissue on the chest X-ray flat sheet so as to obtain the lung tissue outline.
Further, after the boundary between the portion corresponding to the lung tissue and the portion corresponding to the soft tissue on the chest X-ray plain film is acquired, the boundary is further subjected to filtering processing.
Further, the method further comprises the steps of:
the lung tissue contour is divided into a left part and a right part with reference to the midline of the human body.
Further, the step of determining the apex location according to the calculated slope specifically includes:
calculating the difference between the maximum value and the minimum value of the slope of each point on the left side part, thereby obtaining a first difference value;
calculating the difference between the maximum value and the minimum value of the slope of each point on the right side part, thereby obtaining a second difference value;
and taking the position of the lung tissue contour corresponding to the larger of the first difference and the second difference as the apex position.
Further, the human body midline is obtained by the following steps:
finding the longitudinal highest point and the longitudinal lowest point of the left part of the lung tissue outline;
finding the longitudinal highest point and the longitudinal lowest point of the right part of the lung tissue outline;
finding a midpoint of a first connection line formed by a longitudinal highest point of the left part of the lung tissue outline and a longitudinal highest point of the right part of the lung tissue outline;
finding a midpoint of a second line formed by the longitudinal nadir of the left portion of the lung tissue profile and the longitudinal nadir of the right portion of the lung tissue profile;
and taking the straight line where the middle point of the first connecting line and the middle point of the second connecting line are positioned as the middle line of the human body.
Further, the human body midline is obtained by the following steps:
acquiring the central line of the chest X-ray flat sheet in the vertical direction;
the midline of the chest X-ray flat piece in the vertical direction is taken as the midline of the human body.
The second technical scheme adopted by the invention is as follows:
an apparatus for identifying a dirty position in a chest X-ray surview, comprising a memory for storing at least one program and a processor for loading the at least one program to perform the method of the first aspect.
The invention has the beneficial effects that: the heart apex position in the chest X-ray plain film image can be automatically identified through automation equipment such as a computer, the heart position is further identified, the condition that the chest X-ray plain film is observed manually one by one to judge and identify is avoided, the identification efficiency is improved, and the error rate is reduced.
Furthermore, after the heart position is identified, a corresponding warning message can be automatically given according to the identification result so as to remind medical staff, thereby improving the diagnosis and treatment effect.
Detailed Description
Example 1
A method for identifying the position of the heart in a chest X-ray surview, with reference to fig. 1, comprising the following steps:
extracting a lung tissue outline from a chest X-ray plain film;
calculating the slope of each point of the lung tissue outline;
the apex location is determined from the calculated slope.
A typical chest X-ray plain image is shown in fig. 2. The gray levels of the lung tissue a, the soft tissue B and the background C in the chest X-ray plain are significantly different, so the chest X-ray plain image can be divided into three parts of background, soft tissue and lung tissue by gray level comparison, wherein the lung tissue comprises a left part and a right part. The boundary of the lung tissue a and the soft tissue B is further determined as the lung tissue contour by gray scale contrast. In the process of extracting the lung tissue contour, in order to improve the accuracy, the region corresponding to the lung tissue a and the soft tissue B may be binarized first. After the lung tissue contour is obtained through extraction, the lung tissue contour can be further subjected to filtering processing, so that burrs and sharp components are removed, and the lung tissue contour is smoother.
The portion denoted by D in fig. 2 is the apex of the heart, and identifying the position of the apex of the heart is key to identifying the position of the heart. As can be seen from fig. 2, except for the locations of the apex of the lung and the angle of the ribcage, other portions of the lung tissue contour are relatively flat, while the portion of the lung tissue contour corresponding to the apex of the heart has a higher degree of curvature, i.e., the degree of change of the slope of the portion of the lung tissue contour corresponding to the apex of the heart is greater, so that the location of the apex of the heart can be identified by the slope.
In the calculation of the slope, the calculation is preferably performed only for the inner side of the lung tissue contour. The inner side of the lung tissue contour refers to the portion of the lung tissue contour closest to the midline of the human body. Fig. 3 is an enlarged view of a portion of fig. 2, the portion of the lung tissue contour shown in fig. 3 being the inner side of the entire lung tissue contour. The inside of the lung tissue contour is also divided into a left side portion and a right side portion, corresponding to the division of the lung tissue contour into a left side portion and a right side portion as a whole.
As can be seen from fig. 3, the more curved portion of the inner side of the contour of the lung tissue (i.e. the right portion in the figure) corresponds to the location of the apex of the heart. The slope can be calculated mathematically by coordinating the points of the lung tissue contour, and then the portion of the slope that changes most is identified as the location of the apex.
Further preferably, the step of determining the position of the apex of the heart according to the calculated slope specifically includes:
calculating the difference between the maximum value and the minimum value of the slope of each point on the left side part, thereby obtaining a first difference value;
calculating the difference between the maximum value and the minimum value of the slope of each point on the right side part, thereby obtaining a second difference value;
and taking the position of the lung tissue contour corresponding to the larger of the first difference and the second difference as the apex position.
Considering fig. 2 partially, as shown in fig. 3, the inner side of the lung tissue contour is divided into a left side portion and a right side portion, and the slope is preferably calculated only for each point inside the lung tissue contour. And respectively calculating a first difference value and a second difference value, wherein the first difference value is the difference between the maximum value and the minimum value of the slope of each point in the left part, and the second difference value is the difference between the maximum value and the minimum value of the slope of each point in the right part. As shown in fig. 3, the calculation result will be that the second difference is large, that is, the right portion of the inner side of the lung tissue contour has a large degree of curvature, and thus it can be determined that the apex is located on the right side as shown in fig. 3.
After the position of the apex is obtained, the position of the apex can be further compared with the R-shaped mark. On the chest X-ray flat sheet, the R-shaped mark has a gray level which is obviously different from the surrounding, so that the R-shaped mark can be identified through gray level comparison or other image identification methods, and the position of the R-shaped mark is obtained.
According to the relation between the central point position of the X-ray plain film and the position of the R-shaped mark, whether an abnormal state exists or not can be automatically judged. The specific judgment rule is as follows:
the apex of the heart and the R-shaped mark are positioned on different sides of the chest X-ray plain film, which generally belongs to the normal medical condition, and in this case, a warning message does not need to be sent out;
the apex of the heart and the R-shaped mark are positioned on the same side of the chest X-ray plain film, which generally belongs to an abnormal situation in medicine, and the reason for causing the phenomenon can be that the photographed person belongs to the right position, or the medical staff turns the related equipment left and right due to carelessness, and in any case, the subsequent diagnosis and treatment work can be influenced and attention must be paid, so that a warning message can be sent when the situation occurs, and the medical staff can be reminded that the photographed person is possibly abnormal in body (right position) or the photographing process is wrong (the related equipment is turned left and right).
It is worth explaining that under the condition that the photographed person is in the right position and the medical staff is careless and the related equipment is installed in a left-right overturning mode simultaneously, the phenomenon that the apex of the heart and the R-shaped mark are located on different sides also occurs in the chest X-ray plain film photographed, so that the method has the possibility of misjudgment theoretically, but medical statistical data shows that the incidence rate of the right position is only 0.013% -0.05%, the probability of errors in the chest X-ray plain film photographing process caused by careless work of the medical staff is quite low, and after comprehensive consideration, the possibility of the misjudgment is extremely low and can be ignored.
In this embodiment, the descriptions of the left side, the right side, the same side, the different sides, and the like of the chest X-ray flat sheet are all referred to the human midline on the chest X-ray flat sheet, i.e. the straight line on which the trachea or the spine of the chest X-ray flat sheet is located. The embodiment also discloses a method for automatically identifying the human body midline on the chest X-ray plain film.
Because the position relation between the body position of the shot person and the relevant equipment has certain fixity in the chest X-ray plain film shooting process, the human body central line on the shot chest X-ray plain film is basically superposed with the central axis of the chest X-ray plain film image, and the central axis of the chest X-ray plain film image can be directly obtained to be used as the human body central line. Namely, the first method for automatically identifying the human body midline on the chest X-ray plain film comprises the following steps:
acquiring the central line of the chest X-ray flat sheet in the vertical direction;
the midline of the chest X-ray flat piece in the vertical direction is taken as the midline of the human body.
The second method for automatically identifying the human body midline on the chest X-ray plain film comprises the following steps:
finding the longitudinal highest point and the longitudinal lowest point of the left part of the lung tissue outline;
finding the longitudinal highest point and the longitudinal lowest point of the right part of the lung tissue outline;
finding a midpoint of a first connection line formed by a longitudinal highest point of the left part of the lung tissue outline and a longitudinal highest point of the right part of the lung tissue outline;
finding a midpoint of a second line formed by the longitudinal nadir of the left portion of the lung tissue profile and the longitudinal nadir of the right portion of the lung tissue profile;
and taking the straight line where the middle point of the first connecting line and the middle point of the second connecting line are positioned as the middle line of the human body.
Referring to fig. 4, after each point of the chest X-ray plain image is coordinated, it can be extracted from the ordinate of each point of the lung tissue contour. Extracting a longitudinal highest point (a point corresponding to a maximum value of an ordinate) E1 and a longitudinal lowest point (a point corresponding to a minimum value of the ordinate) F1 at the left part of the lung tissue profile, and a longitudinal highest point (a point corresponding to a maximum value of an ordinate) E2 and a longitudinal lowest point (a point corresponding to a minimum value of an ordinate) F2 at the right part of the lung tissue profile, wherein E1 and E2 are respectively the lung tips of the left lung and the right lung in medical significance, and F1 and F2 are respectively the costal diaphragm angles of the left lung and the right lung in medical significance. The straight line formed by the middle point of the connecting line E1-E2 and the middle point of the connecting line F1-F2 can be regarded as the midline of the human body medically.
Example 2
Let the pixel intensity of a chest X-ray flat be f (X, y) function, where (X, y) is the pixel coordinate. The criterion for dividing the regions according to the gray scale may be: the combination of 20< f (x, y) <100 to classify the point as lung tissue, 110< f (x, y) <200 to classify it as soft tissue, and f (x, y) <10 to classify it as background, divides the gray pixels possessed by lung tissue, soft tissue, and background into three groups.
The method of extracting the boundary of the lung tissue and the soft tissue may be: when the gray value of the adjacent pixel changes sharply, the pixel point is determined as the boundary of the lung tissue and the soft tissue, namely two adjacent points (x) in the horizontal directionn,yn) And (x)n-1,yn-1) Satisfies | f (x)n,yn)-f(xn-1,yn-1)|>When 10, it can be considered that (x)n,yn) And (x)n-1,yn-1) Between are the boundaries of lung tissue and soft tissue, and will be (x)n,yn) And (x)n-1,yn-1) As a point on the contour of the lung tissue.
The boundary points are connected in turn to form two lung tissue contours. A 4 th order 50Hz low pass filter may be used to filter out frightened low frequency signals in the outer contour, resulting in a smooth lung tissue contour, and to extract the inner portion of the outer contour near the centerline of the human body.
Calculating the point (x) on the contour of the lung tissue
n,y
n) Can obtain the sum point (x) on the lung tissue contour
n,y
n) Adjacent point (x)
n-1,y
n-1) Then by the formula
Calculating to obtain a slope k
n。
Calculating the slope of each point on the left side of the lung tissue contour shown in FIG. 3 to obtain a set of slopes
Calculating the slope of each point on the right part of the image to obtain a group of slopes
Calculating the difference between the maximum and minimum of each of the two sets of slopes, i.e.
In actual calculation, a threshold value may be set, such as 30, when d
lOr d
rIf the value is larger than the threshold, the heart apex is judged to be positioned at the position d
lOr d
rThe corresponding lung tissue contour is on one side. Or directly to d
lAnd d
rThe size of the heart point is judged, and the side of the lung tissue contour corresponding to the larger lung tissue contour is the position of the heart point.
Example 3
The embodiment is an apparatus for identifying a visceral position in a chest X-ray plain, comprising a memory for storing at least one program and a processor for loading the at least one program to perform the method of embodiment 1 or embodiment 2.
The apparatus of this embodiment may also be connected to a DR flat panel detector or film scanner to acquire an electronic image of the chest X-ray flat film for processing by a processor.
In conclusion, the beneficial effects of the invention are as follows:
the heart apex position in the chest X-ray plain film image can be automatically identified through automatic equipment such as a computer, so that the heart position is further identified, the judgment and identification by manually observing the chest X-ray plain films one by one are avoided, the identification efficiency is improved, and the error rate is reduced;
after the heart position is identified, corresponding warning messages can be automatically given according to the identification result so as to remind medical staff, and therefore diagnosis and treatment effects are improved.
While the preferred embodiments of the present invention have been illustrated and described, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.