A lung medical image optimization segmentation method

Through clustering algorithm, the optimal number of segmented clusters was obtained, and combined with the lung and bone regions, the problem of difficulty in setting K values ​​in the existing technology was solved, and efficient tracheal segmentation of the lung region was achieved. and the accuracy of disease judgment.

CN118691630BActive Publication Date: 2024-11-05北京智想创源科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411155697.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-11-05
Estimated Expiration
2044-08-22

AI Technical Summary

Technical Problem

The prior art requires manual setting of K value during the lung CT image segmentation process. If the K value is too small, the tracheal segmentation will be incomplete, and if it is too large, the noise point will be generated, affecting the tracheal judgment.

Method used

The CT images of the lungs are segmented through clustering algorithms. The bone areas are first divided, and the optimal number of segmented clusters is obtained according to the degree of tracheal segmentation under different cluster categories. The optimal segmented images are obtained by combining the lung areas and bone areas. , eliminate noise points and unnecessary segmentation areas.

Benefits of technology

It realizes efficient tracheal segmentation in the lung area, reduces interference from the bone area to the tracheal area, and improves the accuracy of disease judgment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118691630B_ABST
    Figure CN118691630B_ABST
Patent Text Reader

Abstract

The present invention relates to a lung medical image optimization segmentation method, and relates to the field of image processing technology. The method comprises the following steps: obtaining a lung CT image; obtaining a bone region and a lung region; obtaining the number of clusters corresponding to the maximum tracheal segmentation degree as the optimal number of clusters for segmenting the lung region; segmenting the lung region using the optimal number of clusters to obtain a lung segmentation map; combining the lung segmentation map with the bone region to obtain the optimal segmentation image of the lung CT image. The present invention utilizes image processing technology to process the acquired lung CT image to obtain the lung region, obtain the optimal number of segmentation clusters according to the lung tracheal segmentation degree under different clustering effects, and then obtain the optimal segmentation map.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a lung medical image optimization segmentation method. Background Art

[0002] Lung CT is an imaging examination method, a technology that uses computerized tomography to determine chest and lung diseases. This technology can be used to diagnose lung diseases, such as lung infections, lung tumors, and lung inflammation in lung tissue lesions.

[0003] Medical technology for studying various lung diseases requires simultaneous detection of the trachea in lung images. First, the lung CT image needs to be preprocessed, the lung area is extracted, and then the lung area is segmented. The existing technology segments the lung image through the K-means clustering algorithm. During the segmentation process, the K value needs to be manually set, and the selection of the K value has high requirements. If the selected K value is too small, the segmentation of the small trachea in the lung area will be incomplete; if the selected K value is too large, the segmented lung area will have noise points, which will affect the judgment of the trachea. Summary of the invention

[0004] In order to address the deficiencies in the prior art, the present invention provides a lung medical image optimization segmentation method, which utilizes image processing technology to process the acquired lung CT images to obtain the lung region, and obtains the optimal number of segmentation clusters according to the degree of lung trachea segmentation under different clustering effects, thereby obtaining the optimal segmentation map.

[0005] A lung medical image optimization segmentation method of the present invention comprises the following steps:

[0006] Obtain lung CT images;

[0007] Set the number of clusters to 2, and segment the CT image into bone and lung regions using the clustering algorithm;

[0008] The lung region is segmented by setting different numbers of clusters to obtain multiple category images corresponding to each number of clusters;

[0009] Perform connected domain detection on each category image corresponding to any number of clusters to obtain multiple connected domains;

[0010] Perform convex hull detection on each connected domain to obtain the convex hull edge corresponding to each connected domain;

[0011] Obtain all the coincident points on the edge of the convex hull corresponding to each connected domain; obtain the degree of difference between any two adjacent coincident points in each connected domain according to the number of pixels between any two adjacent coincident points in each connected domain;

[0012] The tracheal similarity of each connected domain is obtained according to the maximum value of the difference between all two adjacent coincident points in each connected domain, the area of ​​each connected domain and the area of ​​the convex hull corresponding to each connected domain; the tracheal similarity of each category image corresponding to each connected domain is obtained in turn;

[0013] The trachea segmentation degree of each category image is obtained according to the trachea similarity of each category image corresponding to each connected domain;

[0014] Similarly, the trachea segmentation degree of each category image corresponding to each cluster number is obtained;

[0015] The number of clusters corresponding to the maximum trachea segmentation degree is obtained as the optimal number of clusters for segmenting the lung area;

[0016] The lung region is segmented using the optimal number of clusters to obtain a lung segmentation map;

[0017] The lung segmentation map is combined with the bone region to obtain the optimal segmentation image of the lung CT image.

[0018] In one embodiment, each category image is obtained according to the following steps:

[0019] The lung area is segmented by setting different numbers of clusters to obtain a set of multiple category pixels corresponding to each number of clusters; the pixel values ​​of the pixels in each category are set to 1, and the pixel values ​​of other pixels are set to 0 to obtain a binary mask corresponding to each category;

[0020] Each category image is obtained by multiplying the binary mask corresponding to each category with the CT image;

[0021] Multiple category images corresponding to each cluster number are obtained in turn.

[0022] In one embodiment, the difference between any two adjacent coincident points in each connected domain is obtained according to the following steps:

[0023] According to the number of pixels between any two adjacent coincident points in each connected domain, the maximum number of pixels between two adjacent coincident points and the minimum number of pixels between two adjacent coincident points are obtained;

[0024] According to the number of pixels between any two adjacent coincident points, the maximum number of pixels between any two adjacent coincident points, and the minimum number of pixels between any two adjacent coincident points, the degree of difference between any two adjacent coincident points in each connected domain is obtained.

[0025] In one embodiment, the trachea similarity calculation formula of each connected domain is as follows:

[0026]

[0027] In the formula, represents the tracheal similarity of each connected domain; The maximum value of the difference between all two adjacent coincident points in each connected domain; Represents a connected domain area; Connected domain The corresponding convex hull area; is 0.7, is 0.3; among them, Represents the nth connected domain corresponding to the i-th category image; Represents the convex hull corresponding to the nth connected domain corresponding to the i-th category image.

[0028] In one embodiment, the trachea segmentation level of each category image is obtained according to the following steps:

[0029] According to the trachea similarity of each category image corresponding to each connected domain, the connected domain corresponding to which the similarity is greater than or equal to a preset threshold is obtained;

[0030] According to the connected domain corresponding to each trachea similarity greater than or equal to the preset threshold, and the number of connected domains corresponding to all trachea similarities greater than or equal to the preset threshold in the category image corresponding to the connected domain, the trachea segmentation degree of each category image is obtained.

[0031] The beneficial effects of the present invention are as follows: the present invention provides a lung medical image optimization segmentation method, which is based on a clustering algorithm. After the bone region in the lung CT image is segmented out a priori, it is convenient to segment the lung region later; then, the trachea segmentation degree under different numbers of clusters is obtained according to the shape information of the trachea in the lung region, and the optimal number of segmentation clusters is obtained according to the trachea segmentation degree, and the optimal number of segmentation clusters is obtained according to the optimal number of segmentation clusters, so as to avoid segmenting the lung CT image by setting the same number of clusters, and the bone region will produce unnecessary segmentation areas, which will affect the observation effect of the lung trachea region and thus affect the judgment of internal lung diseases; finally, the optimal segmentation image of the lung region is combined with the bone region to obtain the optimal segmentation image, which can make the lung region have a better trachea segmentation effect and eliminate the interference of the bone region and useless background information on the lung region. Doctors can make accurate judgments on lesions based on the optimal segmentation image. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0033] Figure 1 A flowchart of the overall steps of an embodiment of a lung medical image optimization segmentation method of the present invention;

[0034] Figure 2 This is a lung CT image;

[0035] Figure 3 It is the binary image of lung area;

[0036] Figure 4 This is the lung area image;

[0037] Figure 5 is the bone region image;

[0038] Figure 6 Schematic diagram of setting different numbers of clusters for segmentation of the first lung CT image;

[0039] Figure 7 Schematic diagram of setting different numbers of clusters for segmentation of the second lung CT image;

[0040] Figure 8 is the convex hull edge contour of the tracheal connection domain in the lung area;

[0041] Fig. 9 It is the convex hull edge contour map of the connected domain of noise points in the lung area;

[0042] Fig.10 is the optimal segmented image. DETAILED DESCRIPTION

[0043] 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.

[0044] The present invention first performs segmentation processing on the image to obtain the lung region and the external skeleton region. The lung region is clustered to different degrees to obtain the trachea segmentation degree after different cluster processing. The optimal segmentation cluster number is obtained according to the segmentation degree. Then, the external skeleton region obtained in advance and the lung region image segmented by the optimal segmentation cluster number are combined to obtain the optimal segmentation image.

[0045] The present invention provides a lung medical image optimization segmentation method, see Figure 1 As shown, the method includes:

[0046] S1. Obtain lung CT images;

[0047] In this embodiment, a lung CT image is acquired, see Figure 2 As shown, there are only bones, trachea and lung areas in the CT image, and the colors of the bones, trachea and lung areas are different.

[0048] S2, setting the number of clusters to 2, segmenting the CT image using a clustering algorithm to obtain the bone region and the lung region;

[0049] In this embodiment, the K-means clustering algorithm is used, and the number of clusters is recorded as K. According to this prior information, K=2 can be set to perform cluster segmentation on the image to obtain a preliminary segmentation image; wherein the preliminary segmentation image includes the first cluster of bones and the trachea area between the bones, and the second cluster of lungs. By calculating the mean of the central pixel values ​​of the two clusters, the mean is used as the threshold, see Figure 3 As shown, the CT image is threshold segmented to obtain a binary image; then the binary image is opened to eliminate the influence of the trachea in the lung area, obtain the lung mask, and multiply the lung mask with the original CT image, see Figure 4 As shown, the lung region is obtained;

[0050] Then, the pixel value of the lung area is set to 0, and the lung area is multiplied with the initial segmentation image after cluster segmentation. Figure 5 As shown, the bone region is obtained.

[0051] At this point, the number of clusters is set to 2 a priori, and the CT image is segmented into the bone region and the lung region using the clustering algorithm;

[0052] What is obtained here is only a lung region image of the original CT cross-sectional image, because the lung trachea in the original image is not clear, so the image needs to be segmented. The subsequent segmentation operation is to segment the trachea region in the lung region to obtain a clearer lung image.

[0053] S3, obtaining the optimal number of clusters when segmenting the lung region;

[0054] It should be noted that when the number of clusters is set to 2, some tiny tracheae in the segmented lung area are not segmented due to their small area and insufficient pixel value change. When the number of clusters is set too large, there will be more noise points in the segmented image, which will affect the segmentation of the trachea in the area. The trachea segmentation degree under different cluster values ​​is compared, and an optimal number of segmentation clusters is obtained according to the segmentation degree.

[0055] In this embodiment, the K-means clustering algorithm is used to cluster the lung regions to different degrees. Since lung CT images are mostly tracheal tissues, the maximum number of classifications is set to 8 considering equipment loss and image characteristics. The empirical value can be adjusted according to specific circumstances in actual operation. The specific steps of image segmentation using the K-means clustering algorithm are as follows:

[0056] (1) Let the number of clusters k = j, where j = 2, 3, 4, 5, 6, 7, 8. The data set is the set of pixel values ​​in the image. Randomly select j center points from the data set as the initial cluster centers.

[0057] (2) Loop through each sample point in the data set, calculate the distance from the sample point to the center point of each initial cluster, and add the sample point to the cluster with the smallest distance.

[0058] (3) Calculate the mean distance in each cluster, take the mean as the new cluster center, traverse all clusters, and update the new cluster center.

[0059] (4) Continue iterating and repeating steps (2) and (3) until the position of the center point no longer changes.

[0060] At this point, the image after clustering segmentation is obtained.

[0061] For example, take any two lung CT images and segment them into different clusters. Figure 6 As shown in FIG. 1 , a schematic diagram of setting different numbers of clusters for segmentation of the first lung CT image is shown; see Figure 7 As shown in FIG. 1 , a schematic diagram of setting different numbers of clusters for segmentation of the second lung CT image is shown; Figure 6 and Figure 7 From the segmentation results of different lung images, it can be seen that for different cluster number K values, the clustering algorithm will give corresponding cluster segmentation results, but the segmentation effects of different cluster number K values ​​are different, see Figure 6 In the first lung CT image shown in FIG. 1 , when the number of clusters K is 4, the segmentation effect of the lung trachea is the best, while for Figure 7 In the second lung CT image shown, the segmentation effect of the lung trachea is best when the cluster number K value is 3. Therefore, for any lung CT image segmentation, it is necessary to obtain the optimal cluster number K value to segment the trachea in the lung.

[0062] S301, segmenting the lung region by setting different numbers of clusters to obtain multiple category images corresponding to each number of clusters;

[0063] Each category image is obtained by following the steps below:

[0064] The lung region is segmented by setting different numbers of clusters to obtain a set of multiple category pixel points corresponding to each number of clusters; the pixel value of the pixel points in each category is set to 1, and the pixel values ​​of other pixel points are set to 0 to obtain a binary mask corresponding to each category; it should be noted that other pixel points refer to other pixel points in the lung region except the pixel points in this category;

[0065] Each category image is obtained by multiplying the binary mask corresponding to each category with the CT image;

[0066] Multiple category images corresponding to each cluster number are obtained in turn.

[0067] For example, when the number of clusters K=3, the lung area is segmented by the K-means clustering algorithm to obtain three category pixel sets corresponding to the number of clusters K=3; the pixel values ​​of the pixels of each category in the three category pixel sets are set to 1, and the pixel values ​​of other pixels are set to 0 to obtain the binary mask corresponding to each category; the binary mask corresponding to each category is multiplied by the CT image to obtain each category image; that is, 3 category images are obtained.

[0068] It should be noted that, in this embodiment, the pixel value range of each category image is denoted as (a, b), c is denoted as the pixel value extreme difference value, that is, c=ba, {c} is denoted as the set of pixel value extreme differences of all category images, and the category image corresponding to the extreme difference value in {c} is removed. Since the background will be divided into one category during cluster segmentation, and the pixels on the background are meaningless to subsequent operations, this category can be removed first to reduce subsequent calculations. Compared with other categories, the pixel values ​​of the background category are similar and the extreme difference value is the smallest. Therefore, the category image corresponding to the extreme difference value in {c} is removed.

[0069] S302, performing connected domain detection on each category image corresponding to any number of clusters to obtain multiple connected domains;

[0070] Perform convex hull detection on each connected domain to obtain the convex hull edge corresponding to each connected domain;

[0071] In this embodiment, the closed connected domains in each category image are identified using the bwboundaries function in Matlab to obtain multiple connected domains in each category image; the connected domains in the category image are denoted as ,in, Represents the nth connected component corresponding to the i-th category image.

[0072] Then perform convex hull detection on each connected domain to obtain the convex hull edge corresponding to each connected domain; the convex hull corresponding to the connected domain is recorded as ,in, Represents the convex hull corresponding to the nth connected domain corresponding to the i-th category image.

[0073] It should be noted that the convex hull is a convex polygon formed by the outermost connection of a set of points on a given two-dimensional plane. It can contain all points in the set and can be used to represent the contour information of an object. Since the noise is mostly clustered, and the trachea is mostly tree-like with tree-like branches on the trunk, after the convex hull detection, the edge of the noise and the edge of the convex hull have fewer differences in position and smaller degree; while the trachea area has more differences in position and larger degree. Figure 8 and Fig. 9 As shown, Figure 8 is the convex hull edge contour of the tracheal connection domain in the lung area, Figure 8 It can be seen that there are many differences between the edge of the tracheal connection domain and the convex hull. Fig. 9 It is the convex hull edge contour map of the connected domain of noise points in the lung area; Fig. 9 It can be seen that there are fewer differences between the edge of the noise and the edge of the convex hull. Therefore, the difference between the edge of the connected domain and the convex hull is measured according to the number of pixels between two adjacent points on the edge of the convex hull that overlap with the edge of the connected domain, as follows:

[0074] S303, obtaining all the coincident points on the edge of the convex hull corresponding to each connected domain; obtaining the degree of difference between any two adjacent coincident points in each connected domain according to the number of pixels between any two adjacent coincident points in each connected domain;

[0075] The difference between any two adjacent coincident points in each connected domain is obtained by following the steps below:

[0076] According to the number of pixels between any two adjacent coincident points in each connected domain, the maximum number of pixels between two adjacent coincident points and the minimum number of pixels between two adjacent coincident points are obtained;

[0077] According to the number of pixels between any two adjacent coincident points, the maximum number of pixels between any two adjacent coincident points, and the minimum number of pixels between any two adjacent coincident points, the degree of difference between any two adjacent coincident points in each connected domain is obtained.

[0078] In this embodiment, the difference between any two adjacent coincident points in each connected domain is obtained by following the steps below:

[0079] Select any point among all the points where the edge of the convex hull coincides with the edge of the connected domain as the starting point; from the starting point, extract the position of each pixel point on the connected domain and store it in sequence A; from the starting point, extract the positions of all pixel points on the edge of the convex hull and store them in sequence C;

[0080] At this point, the pixel position sequence A on the edge of the connected domain and the position sequence C of all the pixel points on the edge of the convex hull that coincide with the edge of the connected domain are obtained;

[0081] The pixel position sequence A is {( , ),( , )……( , )};( , ) represents the position coordinates of the pixel points on the edge of the connected domain; e represents the number of pixel points on the edge of the connected domain;

[0082] The pixel position sequence C is {( , ),( , )……( , )};( , ) represents the position coordinates of the pixel points on the edge of the convex hull that overlap with the edge of the connected domain; f represents the number of pixel points on the edge of the convex hull that overlap with the edge of the connected domain;

[0083] The sequence number of each pixel position coordinate in the statistical sequence C and the same pixel position coordinate in the sequence A is recorded as sequence D, and sequence D is { , , ,……, },in, Indicates the sequence number of the position coordinates of the fth pixel point in sequence C that coincides with the edge of the connected domain in sequence A;

[0084] The difference interval extracted in the connected domain is [ : ],[ , ]……[ , ];[ , ] represents the interval between two adjacent coincident points;

[0085] The number of pixels in each difference interval is recorded as { }, where f represents the number of pixels on the edge of the convex hull that overlap with the edge of the connected domain;

[0086] Then the calculation formula for each difference interval, that is, the difference between any two adjacent coincident points in the connected domain, is as follows:

[0087]

[0088] In the formula, Indicates the degree of difference between any two adjacent coincident points in the connected domain; Indicates the maximum number of pixels on the edge of the connected domain in the difference interval; Represents the minimum value of the number of pixels on the edge of the connected domain in the difference interval; } represents the number of pixels on the edge of the connected domain in any difference interval; L is set to 0.1 and can be adjusted at any time according to the situation; L is set to avoid the same number of pixels in all difference intervals, that is, to avoid situation, because when the connected domain is tree-like, that is, similar to the trachea, The value is much larger than L, and the setting of L has no effect on the judgment of the degree of difference.

[0089] Similarly, the difference between any two adjacent coincident points in each connected domain in each category image is obtained.

[0090] Since the trachea in the lungs has a special shape, tending to be tree-like, and the noise points have different shapes, the trachea approximation can be obtained based on the shape characteristics of the connected domain in the image segmented under different numbers of clusters; the specific method for obtaining the trachea approximation is as follows:

[0091] S304, obtaining the tracheal similarity of each connected domain according to the maximum value of the difference between all two adjacent coincident points in each connected domain, the area of ​​each connected domain and the area of ​​the convex hull corresponding to each connected domain; and sequentially obtaining the tracheal similarity of each connected domain corresponding to each category image;

[0092] The tracheal similarity calculation formula for each connected domain is as follows:

[0093]

[0094] In the formula, represents the tracheal similarity of each connected domain; The maximum value of the difference between all two adjacent coincident points in each connected domain; Represents a connected domain area; Connected domain The corresponding convex hull area; is 0.7, is 0.3.

[0095] Represents the nth connected domain corresponding to the i-th category image;

[0096] Represents the convex hull corresponding to the nth connected domain corresponding to the i-th category image.

[0097] The ratio of the area difference between the convex hull image area obtained by the connected domain and the area of ​​the connected domain to the convex hull area can reflect the shape characteristics of the connected domain; when the shape of the connected domain is similar to a tree, the area difference is large, the area difference accounts for a large ratio of the convex hull area, and the P value approaches 1; when the shape of the connected domain is similar to a circle, the area difference is small, the area difference accounts for a small ratio of the convex hull area, and the P value approaches 0. Since the degree of difference has a greater impact on the degree of tracheal segmentation, its weight accounts for a high proportion. In addition, since the degree of difference can reflect the shape information of the connected domain, whether the connected domain is a trachea, whether the shape is a tree branch, and the difference area can only indicate that the connected domain is not a circle, the area is a criterion for assisting the degree of difference in judging the degree of tracheal segmentation. For this reason, according to experience, is 0.7, is 0.3.

[0098] In this embodiment, the trachea similarity threshold is preset to 0.6 and can be adjusted according to the situation. When the obtained trachea similarity P is greater than the threshold, it is determined that the corresponding connected domain may be the trachea area; when the obtained trachea similarity P is less than the threshold, the connected domain is determined to be a noise area.

[0099] S305, obtaining the trachea segmentation degree of each category image according to the trachea similarity of each category image corresponding to each connected domain;

[0100] In this embodiment, in each category graph, all connected domains in the graph are traversed, and when the obtained trachea similarity P is greater than the trachea similarity threshold, the connected domain is marked as a possible trachea region, and when the obtained trachea similarity P is less than the trachea similarity threshold, the connected domain is marked as a noise region. The processing results of all connected domains in each category image are obtained.

[0101] For the segmented images obtained with different cluster number K values, if the number of possible tracheal regions in a certain category of images is greater, it means that the tracheal segmentation is better, and thus the lung segmentation is better under this K value. The tracheal segmentation degree of each category of images is obtained according to the following steps:

[0102] According to the trachea similarity of each category image corresponding to each connected domain, the connected domain corresponding to which the similarity is greater than or equal to a preset threshold is obtained;

[0103] According to the connected domains corresponding to each trachea similarity greater than or equal to the preset threshold, and the number of connected domains corresponding to all trachea similarities greater than or equal to the preset threshold in the category image corresponding to the connected domain, the trachea segmentation degree of each category image is obtained. It should be noted that the preset threshold refers to the trachea similarity threshold of 0.6, and the setting of the threshold can be obtained based on manual experience.

[0104] The calculation formula for the trachea segmentation degree of each category image is as follows:

[0105]

[0106] Where A represents the degree of tracheal segmentation of each category image; P represents the tracheal similarity of the connected domain corresponding to the preset threshold in each category image; Represents the number of connected domains corresponding to the trachea similarity P in each category image.

[0107] For example: In a category image, P=0.6 corresponds to =20, P=0.7 corresponds to =15; then =0.6×20+0.7×15.

[0108] Indicates that the sum of the values ​​obtained by multiplying the number of connected domains in each category image whose tracheal similarity is greater than or equal to the preset threshold by the tracheal similarity that satisfies the condition is performed. When the tracheal segmentation degree in the figure reaches the optimal level, the more possible tracheal regions there are in a certain category of image, The larger the value, the smaller the number of trachea regions in the category image. The smaller the value.

[0109] Similarly, the trachea segmentation degree of each category image corresponding to each cluster number is obtained;

[0110] S306, obtaining the number of clusters corresponding to the maximum trachea segmentation degree as the optimal number of clusters for segmenting the lung region;

[0111] In this embodiment, the maximum tracheal segmentation degree is recorded as MaxA, and all cluster numbers are traversed. The number of clusters corresponding to the maximum tracheal segmentation degree is recorded as the optimal number of clusters, which is recorded as M.

[0112] S4. Obtaining the optimal segmentation image of the lung CT image; the details are as follows:

[0113] The lung region is segmented using the optimal number of clusters to obtain a lung segmentation map;

[0114] The lung segmentation map is combined with the bone region to obtain the optimal segmentation image of the lung CT image.

[0115] It should be noted that if the entire lung CT image is clustered and segmented according to the optimal number of clusters, unnecessary segmentation areas will be generated in the bone area. These areas will affect the observation effect of the lung trachea area and thus affect the judgment of internal lung diseases. The judgment of lung diseases only requires observation of the internal lung area.

[0116] In this embodiment, when K=M, the lung region is clustered and segmented, and the obtained segmentation map is combined with the bone region obtained in step S2 when K=2 to obtain the optimal segmentation image, see Fig.10 As shown in FIG. 1 , the optimal segmented image corresponding to the lung CT image. Therefore, the doctor can make an accurate judgment on the lesion based on the optimal segmented image.

[0117] The present invention provides a lung medical image optimization segmentation method, which is based on the K-means clustering algorithm. After the bone region in the lung CT image is segmented out a priori, it is convenient to segment the lung region later; then, the trachea segmentation degree under different cluster numbers is obtained according to the shape information of the trachea in the lung region, and the optimal number of segmentation clusters is obtained according to the trachea segmentation degree, and the optimal lung region segmentation image is obtained according to the optimal number of segmentation clusters, so as to avoid segmenting the lung CT image by setting the same number of clusters, and the bone region will produce unnecessary segmentation areas, which will affect the observation effect of the lung trachea region and thus affect the judgment of internal lung diseases; finally, the optimal segmentation image of the lung region is combined with the bone region to obtain the optimal segmentation image, which can make the lung region have a better trachea segmentation effect, and eliminate the interference of the bone region and background useless information on the lung region. Doctors can make accurate judgments on lesions based on the optimal segmentation image.

[0118] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A lung medical image optimization segmentation method, characterized in that: The following steps are involved: Obtain lung CT images; Set the number of clusters to 2, and segment the CT image into bone and lung regions using the clustering algorithm; The lung region is segmented by setting different numbers of clusters to obtain multiple category images corresponding to each number of clusters; Perform connected domain detection on each category image corresponding to any number of clusters to obtain multiple connected domains; Perform convex hull detection on each connected domain to obtain the convex hull edge corresponding to each connected domain; Obtain all the coincident points on the edge of the convex hull corresponding to each connected domain; obtain the maximum number of pixels between any two adjacent coincident points in each connected domain; and the minimum number of pixels between any two adjacent coincident points; According to the number of pixels between any two adjacent coincident points, the maximum number of pixels between any two adjacent coincident points, and the minimum number of pixels between any two adjacent coincident points, the degree of difference between any two adjacent coincident points in each connected domain is obtained; In the formula, represents the tracheal similarity of each connected domain; The maximum value of the difference between all two adjacent coincident points in each connected domain; Represents a connected domain area; Connected domain The corresponding convex hull area; is 0.7, is 0.3; among them, Represents the nth connected domain corresponding to the i-th category image; Represents the convex hull corresponding to the nth connected domain corresponding to the i-th category image; The tracheal similarity of each connected domain is obtained according to the maximum value of the difference between all two adjacent coincident points in each connected domain, the area of ​​each connected domain and the area of ​​the convex hull corresponding to each connected domain; the tracheal similarity of each category image corresponding to each connected domain is obtained in turn; According to the trachea similarity of each category image corresponding to each connected domain, the connected domain corresponding to which the similarity is greater than or equal to a preset threshold is obtained; According to the connected domains corresponding to each trachea similarity greater than or equal to the preset threshold, and the number of connected domains corresponding to all trachea similarities greater than or equal to the preset threshold in the category image corresponding to the connected domain, the trachea segmentation degree of each category image is obtained; Similarly, the trachea segmentation degree of each category image corresponding to each cluster number is obtained; The number of clusters corresponding to the maximum trachea segmentation degree is obtained as the optimal number of clusters for segmenting the lung area; The lung region is segmented using the optimal number of clusters to obtain a lung segmentation map; The lung segmentation map is combined with the bone region to obtain the optimal segmentation image of the lung CT image.

2. The lung medical image optimization segmentation method according to claim 1, characterized in that: Each category image is obtained by following the steps below: The lung area is segmented by setting different numbers of clusters to obtain a set of multiple category pixels corresponding to each number of clusters; the pixel values ​​of the pixels in each category are set to 1, and the pixel values ​​of other pixels are set to 0 to obtain a binary mask corresponding to each category; Each category image is obtained by multiplying the binary mask corresponding to each category with the CT image; Multiple category images corresponding to each cluster number are obtained in turn.