CN106611416B - Method and device for segmenting lung in medical image - Google Patents

Method and device for segmenting lung in medical image Download PDF

Info

Publication number
CN106611416B
CN106611416B CN201510679631.5A CN201510679631A CN106611416B CN 106611416 B CN106611416 B CN 106611416B CN 201510679631 A CN201510679631 A CN 201510679631A CN 106611416 B CN106611416 B CN 106611416B
Authority
CN
China
Prior art keywords
lung
shape
image
average
template
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510679631.5A
Other languages
Chinese (zh)
Other versions
CN106611416A (en
Inventor
丛琳
郭薇
李强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai United Imaging Healthcare Co Ltd
Original Assignee
Shanghai United Imaging Healthcare Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai United Imaging Healthcare Co Ltd filed Critical Shanghai United Imaging Healthcare Co Ltd
Priority to CN201510679631.5A priority Critical patent/CN106611416B/en
Priority to US15/297,301 priority patent/US10043280B2/en
Publication of CN106611416A publication Critical patent/CN106611416A/en
Application granted granted Critical
Publication of CN106611416B publication Critical patent/CN106611416B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30004Biomedical image processing
    • G06T2207/30061Lung

Abstract

The invention discloses a method and a device for segmenting a lung in a medical image, wherein the method comprises the following steps: obtaining an average lung template according to the lung contour of M chest pictures in a training set, wherein M is an integer greater than or equal to 2; preprocessing the lung image to be segmented to obtain a preprocessed lung image; extracting a binary image of a lung boundary of the preprocessed lung image, and performing initial positioning according to generalized Hough transform to obtain a corresponding Hough positioning position; aligning the average lung template with the Hough positioning position to obtain an alignment result; and (4) carrying out segmentation by using a dynamic programming algorithm, and inversely transforming the segmentation result back to the original coordinate system to complete the segmentation of the lung region. According to the method, the lung area to be segmented is positioned through Hough transform, the initial contour of the lung is obtained through aligning the average lung area shape with the positioning position, and the deviation between the initial position and the actual position of the lung is reduced to the greatest extent, so that the segmentation accuracy is improved.

Description

Method and device for segmenting lung in medical image
[ technical field ] A method for producing a semiconductor device
The invention relates to the field of medical image segmentation, in particular to a method and a device for segmenting a lung in a medical image.
[ background of the invention ]
Lung segmentation is an important link in digital chest image processing. The quality of the segmentation result directly influences the subsequent detection and analysis of the focus. The biggest drawback of chest radiographs is tissue overlap. The higher the density of the tissue in the human body structure, the stronger the ability to absorb X-rays, so that the ribs of the chest absorb more X-rays and present white shadows in the image; since the lungs contain gas, the density is low and the X-rays are less absorbed, thus the image appears dark. As such, when the lung boundary is segmented, a jagged segmentation result is likely to occur. Moreover, it can be found by observing the image that there are corner points at the lower boundary of the lung, which is also a difficult point for segmentation.
Commonly used lung segmentation methods can be broadly divided into two categories: one is lung segmentation based on rule level, and mainly comprises a threshold segmentation method, a region growing method, an edge detection method, a morphological filtering method and the like. Due to the imaging effect of the X-ray image, such methods cannot finely segment the lung region; the other type is a lung segmentation method based on pixel classification, and mainly comprises learning methods such as genetic algorithm, neural network and fuzzy clustering, and the like, so as to classify pixels in the image.
Another method is a segmentation method based on comprehensive knowledge: active shape model method (ASM). The method firstly needs to manually calibrate the outline of the lung as a reference standard, obtains statistical information of the distribution of the characteristic points by training an image sample, and obtains the allowable change direction of the characteristic points, thereby realizing the search of the positions of the corresponding characteristic points on a target image. However, this method searches for a boundary on two-dimensional information, and is easily affected by the rib boundary, resulting in a jagged segmentation result.
[ summary of the invention ]
The technical problem to be solved by the present invention is to provide a method and apparatus for lung segmentation that can solve or reduce the aforementioned problems.
The technical scheme adopted by the invention for solving the technical problems is as follows: a method of lung segmentation in medical images, characterized by the steps of:
obtaining an average lung template according to the lung contour of M chest pictures in a training set, wherein M is an integer greater than or equal to 2;
preprocessing the lung image to be segmented to obtain a preprocessed lung image;
extracting a binary image of a lung boundary of the preprocessed lung image, and performing initial positioning according to generalized Hough transform to obtain a corresponding Hough positioning position;
aligning the average lung template with the Hough positioning position to obtain an alignment result;
and (4) carrying out segmentation by using a dynamic programming algorithm, and inversely transforming the segmentation result back to the original coordinate system to complete the segmentation of the lung region.
Furthermore, the same number of feature points are marked on the lung contour of each corresponding chest film in the M chest films, and the distribution of the feature points on different chest films is consistent.
Further, marking characteristic points at the inflection point, the highest point and the lowest point of the lung outline of each chest piece.
Further, the positions except the inflection point, the highest point and the lowest point on the lung outline of each chest film are marked with feature points at equal distances.
Further, the mean lung template is obtained according to the following steps:
a. selecting from M chest slices in training set for the first time to obtain the shape L of the first lung area0
b. Performing second selection from the chest slices in the training set which are not selected yet to obtain the shape L of the N lung regions1、L2…LN
c. Making the N lung areas shaped as L1、L2…LNAfter treatment, the corresponding shape L of the N lung areas is obtained11、L21…LN1Respectively associated with the first lung region shape L0Aligning and calculating to obtain the average shape L of the lung areaaveThe processing comprises shaping the N lung regions into a shape L1、L2…LNRespectively corresponding to the first lung region shape L0Performing rotation, scaling and translation transformation;
d. if the average shape L of the lung area in step caveCompared with the first lung region shape L0Is less than a set threshold, the average shape L of the lung area is determinedaveAs a mean lung template; otherwise, entering step e;
e. shaping the first lung region0Processing the N lung region shapes L11、L21…LN1After being processed, the average shape L of the lung area is respectively compared with the average shape L of the current lung areaave-iAligning and calculating to obtain the average shape L of the current lung areaave1-iWherein said processing the first lung field shape comprises: shape L of the first lung region0Respectively relative to the current lung region average shape Lave-iPerforming rotation, scaling and translation transformation to obtain the corresponding lung region shape L0iAnd shaping said N lung fields into a shape L11、L21…LN1Respectively relative to the current lung region average shape Lave-iPerforming rotation, scaling and translation transformation to obtain the shape L of the N lung regions1i、L2i…LNi;
f. If e, the average shape L of the lung area is calculatedave1-iAverage shape L of current lung areaave-iIf the rotation, the zooming and the translation of the step (e) are less than the set threshold value, the average shape L of the current lung area calculated in the step (e) is obtainedave1-iAs a mean lung template; otherwise, the average shape L of the current lung area is determinedave-iUsing the average shape L of the lung regionave1-iInstead, the shape L of the first lung region is adjusted0By the shape L of the lung region0iAlternatively, N second lung field shapes L11、L21…LN1By N lung field shapes L1i、L2i…LNiAlternatively, and i ═ i +1, where i is an integer greater than or equal to 2, "═ is an assigned number, and step e is returned.
Further, the lung image preprocessing comprises the following modes: the method comprises the steps of obtaining an original image, carrying out Gaussian filtering on the original image to obtain a filtered image, carrying out difference on the original image and the filtered image, then applying a gray average value of the filtered image to obtain a background-removed image, and then carrying out bilateral filtering operation on the background-removed image to obtain a preprocessed image.
Further, based on the preprocessed image, establishing a plurality of edge shape templates corresponding to the edge outline of the image; and acquiring the coordinates of the gravity center point of each edge shape template and the coordinate position of the point on the edge shape relative to the gravity center point, and initially positioning the binary image of the edge shape by applying a Hough transform method.
Further, a boundary enhancement operator is applied to extract a gradient image of the edge shape, and then 15% of the maximum pixel points are reserved to generate a binary image of the edge shape.
Further, each non-zero point on the boundary binary image is used for matching any point in the template, and 1 is added at the position of the corresponding gravity center point in the Hough space; after finishing Hough transformation of all points equal to 1 in the binary image, calculating the accumulated sum of each point in Hough space, and finding out the position of the maximum value, wherein the point is the position of the gravity center of the most accurate template positioned by using the current template; and normalizing the maximum value of the gravity center point of each template, and then determining the position of the template corresponding to the maximum value as the positioning position.
The technical scheme adopted by the invention for solving the technical problems is as follows: an apparatus for lung segmentation in medical images, comprising:
the storage unit is used for storing a plurality of chest film images of the training set and chest film images to be segmented;
a display unit for displaying the corresponding chest image;
the input unit is used for marking the characteristic points of the lung in the chest radiograph to obtain a corresponding lung outline image;
an image processing unit for:
processing the lung contour image to obtain an average lung template;
preprocessing a chest image to be segmented to obtain a preprocessed lung image;
extracting a binary image of a lung boundary of the preprocessed lung image, and performing initial positioning according to generalized Hough transform to obtain a corresponding Hough positioning position;
aligning the average lung template with the Hough positioning position to obtain an alignment result;
and (4) carrying out segmentation by using a dynamic programming algorithm, and inversely transforming the segmentation result back to the original coordinate system to complete the segmentation of the lung region.
Compared with the prior art, the invention has the following beneficial effects: according to the method, the lung area to be segmented is positioned through Hough transform, the initial contour of the lung is obtained through the alignment of the average lung area shape and the positioning position, and the deviation between the initial position and the actual position of the lung is reduced to the greatest extent, so that the segmentation accuracy is improved; in addition, the invention is an automatic lung segmentation method with high working efficiency.
[ description of the drawings ]
FIG. 1 is a schematic diagram of a lung segmentation method according to an embodiment of the present invention;
FIG. 2 is a detailed flow chart of the fully automated lung segmentation according to the embodiment of the present invention;
FIG. 3(a) is a flowchart of a method for obtaining an average lung template according to an embodiment of the present invention;
FIG. 3(b) is a flowchart of another method for obtaining an average lung template according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a Hough template for the upper lung margin according to an embodiment of the present invention;
FIG. 5 is a schematic view of Hough location in an embodiment of the present invention;
FIG. 6 is a diagram illustrating lung alignment results in accordance with an embodiment of the present invention;
FIG. 7 is a diagram illustrating segmentation results of lung segments according to an embodiment of the present invention;
fig. 8 is a diagram illustrating a segmentation result of a right lung according to an embodiment of the present invention.
[ detailed description ] embodiments
The invention is further described below with reference to the figures and examples.
Referring to fig. 1-3, a method for segmenting a lung in a medical image (e.g., a DR image or an X-ray image) according to an embodiment of the present invention includes the following steps:
obtaining an average lung template according to the lung contour of M chest pictures in a training set, wherein M is an integer greater than or equal to 2;
acquiring a lung image to be segmented;
preprocessing the lung image to be segmented to obtain a preprocessed lung image;
extracting a binary image of a lung boundary of the preprocessed lung image, and performing initial positioning according to generalized Hough transform to obtain a corresponding Hough positioning position;
aligning the average lung template with the Hough location position to obtain a Hough location result;
and (4) carrying out segmentation by using a dynamic programming algorithm, and inversely transforming the segmentation result back to the original coordinate system to complete the segmentation of the lung region.
The lung segmentation in the embodiment is a fully automatic lung segmentation performed by a medical processing device. The training set comprises a plurality of chest films, and the chest films are stored in a storage unit of the medical processing device; the training set contains 100 chest images, each chest image corresponding to a pair of lung contour images. In other embodiments, the number M of chest pieces in the training set may be 80, 120, 150, etc. Through multiple experiments of the inventor, the actual requirements can be better met by 100 chest films; of course, the larger the number of chest slices, the better the resulting average lung template, but the longer the time required in image segmentation.
M chest pictures are selected, the same number of characteristic points are marked on one lung (edge) of each chest picture corresponding to the M chest pictures, and the distribution of the characteristic points on different chest pictures is consistent. In an embodiment, 42 feature points are marked on each chest piece, wherein the feature points need to be marked at the inflection point, the highest point and the lowest point of the lung contour of each chest piece. Feature points are marked equidistantly on the lung contour of each chest piece, except at the inflection point, the highest point and the lowest point. Of course, the number of feature points may be 36, 50, or the like. After labeling, the contours (shapes) of the M lungs are obtained. However, the manual calibration will have some errors, and the models will appear in different positions and have different rotation angles. To eliminate these "non-shape" factors, we need to align the training set by taking the average lung template.
In a specific embodiment, the average lung template is obtained by using a cyclic calculation (comparison), and the following are two corresponding optional steps:
the first way to obtain the mean lung template (step):
a. selecting from M chest slices in training set for the first time to obtain the shape L of the first lung area0
b. Performing second selection from the not-selected chest slices in the training set to obtain N (second) lung region shapes L1、L2…LN
c. Making the N lung areas shaped as L1、L2…LNAfter treatment, the corresponding shape L of the N lung areas is obtained11、L21…LN1Respectively associated with the first lung region shape L0Aligning and calculating to obtain the average shape L of the lung areaaveThe processing comprises shaping the N lung regions into a shape L1、L2…LNRespectively corresponding to the first lung region shape L0Performing rotation, scaling and translation transformation;
d. if the average shape L of the lung area in step caveCompared with the first lung region shape L0Is less than a set threshold, the average shape L of the lung area is determinedaveAs a mean lung template; otherwise, entering step e;
e. shaping the first lung region0To carry outProcessing the N lung region shapes L11、L21…LN1After being processed, the average shape L of the lung area is respectively compared with the average shape L of the current lung areaave-iAligning and calculating to obtain the average shape L of the current lung areaave1-iWherein said processing the first lung field shape comprises: shape L of the first lung region0Respectively relative to the current lung region average shape Lave-iPerforming rotation, scaling and translation transformation to obtain the corresponding lung region shape L0iAnd shaping said N lung fields into a shape L11、L21…LN1Respectively relative to the current lung region average shape Lave-iPerforming rotation, scaling and translation transformation to obtain the shape L of the N lung regions1i、L2i…LNi
f. If e, the average shape L of the lung area is calculatedave1-iAverage shape L of current lung areaave-iIf the rotation, the zooming and the translation of the step (e) are less than the set threshold value, the average shape L of the current lung area calculated in the step (e) is obtainedave1-iAs a mean lung template; otherwise, the average shape L of the current lung area is determinedave-iUsing the average shape L of the lung regionave1-iInstead, the shape L of the first lung region is adjusted0By the shape L of the lung region0iAlternatively, N second lung field shapes L11、L21…LN1By N lung field shapes L1i、L2i…LNiAlternatively, and i-i +1, where i is an integer greater than or equal to 2, "═ is the assigned number, and return to step e.
Further, if the average shape L of the current lung area is calculated in the step eave1-iAverage shape L of current lung areaave-iIs larger than a set threshold value, but when i is larger than or equal to 90, the iterative calculation is stopped, and the average shape L of the current lung area is adoptedave1-iAs the mean lung template.
N is a natural number less than or equal to M-1, and i is a natural number greater than or equal to 1.
The threshold is the value of the geometric transformation that is made by the shape of one lung region relative to the shape of the other lung region when the two lung region shapes (images) are aligned: the translation distance is less than or equal to 0.01 pixels, and the rotation angle is less than or equal to 0.001 × pi/180, and the scaling dimension is less than or equal to 0.001.
Second way of obtaining the mean lung template (step):
a. selecting M chest slices in a training set for the first time, and selecting one chest slice to obtain a first lung area shape;
b. selecting at least one chest film for the second time from the unselected chest films in the training set to obtain the corresponding (second) lung area shape;
c. aligning the shapes of the lung areas obtained by the second selection with the shapes of the first lung areas respectively through rotation, scaling and translation, and calculating to obtain the average shape of the current lung area;
d. if the rotation, the scaling and the translation of the current lung area average shape in the step c compared with the first lung area shape are smaller than a set threshold, taking the current lung area average shape as an average lung template; otherwise, entering step e;
e. selecting at least one chest slice from unselected chest slices in the training set for the Nth time, obtaining corresponding lung area shapes, aligning the lung area shapes obtained by the Nth time selection with the average shape of the current lung area through rotation, scaling and translation, and calculating the average shape of all the selected lung area shapes until the Nth time, wherein N is an integer greater than or equal to 3;
f. if the rotation, the scaling and the translation of the average shape of all the selected lung area shapes compared with the current lung area average shape are smaller than the set threshold value by the Nth time, taking the average shape of all the selected lung area shapes at the Nth time as an average lung template; otherwise, taking the average shape of all the lung area shapes selected at the Nth time as the average shape of the current lung area, wherein, N is N +1, and the value is 'N'; and returns to step e.
Further, if all the chest slices in the training set are selected completely, the lung area shape obtained by the shape of the lung area obtained by the chest slice selected last time and the average shape of the current lung area are calculated to be used as an average lung template.
The threshold is the value of the geometric transformation that is made by the shape of one lung region relative to the shape of the other lung region when the two lung region shapes (images) are aligned: the translation distance is less than or equal to 0.01 pixels, and the rotation angle is less than or equal to 0.001 × pi/180, and the scaling dimension is less than or equal to 0.001.
After the average lung template is calculated by the method, the average lung template is stored in a storage unit for subsequent use.
The lung image preprocessing comprises the following steps: obtaining an original image of a lung of a shot part, performing Gaussian filtering on the original image to obtain a filtered image, performing difference on the original image and the filtered image, applying a gray average value of the filtered image to obtain a background-removed image, and performing bilateral filtering operation on the background-removed image to obtain a preprocessed lung image.
And (3) respectively extracting binary images of the upper, lower and outer boundaries of the preprocessed lung image, and performing initial positioning by adopting generalized Hough transform. The upper, lower, and outer (left, right) lateral boundaries collectively make up a lung edge shape (lung contour). Based on the edge shape, several edge shape templates can be created that are more similar to the edge shape templates. In particular embodiments, 3 to 8 edge shape templates may be created, with a preferred number of 5 edge shape templates. Specifically, one edge shape may be divided into several parts, such as an upper boundary, a lower boundary, and an outer boundary, and the several parts may be processed separately.
The above boundary positioning is an example: first, 5 top edge shape (top border) templates are marked (see fig. 4), and the coordinates of the center of gravity point of each template and the coordinate position of each point on the template relative to the center of gravity point are recorded. And applying Hough transform algorithm to initially position the upper boundary binary image. The Hough transform algorithm is to perform coordinate transformation in a certain form on an image, so that all points on a given shape curve on the image are concentrated on certain positions of Hough space after transformation to form peak points, and thus, the problem of detecting the given shape curve in an original image is converted into the problem of searching the peak points in Hough space.
Taking any template as an example, a boundary enhancement operator is applied to extract a gradient image of the upper boundary, and then 15% of the largest pixel points are reserved to generate a binary image of the upper boundary. And matching any point in the template by using each non-zero point on the binary image of the upper boundary, and adding 1 at the position of the corresponding gravity center point in the Hough space. The position of the center of gravity of the template that is likely to match the exact template is recorded in the hough space, so the larger the value accumulated in the hough space, the more likely it is that this point is the center of gravity point of the shape in the image. Finding the maximum point in space, we determine that this point is the center of gravity point of the shape. And after finishing Hough transformation of all points equal to 1 in the binary image, calculating the accumulated sum of each point in Hough space, and finding out the position of the maximum value, wherein the point is the position of the gravity center of the most accurate template positioned by using the current template. After the position of the center of gravity is determined, the corresponding position of the template is determined, which is the found upper edge position.
The 5 templates are used for carrying out Hough transformation on the two-valued image of the upper boundary of the lung region respectively, 5 maximum values can be obtained in 5 Hough spaces, and due to the fact that the sizes of the templates are different, the maximum values need to be normalized. Then, the maximum value is found from the 5 maximum values, and the template corresponding to the maximum value is determined, so that the template is determined as the best template.
Then, the outer side and the lower boundary are positioned by the same operation as the upper boundary, and the positioning result is shown in fig. 5; the hough location corresponding to the lung image can be obtained.
The average lung template is aligned with the hough location to obtain an alignment result (aligned image, see fig. 6). As shown in fig. 7, three parts of the aligned result (total of 42 points) are: marking points on the outer side, the lower side and the inner side respectively, marking points 1-16 (outer side), 17-24 (lower side) and 25-42 (inner side), using a Hough positioning result for the upper side (or directly using the Hough positioning result for the outer side and the lower side), respectively performing linear interpolation on the four parts, extracting m point pixel values in the normal direction of each point to form a normal matrix, dynamically planning and dividing on the normal matrix, and inversely transforming the obtained dividing result back to the original coordinate system to finish the division of the lung region. Finally, the four segments are connected and the edges are smoothed, so that the lung segmentation is completed (as shown in fig. 8).
The process of dynamic planning segmentation in this patent application:
the path selection in the dynamic programming algorithm depends on the current state and also on the previously selected state, which is usually used to search for optimal boundaries of the target.
The pixels in the normal direction of each point are taken from the corresponding Hough template, a new matrix called a normal matrix (similar to a matrix obtained after polar coordinate transformation) is formed, the position coordinates of each point in the original coordinate system are stored while the normal matrix is generated, and inverse transformation is conveniently carried out.
And according to the position obtained by alignment, performing second-order curve fitting on the corresponding boundary, so that the normal of each point on the curve can be calculated easily.
In the normal direction of each point, taking the hough template as a reference, taking m1 pixels upwards and m2 pixels downwards, collecting the pixel values of each point to form an m × n normal matrix, wherein n is the length of the hough template, and m is m1+ m 2. This normal matrix is dynamically planned and segmented. The method specifically comprises the following main steps:
(1) obtaining local costs
In the dynamic programming algorithm, the local cost is composed of an internal cost and an external cost. The internal cost is used to measure the smoothness of the boundary points, and the smoother the boundary, the smaller the internal cost. The external cost is used for measuring the gradient change of the image, and the larger the gradient is, the smaller the external cost is.
Assuming that the size of the "normal matrix" is m × n, we define the internal cost as:
Eint(i,j)=|j-k|/(j+k),j=1...n,k=1...n,i=1...m (1)
wherein j and k are the vertical coordinates of the boundary points on the ith column and the i-1 column in the normal matrix respectively, and the internal cost is normalized. The magnitude of the internal cost indicates how smooth the boundary is.
The external cost is represented using the inverse of the gradient image of the normal matrix:
Eext(i,j)=-G(i,j) (2)
the total local cost is represented by a weighted sum of the internal cost and the external cost:
E(i,j)=ωint×Eint(i,j)+ωext×Eext(i,j) (3)
wherein ω isintAnd ωextRepresenting the weights of the internal cost and the external cost, respectively.
(2) Calculating cumulative cost
Calculating the accumulated cost is a dynamic accumulation process, and the accumulated cost of each column is the accumulated sum of the accumulated cost of the previous column and the local cost of the current column.
Figure BDA0000824841700000121
Since there is no internal cost in the first column, there is only an external cost and no internal cost in the first column of accumulated costs. Each column is then an iterative computational accumulated cost. The accumulated cost of each column is the minimum value of the accumulated cost of the previous column in a certain range and the local cost sum of the current point. K represents the search range of the (i-1) th column, so that the boundary point selected by every two adjacent columns does not have too large jitter. And the value of k when the current point takes the minimum value is recorded while the accumulated cost of each point is calculated, so that the optimal path needs to be found conveniently.
(3) Searching back to back for optimal path
After all the accumulated costs are calculated, the minimum value in the last column of the accumulated costs is found as an initial point, and the optimal path is found by searching forwards according to the recorded k value. And then the original coordinate system is transformed back to obtain a segmentation result.
The invention also provides a device for segmenting the lung in the medical image, which is characterized by comprising the following components:
the storage unit is used for storing a plurality of chest film images of the training set and chest film images to be segmented;
a display unit for displaying the corresponding chest image;
the input unit is used for marking the characteristic points of the lung in the chest radiograph to obtain a corresponding lung outline image;
an image processing unit for:
processing the lung contour image to obtain an average lung template;
preprocessing a chest image to be segmented to obtain a preprocessed lung image;
extracting a binary image of a lung boundary of the preprocessed lung image, and performing initial positioning according to generalized Hough transform to obtain a corresponding Hough positioning position;
aligning the average lung template with the Hough positioning position to obtain an alignment result;
and (4) carrying out segmentation by using a dynamic programming algorithm, and inversely transforming the segmentation result back to the original coordinate system to complete the segmentation of the lung region.
With the method and/or apparatus set forth above, 23 data provided by the DR device, 247 data of the JSRT database, respectively, were used for testing. The test result shows that the Hough transform can accurately position the upper, lower and outer boundaries of the lung region, the image quality is good, and the segmentation result is ideal.
The JSRT database has poor image quality, has some deviation when positioning the boundary and segmenting, but has little influence and acceptable results.
All segmentation results were classified into 4 classes: "good", "acceptable", "bad". For a total of 270 cases of data, approximately 95% of the images were well segmented or very well segmented.
Although the present invention has been described with respect to the preferred embodiments, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (9)

1. A method of lung segmentation in medical images, characterized by the steps of:
obtaining an average lung template according to the lung contour of M chest pictures in a training set, wherein M is an integer greater than or equal to 2;
preprocessing the lung image to be segmented to obtain a preprocessed lung image;
extracting a binary image of a lung boundary of the preprocessed lung image, and performing initial positioning according to generalized Hough transform to obtain a corresponding Hough positioning position;
aligning the average lung template with the Hough positioning position to obtain an alignment result;
the mean lung template is obtained according to the following steps:
a. selecting from M chest slices in training set for the first time to obtain the shape L of the first lung area0
b. Performing second selection from the chest slices in the training set which are not selected yet to obtain the shape L of the N lung regions1、L2…LN
c. Making the N lung areas shaped as L1、L2…LNAfter treatment, the corresponding shape L of the N lung areas is obtained11、L21…LN1Respectively associated with the first lung region shape L0Aligning and calculating to obtain the average shape L of the lung areaaveThe processing comprises shaping the N lung regions into a shape L1、L2…LNRespectively corresponding to the first lung region shape L0Performing rotation, scaling and translation transformation;
d. if the average shape L of the lung area in step caveCompared with the first lung region shape L0Is less than a set threshold, the average shape L of the lung area is determinedaveAs a mean lung template; otherwise, entering step e;
e. shaping the first lung region0Processing the N lung region shapes L11、L21…LN1After being processed, the average shape L of the lung area is respectively compared with the average shape L of the current lung areaave-iAligning and calculating to obtain the average shape L of the current lung areaave1-iWherein said processing the first lung field shape comprises: shape L of the first lung region0Respectively relative to the current lung region average shape Lave-iMaking rotation, scaling, translation transformationsTo obtain the corresponding lung region shape L0iAnd shaping said N lung fields into a shape L11、L21…LN1Respectively relative to the current lung region average shape Lave-iPerforming rotation, scaling and translation transformation to obtain the shape L of the N lung regions1i、L2i…LNi
f. If e, the average shape L of the lung area is calculatedave1-iAverage shape L of current lung areaave-iIf the rotation, the zooming and the translation of the step (e) are less than the set threshold value, the average shape L of the current lung area calculated in the step (e) is obtainedave1-iAs a mean lung template; otherwise, the average shape L of the current lung area is determinedave-iUsing the average shape L of the lung regionave1-iInstead, the shape L of the first lung region is adjusted0By the shape L of the lung region0iAlternatively, N second lung field shapes L11、L21…LN1By N lung field shapes L1i、L2i…LNiAnd i ═ i +1, where i is an integer greater than or equal to 2, "═ is an assigned number, and return to step e;
and (4) carrying out segmentation by using a dynamic programming algorithm, and inversely transforming the segmentation result back to the original coordinate system to complete the segmentation of the lung region.
2. The method of lung segmentation in medical images according to claim 1, wherein the same number of feature points are marked on the lung contour of each corresponding chest image in the M chest images, and the distribution of the feature points on different chest images is consistent.
3. The method of lung segmentation in medical images as claimed in claim 2, wherein the feature points are labeled at the inflection points, the highest points and the lowest points of the lung contour of each chest slice.
4. The method of lung segmentation in medical images as claimed in claim 3, wherein the feature points are marked with equal distance on the lung contour of each chest slice except for the inflection point, the highest point and the lowest point.
5. The method of lung segmentation in medical images as claimed in claim 1, wherein the lung image preprocessing comprises the following means: the method comprises the steps of obtaining an original image, carrying out Gaussian filtering on the original image to obtain a filtered image, carrying out difference on the original image and the filtered image, then applying a gray average value of the filtered image to obtain a background-removed image, and then carrying out bilateral filtering operation on the background-removed image to obtain a preprocessed image.
6. The method of lung segmentation in medical images according to claim 5, wherein based on the preprocessed image, several edge shape templates corresponding to the edge contours of the image are established; and acquiring the coordinates of the gravity center point of each edge shape template and the coordinate position of the point on the edge shape relative to the gravity center point, and initially positioning the binary image of the edge shape by applying a Hough transform method.
7. The method of lung segmentation in medical images according to claim 6, wherein a boundary enhancement operator is applied to extract gradient images of edge shapes, and then the maximum 15% of pixel points are retained to generate binary images of edge shapes.
8. The method of lung segmentation in medical images according to claim 7, wherein each non-zero point on the boundary binary image is used to match any point in the template, and 1 is added at the position of the corresponding gravity center point in the Hough space; after finishing Hough transformation of all points equal to 1 in the binary image, calculating the accumulated sum of each point in Hough space, and finding out the position of the maximum value, wherein the point is the position of the gravity center of the most accurate template positioned by using the current template; and normalizing the maximum value of the gravity center point of each template, and then determining the position of the template corresponding to the maximum value as the positioning position.
9. An apparatus for lung segmentation in medical images, comprising:
the storage unit is used for storing a plurality of chest film images of the training set and chest film images to be segmented;
a display unit for displaying the corresponding chest image;
the input unit is used for marking the characteristic points of the lung in the chest radiograph to obtain a corresponding lung outline image;
an image processing unit for:
processing the lung contour image to obtain an average lung template;
preprocessing a chest image to be segmented to obtain a preprocessed lung image;
extracting a binary image of a lung boundary of the preprocessed lung image, and performing initial positioning according to generalized Hough transform to obtain a corresponding Hough positioning position;
aligning the average lung template with the Hough positioning position to obtain an alignment result;
the mean lung template is obtained according to the following steps:
a. selecting from M chest slices in training set for the first time to obtain the shape L of the first lung area0
b. Performing second selection from the chest slices in the training set which are not selected yet to obtain the shape L of the N lung regions1、L2…LN
c. Making the N lung areas shaped as L1、L2…LNAfter treatment, the corresponding shape L of the N lung areas is obtained11、L21…LN1Respectively associated with the first lung region shape L0Aligning and calculating to obtain the average shape L of the lung areaaveThe processing comprises shaping the N lung regions into a shape L1、L2…LNRespectively corresponding to the first lung region shape L0Performing rotation, scaling and translation transformation;
d. if the average shape L of the lung area in step caveCompared with the first lung region shape L0Is less than a set threshold, the average shape L of the lung area is determinedaveAs a mean lung template; otherwise, entering step e;
e. shaping the first lung region0Processing the N lung region shapes L11、L21…LN1After being processed, the average shape L of the lung area is respectively compared with the average shape L of the current lung areaave-iAligning and calculating to obtain the average shape L of the current lung areaave1-iWherein said processing the first lung field shape comprises: shape L of the first lung region0Respectively relative to the current lung region average shape Lave-iPerforming rotation, scaling and translation transformation to obtain the corresponding lung region shape L0iAnd shaping said N lung fields into a shape L11、L21…LN1Respectively relative to the current lung region average shape Lave-iPerforming rotation, scaling and translation transformation to obtain the shape L of the N lung regions1i、L2i…LNi
f. If e, the average shape L of the lung area is calculatedave1-iAverage shape L of current lung areaave-iIf the rotation, the zooming and the translation of the step (e) are less than the set threshold value, the average shape L of the current lung area calculated in the step (e) is obtainedave1-iAs a mean lung template; otherwise, the average shape L of the current lung area is determinedave-iUsing the average shape L of the lung regionave1-iInstead, the shape L of the first lung region is adjusted0By the shape L of the lung region0iAlternatively, N second lung field shapes L11、L21…LN1By N lung field shapes L1i、L2i…LNiAnd i ═ i +1, where i is an integer greater than or equal to 2, "═ is an assigned number, and return to step e;
and (4) carrying out segmentation by using a dynamic programming algorithm, and inversely transforming the segmentation result back to the original coordinate system to complete the segmentation of the lung region.
CN201510679631.5A 2015-10-19 2015-10-19 Method and device for segmenting lung in medical image Active CN106611416B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201510679631.5A CN106611416B (en) 2015-10-19 2015-10-19 Method and device for segmenting lung in medical image
US15/297,301 US10043280B2 (en) 2015-10-19 2016-10-19 Method and system for image segmentation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510679631.5A CN106611416B (en) 2015-10-19 2015-10-19 Method and device for segmenting lung in medical image

Publications (2)

Publication Number Publication Date
CN106611416A CN106611416A (en) 2017-05-03
CN106611416B true CN106611416B (en) 2020-06-26

Family

ID=58610711

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510679631.5A Active CN106611416B (en) 2015-10-19 2015-10-19 Method and device for segmenting lung in medical image

Country Status (1)

Country Link
CN (1) CN106611416B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107480673B (en) * 2017-06-30 2021-01-26 上海联影医疗科技股份有限公司 Method and device for determining interest region in medical image and image editing system
CN108665528A (en) * 2018-04-12 2018-10-16 四川旭普信息产业发展有限公司 Aeroplane photography digital modeling multi-subarea extracting and transfer algorithm
CN111918610A (en) * 2018-05-16 2020-11-10 松下电器产业株式会社 Gradation conversion method for chest X-ray image, gradation conversion program, gradation conversion device, server device, and conversion method
CN109410224B (en) * 2018-11-12 2022-04-15 深圳安科高技术股份有限公司 Image segmentation method, system, device and storage medium
CN110448335B (en) * 2019-07-11 2022-04-05 暨南大学 Method and device for fully automatically measuring head circumference of fetus based on ultrasonic image
CN111524081B (en) * 2020-04-24 2023-10-10 讯飞医疗科技股份有限公司 Lung image angle correction method, device, electronic equipment and storage medium
CN112348831B (en) * 2020-11-05 2022-11-11 中国石油大学(华东) Shale SEM image segmentation method based on machine learning

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8103077B2 (en) * 2006-12-11 2012-01-24 Siemens Aktiengesellschaft Method and system for locating opaque regions in chest X-ray radiographs
CN103310449B (en) * 2013-06-13 2016-03-02 沈阳航空航天大学 Based on the lung dividing method improving shape
CN104424629B (en) * 2013-08-19 2018-01-26 深圳先进技术研究院 A kind of x-ray chest radiograph lung segmentation method and apparatus

Also Published As

Publication number Publication date
CN106611416A (en) 2017-05-03

Similar Documents

Publication Publication Date Title
CN106611411B (en) Method for segmenting ribs in medical image and medical image processing device
CN106611416B (en) Method and device for segmenting lung in medical image
CN111027547B (en) Automatic detection method for multi-scale polymorphic target in two-dimensional image
CN107665497B (en) Method for calculating cardiothoracic ratio in medical image
CN109978839B (en) Method for detecting wafer low-texture defects
EP1465109A2 (en) Method for automated analysis of digital chest radiographs
CN108537751B (en) Thyroid ultrasound image automatic segmentation method based on radial basis function neural network
US20080310716A1 (en) Editing of pre-segmented images using seeds derived from contours
CN108230376B (en) Remote sensing image processing method and device and electronic equipment
US20080205721A1 (en) Segmentation Method Using An Oriented Active Shape Model
EP2079054A1 (en) Detection of blobs in images
US20210090230A1 (en) System and method for efficiently scoring probes in an image with a vision system
CN104240180B (en) A kind of method and device for realizing image adjust automatically
US20040109594A1 (en) Method for automatic construction of 2D statistical shape model for the lung regions
CN110688947A (en) Method for synchronously realizing human face three-dimensional point cloud feature point positioning and human face segmentation
CN113223004A (en) Liver image segmentation method based on deep learning
CN116664559A (en) Machine vision-based memory bank damage rapid detection method
WO2023024766A1 (en) Object size identification method, readable storage medium and object size identification system
Mondal et al. Automatic craniofacial structure detection on cephalometric images
CN112529900B (en) Method, device, terminal and storage medium for matching ROI in mammary gland image
CN112258536B (en) Integrated positioning and segmentation method for calluses and cerebellum earthworm parts
JP2004188202A (en) Automatic analysis method of digital radiograph of chest part
CN117078726A (en) Different spectrum image registration method based on edge extraction
US20220414869A1 (en) Detecting and segmenting regions of interest in biomedical images using neural networks
CN113343987B (en) Text detection processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 201807 No. 2258 Chengbei Road, Jiading Industrial Zone, Jiading District, Shanghai.

Patentee after: Shanghai Lianying Medical Technology Co., Ltd

Address before: 201807 No. 2258 Chengbei Road, Jiading Industrial Zone, Jiading District, Shanghai.

Patentee before: SHANGHAI UNITED IMAGING HEALTHCARE Co.,Ltd.