Pleural adhesion type lung parenchyma segmentation method and system

By using non-uniform rational B-spline fitting and repairing the lung parenchymal profile in lung CT image segmentation, the problem of low accuracy in pleural adhesion type tuberculosis lesions is solved, and higher segmentation accuracy is achieved.

CN115619806BActive Publication Date: 2025-02-07CHANGSHU INSTITUTE OF TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211304261.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-24
Publication Date
2025-02-07
Estimated Expiration
2042-10-24

AI Technical Summary

Technical Problem

The prior art has low accuracy in lung CT image segmentation, especially when segmenting pleural adhesion tuberculosis lesions, mainly because the lesions are close to the thoracic pixel value, resulting in low contrast and difficulty in accurately positioning and segmenting.

Method used

A pleural adhesion type lung parenchymal segmentation method is used to obtain the first lung parenchymal image through image preprocessing, calculate the convex hull and Euro-style distance of the lung parenchymal mask, locate the area to be repaired, and fit the non-uniform rational B-spline curve and Repair lung parenchyma profile and improve segmentation accuracy.

Benefits of technology

The accuracy of lung parenchymal segmentation is significantly improved, especially in the pleural adhesion type tuberculosis foci segmentation, which can more accurately distinguish lesions from non-lesions, reducing over-repair and under-repair.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115619806B_ABST
    Figure CN115619806B_ABST
Patent Text Reader

Abstract

The present invention provides a pleural adhesion type lung parenchyma segmentation method and system, the method comprising: processing an original image to obtain a first lung parenchyma image; obtaining a lung parenchyma mask convex hull, and calculating the Euclidean distance between two adjacent convex hull points in the lung parenchyma mask convex hull, and locating the area corresponding to the convex hull point whose Euclidean distance is within a threshold range as the first area to be repaired, and obtaining the slope change frequency of the first area to be repaired, and locating the area whose frequency is greater than a preset frequency as the second area to be repaired; respectively obtaining m sampling points on the convex hull points at both ends of the second area to be repaired and the lung parenchyma mask contour, and fitting a k-times non-uniform rational B-spline curve to repair the mask contour of the second area to be repaired, obtaining a first lung parenchyma mask image, and obtaining a second lung parenchyma image according to the first lung parenchyma mask image. Thus, the accuracy of lung parenchyma segmentation can be greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of medical image segmentation, and in particular to a pleural adhesion type lung parenchyma segmentation method and a pleural adhesion type lung parenchyma segmentation system. Background Art

[0002] In the aspect of lung CT image segmentation, lung parenchyma segmentation is an important task. It is an important basis for tuberculosis lesion segmentation, detection and quantification of tuberculosis lesions. Accurate lung parenchyma segmentation can effectively improve the accuracy of tuberculosis lesion detection.

[0003] In the related art, digital image processing and deep learning methods are generally used to segment the lung parenchyma. However, there is a type of tuberculosis lesion that is adhered to the pleura on the lung CT image. Since the lesion has lost the ability to exchange air, the pixel value is very close to the chest cavity, that is, the contrast is very low, resulting in the loss of lung parenchyma image. Therefore, the accuracy of lung parenchyma segmentation using the above method is low. Summary of the invention

[0004] In order to solve the above technical problems, the present invention provides a pleural adhesion type lung parenchyma segmentation method and system, which can greatly improve the accuracy of lung parenchyma segmentation.

[0005] The technical solution adopted by the present invention is as follows:

[0006] A pleural adhesion type lung parenchyma segmentation method comprises the following steps: performing image preprocessing on an original image to obtain a first lung parenchyma image, wherein the original image is an image obtained by scanning the lung parenchyma; obtaining a lung parenchyma mask convex hull in the first lung parenchyma image, calculating the Euclidean distance between two adjacent convex hull points in the lung parenchyma mask convex hull, locating an area corresponding to a convex hull point whose Euclidean distance is within a threshold range as a first area to be repaired, obtaining a slope change frequency of the first area to be repaired, and locating an area whose slope change frequency is greater than a preset frequency as a second area to be repaired; respectively obtaining m sampling points on the convex hull points at both ends of the second area to be repaired and on the lung parenchyma mask contour, fitting a k-order non-uniform rational B-spline curve according to the m sampling points based on a k-order basis function, and repairing the mask contour of the second area to be repaired according to the k-order non-uniform rational B-spline curve to obtain a first lung parenchyma mask image, and obtaining a second lung parenchyma image according to the first lung parenchyma mask image.

[0007] In one embodiment of the present invention, the original image is subjected to image preprocessing to obtain the first lung parenchyma image, including: binarizing the original image to obtain a binarized image; bitwise inverting the binarized image to obtain a first target image; using a circular structure element to perform a closing operation on the first target image and bitwise inverting it again to obtain a second target image; using a connected component labeling method to extract the maximum connected area from the second target image to obtain a first chest mask image; using a hole filling method to fill holes in the first chest mask image to obtain a second chest mask image; subtracting the first chest mask image from the second chest mask image to obtain a second lung parenchyma mask image; eliminating connected areas in the second lung parenchyma mask image whose area is larger than a preset area to obtain a third lung parenchyma mask image; and performing an AND operation on the third lung parenchyma mask image and the original image to obtain the first lung parenchyma image.

[0008] In one embodiment of the present invention, obtaining the lung parenchyma mask convex hull in the first lung parenchyma image includes: using a boundary tracing method to obtain a set of boundary points of the left and right lungs in the first lung parenchyma image; using a Graham scanning method to respectively calculate the convexity of each point on the boundary point set to obtain the lung parenchyma mask convex hull.

[0009] In one embodiment of the present invention, the slope change frequency of the first area to be repaired is obtained by the following formula:

[0010]

[0011] Where n is a positive integer greater than or equal to 2, s 1 (x,y),s 2 (x,y),......,s n (x,y),s n+1 (x, y) are the 1st to n+1th contour points in the first area to be repaired, S is the set of the 1st to n+1th contour points, θ n is the slope between the n-1th contour point and the nth contour point, θ n+1 is the slope between the nth contour point and the n+1th contour point, t n-1 is the product of the slope between the n-1th contour point and the nth contour point and the slope between the nth contour point and the n+1th contour point, ω n-2 is the number of slope changes corresponding to the n-1th contour point, ω n-1 is the number of slope changes corresponding to the nth contour point.

[0012] In one embodiment of the present invention, the k-order non-uniform rational B-spline curve is fitted by the following formula:

[0013]

[0014] Among them, d i is the i-th sampling point, i=0, 1, ..., m-1, N i,k (u) is the k-order basis function corresponding to the i-th sampling point, λ i is the weight of the i-th sampling point, and l(u) is the k-th non-uniform rational B-spline curve.

[0015] A pleural adhesion type lung parenchyma segmentation system comprises: a coarse segmentation module, the coarse segmentation module is used to perform image preprocessing on an original image to obtain a first lung parenchyma image, wherein the original image is an image obtained by scanning the lung parenchyma; a positioning module, the positioning module is used to obtain a lung parenchyma mask convex hull in the first lung parenchyma image, and calculate the Euclidean distance between two adjacent convex hull points in the lung parenchyma mask convex hull, and locate the area corresponding to the convex hull point whose Euclidean distance is within a threshold range as a first area to be repaired, and obtain the slope change frequency of the first area to be repaired, and locate the area whose slope change frequency is greater than a preset frequency as a second area to be repaired; a repair module, the repair module is used to obtain m sampling points on the convex hull points at both ends of the second area to be repaired and the lung parenchyma mask contour, respectively, and fit a k-order non-uniform rational B-spline curve according to the m sampling points based on a k-order basis function, and repair the mask contour of the second area to be repaired according to the k-order non-uniform rational B-spline curve to obtain the first lung parenchyma mask image, and obtain the second lung parenchyma image according to the first lung parenchyma mask image.

[0016] In one embodiment of the present invention, the coarse segmentation module is specifically used to: binarize the original image to obtain a binary image; bitwise invert the binary image to obtain a first target image; use a circular structure element to perform a closing operation on the first target image and bitwise invert it again to obtain a second target image; use a connected component labeling method to extract the maximum connected area from the second target image to obtain a first chest mask image; use a hole filling method to fill the holes of the first chest mask image to obtain a second chest mask image; subtract the first chest mask image from the second chest mask image to obtain a second lung parenchyma mask image; eliminate the connected areas in the second lung parenchyma mask image whose area is larger than a preset area to obtain a third lung parenchyma mask image; and perform an AND operation on the third lung parenchyma mask image and the original image to obtain the first lung parenchyma image.

[0017] In one embodiment of the present invention, the positioning module is specifically used to: use a boundary tracking method to obtain a set of boundary points of the left and right lungs in the first lung parenchyma image; use a Graham scanning method to calculate the concavity and convexity of each point on the boundary point set to obtain the convex hull of the lung parenchyma mask.

[0018] In one embodiment of the present invention, the positioning module is further configured to obtain the slope change frequency of the first area to be repaired by using the following formula:

[0019]

[0020] Where n is a positive integer greater than or equal to 2, s 1 (x,y),s 2 (x,y),......,s n (x,y),s n+1 (x, y) are the 1st to n+1th contour points in the first area to be repaired, S is the set of the 1st to n+1th contour points, θ n is the slope between the n-1th contour point and the nth contour point, θ n+1 is the slope between the nth contour point and the n+1th contour point, t n-1 is the product of the slope between the n-1th contour point and the nth contour point and the slope between the nth contour point and the n+1th contour point, ω n-2 is the number of slope changes corresponding to the n-1th contour point, ω n-1 is the number of slope changes corresponding to the nth contour point.

[0021] In one embodiment of the present invention, the repair module is specifically used to fit a k-order non-uniform rational B-spline curve using the following formula:

[0022]

[0023] Among them, d i is the i-th sampling point, i=0, 1, ..., m-1, N i,k (u) is the k-order basis function corresponding to the i-th sampling point, λ i is the weight of the i-th sampling point, and l(u) is the k-th non-uniform rational B-spline curve.

[0024] Beneficial effects of the present invention:

[0025] The present invention can greatly improve the accuracy of lung parenchyma segmentation. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 Flow chart of the method for segmenting lung parenchyma of pleural adhesion type according to an embodiment of the present invention;

[0027] Figure 2 A logical schematic diagram of a method for segmenting lung parenchyma of pleural adhesion type according to an embodiment of the present invention;

[0028] Figure 3 A logical schematic diagram of a method for acquiring a first lung parenchyma image according to an embodiment of the present invention;

[0029] Figure 4 A schematic diagram of calculating the convex hull of a boundary point set P according to a specific embodiment of the present invention;

[0030] Figure 5 A schematic diagram of a lung parenchyma convex hull and the area it constitutes according to a specific embodiment of the present invention;

[0031] Figure 6 Schematic diagram of a block diagram of a pleural adhesion type lung parenchyma segmentation system according to an embodiment of the present invention.

[0032] Figure 7 This is a schematic diagram of the output results of a pleural adhesion-type lung parenchyma segmentation system according to a specific embodiment of the present invention. DETAILED DESCRIPTION

[0033] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0034] Figure 1 4 is a flow chart of a method for segmenting pleural adhesion-type lung parenchyma according to an embodiment of the present invention.

[0035] In the related art, digital image processing and deep learning methods are generally used to perform lung parenchyma segmentation. However, the accuracy of lung parenchyma segmentation using this method is relatively low, mainly manifested as follows: (1) The lesions of pleural adhesions are very similar to the chest cavity and mediastinum, which makes it difficult to locate them during segmentation; (2) The natural depressions of the lung parenchyma are easily confused with the lesions, resulting in under-segmentation or over-segmentation of the image segmentation method; (3) The shape of the lung parenchyma contour is variable, and during repair, the fitted contour often does not match the actual lung parenchyma contour, resulting in reduced segmentation accuracy.

[0036] To this end, the present invention proposes a pleural adhesion type lung parenchyma segmentation method, which utilizes the slope change frequency to analyze the edge complexity and the cubic non-uniform rational B-spline to approximate the damaged contour, accurately distinguishes the true or false lesions, and precisely repairs the damaged contour, ultimately achieving precise segmentation of the pleural adhesion type lung parenchyma, greatly improving the accuracy of lung parenchyma segmentation.

[0037] like Figure 1 As shown, the pleural adhesion type lung parenchyma segmentation method according to the embodiment of the present invention may include the following steps:

[0038] S1, performing image preprocessing on the original image to obtain a first lung parenchyma image, wherein the original image is an image obtained by scanning the lung parenchyma.

[0039] That is to say, Figure 2 As shown, the lung parenchyma may be scanned in advance to obtain an original image, and the original image may be used as an image input to perform preliminary segmentation of the lung parenchyma on the original image, that is, image preprocessing is performed on the original image.

[0040] The following describes in detail how to perform image preprocessing on the original image to obtain the first lung parenchyma image in conjunction with a specific embodiment.

[0041] Specifically, Figure 3 As shown, in one embodiment of the present invention, first, the original image is binarized to obtain a binarized image, and then the binarized image is bitwise inverted to obtain a first target image. It should be noted that before the original image is binarized, the original image may be Gaussian filtered and then binarized. Secondly, in order to remove the holes formed by tissues such as blood vessels in the bed board of the medical equipment and the lung parenchyma in the image, a circular structure element (for example, a circular structure element with a radius of 5) is used to close the first target image and bitwise invert it again to obtain a second target image, that is, a morphological operation is performed, and then a connected component labeling method is used to extract the maximum connected area from the second target image to obtain a first chest mask image, that is, a connected area selection is performed, and the hole filling method is used to fill the holes in the first chest mask image to obtain a second chest mask image (that is, a second chest mask image without lungs). Finally, the first chest mask image is subtracted from the second chest mask image to obtain a second lung parenchymal mask image, that is, mask extraction is performed, and the connected areas with an area larger than a preset area in the second lung parenchymal mask image are removed to obtain a third lung parenchymal mask image. Specifically, since the pixel grayscale value of the trachea is close to the pixel grayscale value of the lung parenchyma, the trachea area is always retained in the figure, and the area of ​​the connected area is represented by S. The threshold area S=800 can remove the trachea image, and the lung parenchyma mask M is obtained. 1 (ie, the third lung parenchyma mask image), perform an AND operation on the third lung parenchyma mask image and the original image to obtain the first lung parenchyma image, that is, perform boundary extraction, and then output the image.

[0042] It should be noted that, in the coarse segmentation stage, the lung parenchyma mask (the third lung parenchyma mask image) can be recorded as “M1 "; the lung parenchyma mask contour can be recorded as "C 1 "; lung parenchyma can be recorded as "O 1 In the restoration stage, the restored contour is recorded as “NC”; the complete lung parenchyma mask (i.e., the first lung parenchyma mask) can be recorded as “M 2 "; the complete lung parenchyma (i.e., the second lung parenchyma image) can be recorded as "O 2 ”.

[0043] S2, obtaining the convex hull of the lung parenchyma mask in the first lung parenchyma image, and calculating the Euclidean distance between two adjacent convex hull points in the convex hull of the lung parenchyma mask, and locating the area corresponding to the convex hull points whose Euclidean distance is within a threshold range as the first area to be repaired, and obtaining the slope change frequency of the first area to be repaired, and locating the area whose slope change frequency is greater than a preset frequency as the second area to be repaired.

[0044] Specifically, based on the first lung parenchyma image obtained by coarse segmentation, three precise descriptions at different scales can be made in turn, namely, finding the envelope convex hull of the lung parenchyma, calculating the distance between convex hull points, and analyzing the frequency of slope change of the lesion edge, so as to achieve the overall characteristic description of the lung parenchyma, local perception of the lung parenchyma contour, and complexity analysis of the lesion edge, and finally locate the real lesion area, that is, the second area to be repaired.

[0045] In one embodiment of the present invention, obtaining the convex hull of the lung parenchyma mask in the first lung parenchyma image includes: using a boundary tracing method to obtain a set of boundary points of the left and right lungs in the first lung parenchyma image; using a Graham scanning method to respectively calculate the convexity of each point on the boundary point set to obtain the convex hull of the lung parenchyma mask.

[0046] Specifically, first, the boundary tracking method can be used to obtain the boundary point set P of the left and right lungs in the first lung parenchyma image. Specifically, traverse the image and search from the upper left corner for the foreground pixel of the first pixel block encountered by the image mark. This point is the pixel with the smallest row and smallest column in the foreground pixel. Then search the 3×3 neighborhood of the current pixel in a counterclockwise order. If there are foreground pixels around, mark the new pixel point. Finally, repeat the above steps until the pixel marked for the first time in this pixel block is encountered. Traverse the entire image to obtain the boundary point set P.

[0047] Secondly, the Graham scanning method is used to calculate the concavity of each point on the boundary point set P to obtain the convex point set Q of the left and right lungs, that is, Figure 2 As shown in Figure 1, the convex hull of the lung parenchyma contour is extracted and the damaged area is located. n+1 The discriminant formula of concavity and convexity is:

[0048] r=(p n+1 -p n-1 )×(pn -p n-1 ),

[0049] Among them, p n-1 ,p n ,p n+1 are three adjacent points on the point set P, and “×” represents the cross product.

[0050] Specifically, if Figure 4 As shown in Figure 1, the idea of ​​calculating the convex hull of the boundary point set P is as follows: (1) Place all the points on the point set P in a two-dimensional coordinate system. The point with the smallest ordinate must be a point on the convex hull. Define this point as the origin of the coordinate system and let p be the origin of the convex hull. n-1 ; (2) Calculate the relative value of other points to p n-1 Arrange the points in ascending order. When the angles are equal, the distance p n-1 The closest ones are placed in front; (3) n The dot behind is p n+1 As the current point, push them into the stack one by one, calculate the r value, and if r < 0, determine p n+1 If r>0, it is not a point on the convex hull and the current point is popped out of the stack. If r=0, the point farther from the origin is considered to be a point on the convex hull and the current point is stored in the stack. (4) Check whether each current point is the last element in the point set. If not, repeat the previous step for the following points. After traversing all the points, connect the points stored in the stack in sequence to obtain the convex hull of the lung parenchyma mask, i.e., the convex point set Q.

[0051] Further, each convex hull point in the convex point set Q is traversed to calculate the Euclidean distance between two adjacent convex hull points, and then the threshold between the convex hull points is determined as dis according to prior knowledge, that is, the dis distance between the convex hull points is calculated. In a specific embodiment of the present invention, the threshold range can be expressed as 10<dis<60, such as Figure 5 As shown in the figure, the main concave areas of the lung parenchyma contour are divided into three categories: pleural adhesion lesion area "A", natural concave area "B", and mediastinum area "C". According to the morphological characteristics that the distance between the two convex points of the mediastinal concave C is much larger than the distance between the convex points of the two end points of other lesion areas, the lesion area with a convex point distance within the threshold range can be preliminarily located as the area that needs to be repaired, that is, the first area to be repaired. Beyond this range, it is considered that no repair is required, but this cannot completely eliminate the interference of the natural concave area.

[0052] That is to say, if the DIS distance is not within the threshold range, it is judged as a non-lesion area. If the DIS distance is within the threshold range, the complexity of the lesion edge features is further described.

[0053] Therefore, the frequency of slope change of the edge of the lesion can be calculated, and the frequency of slope change of the edge of the lesion can be analyzed. By analyzing the characteristics of this type of tuberculosis lesions, compared with area B, the contour of the lesion area is extremely irregular and not smooth. Therefore, the frequency of slope change of the lesion area contour can be used to judge the lesion area and the non-lesion area. By resampling the contour point set of the area to be repaired at equal intervals, the resampled points are traversed and the slopes of each point and the previous and next points are calculated. Among them, the slope change frequency of the first area to be repaired can be obtained by the following formula:

[0054]

[0055] Where n is a positive integer greater than or equal to 2, s 1 (x,y),s 2 (x,y),......,s n (x,y),s n+1 (x, y) are the 1st to n+1th contour points in the first area to be repaired, S is the set of 1st to n+1th contour points, θ n is the slope between the n-1th contour point and the nth contour point, θ n+1 is the slope between the nth contour point and the n+1th contour point, t n-1 is the product of the slope between the n-1th contour point and the nth contour point and the slope between the nth contour point and the n+1th contour point, ω n-2 is the number of slope changes corresponding to the n-1th contour point, ω n-1 is the number of slope changes corresponding to the nth contour point. Initial value ω 0 is 0.

[0056] According to the characteristics of the lesion edge, t n-1 >0, that is, θ n ,θ n+1 If the sign is the same, then it remains unchanged; when t n-1 <0,θ n ,θ n+1 The positive and negative signs are different, which indicates that the complexity of the lesion contour at the current point is high. n-1Increase by 1. From the microscopic pixel level, the points on the edge of the lesion are densely sampled and the slope changes between adjacent points are calculated in order to be described as the complexity of the lesion edge curve from a high-level semantic point. For the relatively smooth naturally depressed pseudo-lesion B, the edge complexity is low, while the real pleural adhesion lesion A has a higher edge complexity. In other words, if the frequency of the slope change of the lesion edge is greater than the preset frequency, the lesion is judged to be true. If the frequency of the slope change of the lesion edge is less than the preset frequency, it is judged to be a natural depression of the lung parenchyma. In a specific embodiment of the present invention, the preset frequency may be 8, that is, the slope change frequency is greater than 8, which is a real lesion area, that is, the second area to be repaired. Otherwise, it is a pseudo-lesion and does not need to be considered.

[0057] S3, respectively obtaining m sampling points on the convex hull points at both ends of the second area to be repaired and the lung parenchyma mask contour, and fitting a k-order non-uniform rational B-spline curve according to the m sampling points based on the k-order basis function, and repairing the mask contour of the second area to be repaired according to the k-order non-uniform rational B-spline curve to obtain a first lung parenchyma mask image, and obtaining a second lung parenchyma image according to the first lung parenchyma mask image.

[0058] Specifically, after locating the area to be repaired, in order to make the contour of the repaired tuberculosis lesion adhesion area "NC" consistent with the lung parenchyma mask contour "C 1 "Precise connection, through the mask contour of the adjacent lesion C 1 Get the control points of NURBS (i.e. the control points on the sampled lung substance), which are d 0 d 1 ,……,d m-1 , these m points are composed of the convex hull points at both ends of the area to be repaired and the sampling points on the lung parenchyma close to the lesion, for example Figure 5 As shown, we can sample d 0 d 1 d 2 and d 3 Four sampling points.

[0059] Based on the k-order basis function, a k-order non-uniform rational B-spline curve is fitted according to m sampling points using the following formula:

[0060]

[0061] Among them, d i is the i-th sampling point, i=0, 1, ..., m-1, N i,k (u) is the k-order basis function corresponding to the i-th sampling point, k can also be called the order of the basis function, the sub-normal B-spline basis function, N i,k (u) is represented by a non-decreasing parameter sequence U:u called the node vector u 0 ≤u1 ≤…≤u n+k+1 The u node vector is generally normalized, that is, u∈[u k ,u n+1 ]=[0,1].d i (i=0,1,...,n) is the i-th control point. The curve formed is constrained within the range of multiple consecutively connected polygons. i is the weight of the i-th sampling point, representing the influence of the control vertex on the curve shape. The change of the weight value will affect the stretching effect of the control point on the curve. Improper value will always interfere with the smoothness of the curve, resulting in the fitting curve not being able to well reflect the true contour characteristics of the lung parenchyma. Therefore, in order to reduce the influence of the control point weight on the curve, the present invention can also default to 1, so l(u) can be simplified as: l(u) is a non-uniform rational B-spline curve of degree k.

[0062] The basis functions in NURBS are obtained according to the Cox-de Boor recursive algorithm:

[0063]

[0064] The formula shows that to obtain the i-th k-th B-spline N i,k (u), u is required i ,u i+ 1,...u i+k+1 There are k+2 nodes in total.

[0065] That is to say, the basis function of the k-order non-uniform rational B-spline curve is:

[0066]

[0067] Where k is the number of basis functions, represents factorial, and j represents the control point index value.

[0068] In a specific embodiment of the present invention, the cubic non-uniform rational B-spline curve is calculated as follows:

[0069]

[0070] Similarly,

[0071]

[0072]

[0073]

[0074] The equation of the cubic non-uniform rational B-spline curve is obtained as:

[0075] l(u)=d 0 *N 0,3 (u)+d 1 *N 1,3 (u)+d 2 *N 2,3 (u)+d 3 *N 3,3 (u), based on the convex points at both ends of the located area to be repaired and the mask contour C 1 The two points on the NURBS can be used as control points d i , the mask contour of the lesion area is repaired by an approximate fitting method to obtain the first lung parenchyma mask image, that is, cubic NURBS is used to fit the damaged lung parenchyma contour.

[0076] Furthermore, when the mask profile C 1 After the repair is completed, the lung parenchyma mask M needs to be filled 1 The lesion area in 2 The corresponding region is extracted from the original image to complete the lung parenchyma segmentation, that is, the complete lung parenchyma "O 2 ” to output the image.

[0077] The steps are described as follows: (1) Filling the closed area. After the damaged contour is repaired, the fitted contour curve will form a closed area in the shape of the lesion with the lung parenchyma. The pixels in this area are 0, so this part of the pixels is filled with 255; (2) Because the lung parenchyma mask is a binary image, we read the original image as a binary image, and perform a bitwise "AND" operation on the lung parenchyma mask and the original image to segment the complete lung parenchyma, that is, to obtain the second lung parenchyma image.

[0078] The present invention combines digital image processing technology with graph theory methods to provide a more accurate lung parenchyma segmentation system for pleural adhesion-type pulmonary tuberculosis lesions. The present invention is based on the premise of detecting image edges to obtain point sets and obtaining convex hulls, and improves the convex hull algorithm to make the positioning of lesions, non-lesion depressions and convex hull points on both sides of the mediastinum more accurate. In addition, the present invention aims at the over-repairing problem existing in natural depression areas of lung parenchyma, and proposes a method for distinguishing real lesions and natural depression areas based on the slope feature description of the depression area, which effectively solves the over-repairing problem. In addition, in the process of fitting the lung parenchyma contour in the lesion area, the present invention proposes a method for approximate fitting using non-uniform rational B-spline curves, and unifies the weights of its control points, so that the fitted contour is more consistent with the characteristics of the original lung parenchyma contour, and the segmentation accuracy of the lung parenchyma is higher.

[0079] In summary, according to the pleural adhesion type lung parenchyma segmentation method of the embodiment of the present invention, the original image is preprocessed to obtain a first lung parenchyma image, and the lung parenchyma mask convex hull in the first lung parenchyma image is obtained, and the Euclidean distance between two adjacent convex hull points in the lung parenchyma mask convex hull is calculated, and the area corresponding to the convex hull point whose Euclidean distance is within the threshold range is positioned as the first area to be repaired, and the slope change frequency of the first area to be repaired is obtained, and the area with a slope change frequency greater than a preset frequency is positioned as the second area to be repaired, and m sampling points are respectively obtained on the convex hull points at both ends of the second area to be repaired and the lung parenchyma mask contour, and a k-order non-uniform rational B-spline curve is fitted according to the m sampling points based on the k-order basis function, and the mask contour of the second area to be repaired is repaired according to the k-order non-uniform rational B-spline curve to obtain the first lung parenchyma mask image, and the second lung parenchyma image is obtained according to the first lung parenchyma mask image. Thus, the accuracy of lung parenchyma segmentation can be greatly improved.

[0080] Corresponding to the pleural adhesion type lung parenchyma segmentation method of the above embodiment, the present invention also proposes a pleural adhesion type lung parenchyma segmentation system.

[0081] like Figure 6 As shown, the pleural adhesion type lung parenchyma segmentation system according to the embodiment of the present invention may include: a coarse segmentation module 100 , a positioning module 200 and a repair module 300 .

[0082] Among them, the coarse segmentation module 100 is used to perform image preprocessing on the original image to obtain a first lung parenchyma image, wherein the original image is an image obtained by scanning the lung parenchyma; the positioning module 200 is used to obtain the lung parenchyma mask convex hull in the first lung parenchyma image, and calculate the Euclidean distance between two adjacent convex hull points in the lung parenchyma mask convex hull, and locate the area corresponding to the convex hull point whose Euclidean distance is within the threshold range as the first area to be repaired, and obtain the slope change frequency of the first area to be repaired, and locate the area whose slope change frequency is greater than the preset frequency as the second area to be repaired; the repair module 300 is used to obtain m sampling points on the convex hull points at both ends of the second area to be repaired and the lung parenchyma mask contour, respectively, and fit a k-order non-uniform rational B-spline curve according to the m sampling points based on the k-order basis function, and repair the mask contour of the second area to be repaired according to the k-order non-uniform rational B-spline curve to obtain the first lung parenchyma mask image, and obtain the second lung parenchyma image according to the first lung parenchyma mask image.

[0083] In one embodiment of the present invention, the coarse segmentation module 100 is specifically used to: binarize the original image to obtain a binary image; bitwise invert the binary image to obtain a first target image; use a circular structure element to perform a closing operation on the first target image and bitwise invert it again to obtain a second target image; use a connected component marking method to extract the maximum connected area from the second target image to obtain a first chest mask image; use a hole filling method to fill the holes of the first chest mask image to obtain a second chest mask image; subtract the first chest mask image from the second chest mask image to obtain a second lung parenchyma mask image; eliminate the connected areas in the second lung parenchyma mask image whose area is larger than a preset area to obtain a third lung parenchyma mask image; and perform an AND operation on the third lung parenchyma mask image and the original image to obtain a first lung parenchyma image.

[0084] In one embodiment of the present invention, the positioning module 200 is specifically used to: use the boundary tracking method to obtain the boundary point set of the left and right lungs in the first lung parenchyma image; use the Graham scanning method to calculate the concavity and convexity of each point on the boundary point set to obtain the convex hull of the lung parenchyma mask.

[0085] In one embodiment of the present invention, the positioning module 200 is further configured to obtain the slope change frequency of the first area to be repaired by using the following formula:

[0086]

[0087] Where n is a positive integer greater than or equal to 2, s 1 (x,y),s 2 (x,y),......,s n (x,y),s n+1 (x, y) are the 1st to n+1th contour points in the first area to be repaired, S is the set of 1st to n+1th contour points, θ n is the slope between the n-1th contour point and the nth contour point, θ n+1 is the slope between the nth contour point and the n+1th contour point, t n-1 is the product of the slope between the n-1th contour point and the nth contour point and the slope between the nth contour point and the n+1th contour point, ω n-2 is the number of slope changes corresponding to the n-1th contour point, ω n-1 is the number of slope changes corresponding to the nth contour point.

[0088] In one embodiment of the present invention, it is characterized in that the repair module 300 is specifically used to fit the k-order non-uniform rational B-spline curve through the following formula:

[0089]

[0090] Among them, d i is the i-th sampling point, i=0, 1, ..., m-1, N i,k (u) is the k-th basis function corresponding to the i-th sampling point, λ i is the weight of the i-th sampling point, and l(u) is a k-degree non-uniform rational B-spline curve.

[0091] It should be noted that a more specific embodiment of the pleural adhesion type lung parenchyma segmentation system of the embodiment of the present invention can refer to the embodiment of the pleural adhesion type lung parenchyma segmentation method described above, and will not be described in detail here to avoid redundancy.

[0092] Among them, when the pleural adhesion type lung parenchyma segmentation system based on the embodiment of the present invention implements the pleural adhesion type lung parenchyma segmentation method of the above embodiment, the corresponding output result (i.e., the second lung parenchyma image segmented) can be as follows: Figure 7 shown.

[0093] According to the pleural adhesion type lung parenchyma segmentation system of the embodiment of the present invention, the original image is preprocessed by the coarse segmentation module to obtain the first lung parenchyma image, and the lung parenchyma mask convex hull in the first lung parenchyma image is obtained by the positioning module, and the Euclidean distance between two adjacent convex hull points in the lung parenchyma mask convex hull is calculated, and the area corresponding to the convex hull point whose Euclidean distance is within the threshold range is positioned as the first area to be repaired, and the slope change frequency of the first area to be repaired is obtained, and the area with a slope change frequency greater than the preset frequency is positioned as the second area to be repaired, and m sampling points are respectively obtained on the convex hull points at both ends of the second area to be repaired and the lung parenchyma mask contour by the repair module, and a k-order non-uniform rational B-spline curve is fitted according to the m sampling points based on the k-order basis function, and the mask contour of the second area to be repaired is repaired according to the k-order non-uniform rational B-spline curve to obtain the first lung parenchyma mask image, and the second lung parenchyma image is obtained according to the first lung parenchyma mask image. Thus, the accuracy of lung parenchyma segmentation can be greatly improved.

[0094] In the description of the present invention, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. "Multiple" means two or more, unless otherwise clearly and specifically defined.

[0095] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0096] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may mean that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, a first feature being "above", "above" or "above" a second feature may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is higher in level than the second feature. A first feature being "below", "below" or "below" a second feature may mean that the first feature is directly below or obliquely below the second feature, or simply means that the first feature is lower in level than the second feature.

[0097] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.

[0098] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.

[0099] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0100] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0101] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0102] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0103] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present invention. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.

Claims

1. A method for segmenting lung parenchyma of pleural adhesion type, characterized in that: The following steps are involved: Performing image preprocessing on the original image to obtain a first lung parenchyma image, wherein the original image is an image obtained by scanning the lung parenchyma; wherein performing image preprocessing on the original image to obtain the first lung parenchyma image includes: binarizing the original image to obtain a binarized image; bitwise inverting the binarized image to obtain a first target image; using a circular structure element to perform a closing operation on the first target image and bitwise inverting it again to obtain a second target image; using a connected component marking method to extract the maximum connected area from the second target image to obtain a first chest mask image; using a hole filling method to perform hole filling on the first chest mask image to obtain a second chest mask image; performing a subtraction operation on the first chest mask image and the second chest mask image to obtain a second lung parenchyma mask image; eliminating the connected areas in the second lung parenchyma mask image whose area is larger than a preset area to obtain a third lung parenchyma mask image; performing an AND operation on the third lung parenchyma mask image and the original image to obtain the first lung parenchyma image; Obtain the convex hull of the lung parenchyma mask in the first lung parenchyma image, calculate the Euclidean distance between two adjacent convex hull points in the convex hull of the lung parenchyma mask, and locate the area corresponding to the convex hull points whose Euclidean distance is within the threshold range as the first area to be repaired, and obtain the slope change frequency of the first area to be repaired, and locate the area whose slope change frequency is greater than the preset frequency as the second area to be repaired; wherein the slope change frequency of the first area to be repaired is obtained by the following formula: Where n is a positive integer greater than or equal to 2, are the 1st to n+1th contour points in the first area to be repaired, S is the set of the 1st to n+1th contour points, θ n is the slope between the n-1th contour point and the nth contour point, θ n+1 is the slope between the nth contour point and the n+1th contour point, t n-1 is the product of the slope between the n-1th contour point and the nth contour point and the slope between the nth contour point and the n+1th contour point, ω n-2 is the number of slope changes corresponding to the n-1th contour point, ω n-1 is the number of slope changes corresponding to the nth contour point; m sampling points are respectively obtained on the convex hull points at both ends of the second area to be repaired and the lung parenchyma mask contour, and a k-order non-uniform rational B-spline curve is fitted according to the m sampling points based on a k-order basis function, and the mask contour of the second area to be repaired is repaired according to the k-order non-uniform rational B-spline curve to obtain a first lung parenchyma mask image, and a second lung parenchyma image is obtained according to the first lung parenchyma mask image.

2. The method for segmenting pleural adhesion type lung parenchyma according to claim 1, characterized in that: Acquiring the lung parenchyma mask convex hull in the first lung parenchyma image includes: Acquire a set of boundary points of the left and right lungs in the first lung parenchyma image by using a boundary tracing method; The Graham scanning method is used to calculate the concavity and convexity of each point on the boundary point set to obtain the convex hull of the lung parenchyma mask.

3. The method for segmenting pleural adhesion type lung parenchyma according to claim 2, characterized in that: The k-order non-uniform rational B-spline curve is fitted by the following formula: Among them, d i is the i-th sampling point, i=0, 1, ..., m-1, N i,k (u) is the k-order basis function corresponding to the i-th sampling point, λ i is the weight of the i-th sampling point, and l(u) is the k-th non-uniform rational B-spline curve.

4. A pleural adhesion type lung parenchyma segmentation system, characterized in that: include: A coarse segmentation module, the coarse segmentation module is used to perform image preprocessing on the original image to obtain a first lung parenchyma image, wherein the original image is an image obtained by scanning the lung parenchyma; wherein the coarse segmentation module is specifically used to: perform binarization processing on the original image to obtain a binarized image; bitwise invert the binarized image to obtain a first target image; use a circular structure element to perform a closing operation on the first target image and bitwise invert it again to obtain a second target image; use a connected component marking method to extract the maximum connected area from the second target image to obtain a first chest mask image; use a hole filling method to fill holes in the first chest mask image to obtain a second chest mask image; perform a subtraction operation on the first chest mask image and the second chest mask image to obtain a second lung parenchyma mask image; eliminate the connected areas in the second lung parenchyma mask image whose area is larger than a preset area to obtain a third lung parenchyma mask image; and perform an AND operation on the third lung parenchyma mask image and the original image to obtain the first lung parenchyma image; A positioning module, the positioning module is used to obtain the convex hull of the lung parenchyma mask in the first lung parenchyma image, and calculate the Euclidean distance between two adjacent convex hull points in the convex hull of the lung parenchyma mask, and locate the area corresponding to the convex hull point whose Euclidean distance is within the threshold range as the first area to be repaired, and obtain the slope change frequency of the first area to be repaired, and locate the area whose slope change frequency is greater than the preset frequency as the second area to be repaired; wherein the positioning module is specifically used to obtain the slope change frequency of the first area to be repaired by the following formula: Where n is a positive integer greater than or equal to 2, are the 1st to n+1th contour points in the first area to be repaired, S is the set of the 1st to n+1th contour points, θ n is the slope between the n-1th contour point and the nth contour point, θ n+1 is the slope between the nth contour point and the n+1th contour point, t n-1 is the product of the slope between the n-1th contour point and the nth contour point and the slope between the nth contour point and the n+1th contour point, ω n-2 is the number of slope changes corresponding to the n-1th contour point, ω n-1 is the number of slope changes corresponding to the nth contour point; A repair module, wherein the repair module is used to obtain m sampling points on the convex hull points at both ends of the second area to be repaired and the lung parenchyma mask contour, respectively, and fit a k-order non-uniform rational B-spline curve according to the m sampling points based on a k-order basis function, and repair the mask contour of the second area to be repaired according to the k-order non-uniform rational B-spline curve to obtain a first lung parenchyma mask image, and obtain a second lung parenchyma image according to the first lung parenchyma mask image.

5. The pleural adhesion type lung parenchyma segmentation system according to claim 4, characterized in that: The positioning module is specifically used for: Acquire a set of boundary points of the left and right lungs in the first lung parenchyma image by using a boundary tracking method; The Graham scanning method is used to calculate the concavity and convexity of each point on the boundary point set to obtain the convex hull of the lung parenchyma mask.

6. The pleural adhesion type lung parenchyma segmentation system according to claim 5, characterized in that: The repair module is specifically used to fit a k-order non-uniform rational B-spline curve using the following formula: Among them, d i is the i-th sampling point, i=0, 1, ..., m-1, N i,k (u) is the k-order basis function corresponding to the i-th sampling point, λ i is the weight of the i-th sampling point, and l(u) is the k-th non-uniform rational B-spline curve.

Citation Information

Patent Citations

  • Image sag repairing method based on double-Graham scanning method

    CN108335277A

  • Fully automatic segmentation method for lung parenchyma CT images

    CN109410166A