Method and system for automatically generating three-dimensional models of left and right lungs based on CT images

Automatically separate the left lung, right lung and bronchus through the threshold segmentation and watershed algorithm of CT images. Combined with logical operations and the maximum communication algorithm, the problems of low automation and CT noise in the existing technology are solved, and efficient and accurate left and right sides are achieved. Lung 3D model generation and noise cancellation.

CN114742953BActive Publication Date: 2024-12-27SHENZHEN YITU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210449278.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-26
Publication Date
2024-12-27
Estimated Expiration
2042-04-26

AI Technical Summary

Technical Problem

The prior art is difficult to accurately separate and reconstruct the three-dimensional model of left and right lungs under the influence of low automation and CT noise, especially in the case of left and right lung adhesions, and requires time-consuming manual interaction processing.

Method used

By acquiring the original CT image, three-dimensional data recombination and preprocessing are performed, and the left lung, right lung and bronchial areas are automatically separated using threshold segmentation and classic watershed algorithm. Combining logical operations and maximum communication algorithms, eliminating the influence of noise and automatically generating the region of interest to improve computing efficiency.

Benefits of technology

The fully automated three-dimensional model generation of left and right lungs is realized, which improves processing speed and accuracy, eliminates the impact of CT noise, solves the adhesion problem of left and right lungs, reduces manual intervention, and improves the level of automation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114742953B_ABST
    Figure CN114742953B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of medical image processing technology. In order to solve the technical problem of low automation of existing equipment, the present invention discloses a method and system for automatically generating left and right lung three-dimensional models based on CT images, including step S1, obtaining original images and reorganizing them into three-dimensional data; step S2, automatically selecting three-dimensional data for preprocessing to obtain secondary images; step S3, segmenting and marking the secondary images to generate binary images; step S4, generating a Label marking image of the same peripheral contour ROI, clearing all pixel values; screening pixels and performing Label image feature analysis; step S5, extracting a tertiary image from the secondary image and establishing a corresponding relationship, automatically separating the left lung, right lung and bronchus, and marking the left and right lungs; step S6, extracting left and right lung segmentation data; step S7, reconstructing left and right lung 3D models. The process does not require human interaction, improves the automation level, and solves the problem of low automation.
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 processing, and in particular to a method and system for automatically generating three-dimensional models of left and right lungs based on CT images. Background Art

[0002] Under the premise that the application of 3D visualization of medical CT images is becoming more and more widespread, the efficiency of CT image processing and three-dimensional reconstruction has become more and more the focus of attention. How to quickly, accurately and automatically realize the 3D models of different tissues or organs in CT images for individualized, precise and 3D visualization diagnosis and treatment research is becoming an urgent problem to be solved in scientific research and practical applications.

[0003] The analysis and application of chest CT images often start with the segmentation and three-dimensional reconstruction of the left and right lung parenchyma. Automatically, efficiently and accurately generating three-dimensional models of the left and right lungs has always been a hot research topic. However, due to differences in individual cases, CT equipment and examination parameters, a more efficient and accurate solution is needed to extract the left and right lungs and reconstruct a three-dimensional model, which can be used as the contour boundary to focus on the study and analysis of nodules, blood vessels, bronchi, paging and segmentation in the lungs.

[0004] The technical means adopted by existing equipment have solved the problem of lung or left and right lung segmentation to a certain extent, but there are still certain limitations and shortcomings. The main problems are as follows: some semi-automatic methods still have some manual interactions to specify seed points and left and right lungs, and some automation cannot solve the problem of automatic separation and identification of left and right lungs well, especially if there is adhesion between the left and right lungs. Most methods cannot effectively solve this problem, and basically do not consider the impact of CT noise.

[0005] In addition, in the processing process of existing software, the processing is basically carried out step by step through manual interaction. For example, the open source 3DSlicer software and the commercial software mimics are basically semi-automatic human intervention processing processes. The whole processing process is relatively time-consuming, and the processing technicians need to have a certain understanding of medical images.

[0006] In view of this, a method and system for automatically generating three-dimensional models of the left and right lungs based on CT images needs to be improved and enhanced. Summary of the invention

[0007] The purpose of the present invention is to provide a method and system for automatically generating three-dimensional models of left and right lungs based on CT images, so as to solve the technical problem of low automation level of existing equipment and overcome the various CT noise deficiencies of different existing equipment.

[0008] To achieve the above purpose, the specific technical solution of the method for automatically generating left and right lung three-dimensional models based on CT images of the present invention is as follows:

[0009] As one aspect of the present invention, a method for automatically generating a left and right lung three-dimensional model based on a CT image is provided, comprising the following steps:

[0010] Step S1, obtaining an original image and reconstructing it into three-dimensional data;

[0011] Step S2, automatically selecting three-dimensional data for preprocessing to obtain a secondary image (CT2);

[0012] Step S3, performing binary image segmentation on the secondary image with a predetermined threshold boundary, marking pixels smaller than the predetermined threshold boundary as 1, and pixels larger than the predetermined threshold boundary as 0, removing the image of the air area, defining the image of the lung parenchyma and bronchus as a binary image M1, and finding the outer contour ROI of the binary image M1;

[0013] Step S4, generating a Label map of the same outer contour ROI according to the binary image M1, defining the Label map as L1, and clearing all pixel values;

[0014] Automatically select the base area of ​​the left and right lungs from the sagittal plane of the binary image M1, filter the pixels and mark them as 2 and 3 in L1 respectively; from the first layer close to the head of the cross-section of the binary image M1, search for the pixels with a predetermined number of layers marked as 1, generate a local binary image M2, perform a logical open operation on the binary image M2 to generate a binary image M3, perform a Label image feature analysis on the binary image M3, retain the pixel set of the coronary feature, remove other pixels, and set the filter bronchial pixel value in L1 to 4;

[0015] Step S5, extracting the third image (CT3) from the second image (CT2) with the outer contour ROI, establishing the corresponding relationship between the third image (CT3) and the binary image M1; obtaining the parameters of L1 as input, using the classic watershed algorithm to separate the three regions of the left lung, the right lung and the bronchus, defining the Label image output after automatic separation as L2, wherein the region with a value of 2 is the left lung, the region with a value of 3 is the right lung, and the region with a value of 4 is the bronchus, and the separation of the left lung, the right lung and the bronchus is automatically achieved;

[0016] Step S6, extracting left and right lung segmentation data based on L2;

[0017] Step S7, reconstructing the left and right lung 3D models.

[0018] Automatically calculate the size of the outer bounding box of the binary image and automatically generate the region of interest (ROI), which reduces the size of the image involved in the calculation, reduces the amount of calculation of the algorithm, improves the execution speed of the algorithm, and eliminates the influence of data outside the ROI on the calculation.

[0019] In step S2, the preprocessing process includes:

[0020] Preferably, the thresholds of pixels at different azimuth angles of the three-dimensional data are selected, and the thresholds are averaged. The overall average threshold is calculated based on the average thresholds at different azimuth angles to obtain the air threshold error of the original image, and the air threshold error is defined as T2. T2 is subjected to segmented smoothing, and the image after smoothing is defined as the secondary image. The parameters of the smoothed image are obtained by calculating the difference between the typical air region pixel threshold of the air region and the air threshold in the actual CT, and the influence of noise on CT image segmentation is automatically eliminated.

[0021] Preferably, in step S2, 8 azimuth angles are included, a threshold of 9 pixels is taken in each azimuth angle, and the piecewise smoothing processing rules include:

[0022] If T2≤30, no smoothing is performed;

[0023] If 50≥T2>30, the original image is smoothed with a Gaussian smoothing coefficient of c1;

[0024] If T2>50, the original image is smoothed with a Gaussian smoothing coefficient of c2;

[0025] Among them, 1>c2>c1>0, and the image after smoothing is defined as a secondary image.

[0026] Preferably, in step S3, the predetermined threshold value is -300, a pixel at a corner of the three-dimensional data is automatically selected as a seed point and grown, the connected area of ​​the seed point is deleted, and then the maximum connected retention calculation is performed.

[0027] Preferably, in step S4, according to the DICOM data body position information of the original image:

[0028] The label base area of ​​the left lung is automatically determined from N=10 layers of images from the left side boundary of the sagittal plane of the binary image M1, and the label base area of ​​the right lung is automatically determined from N=10 layers of images from the right side boundary of the sagittal plane of the binary image M1; the predetermined number of layers is 30. The label images of the left and right lungs and bronchus that are automatically marked are added to the images in the automatically selected region of interest, so that the influence of adhesion between the left and right lungs can be eliminated.

[0029] Preferably, in step S5, the corresponding relationship includes:

[0030] The cubic image (CT3) and the binary image M1 have the same size and one-to-one correspondence in pixels. If the pixel value in the binary image M1 is 0, the pixel value in the cubic image (CT3) is set to a high value as the background to eliminate the impact on subsequent calculations. The original value of the pixel with a pixel value of 1 in the binary image M1 is retained, and the modified CT3 is used as the input original data.

[0031] Preferably, in step S6, based on L2, the left lung binary data with a Label value of 2 is extracted by a threshold connection algorithm and defined as MLeft, and the right lung binary image with a Label value of 3 is extracted and defined as MRight, and the vascular cavities in MLeft and MRight are automatically filled by a logical closing operation. According to the Label image, the binary data of the left and right lungs are extracted respectively according to different Label values ​​using threshold connection, and the cavities in the binary image caused by the blood vessels are eliminated using a closing operation, thereby ensuring the quality of the 3D models of the left and right lungs reconstructed in subsequent 3D.

[0032] Preferably, in step S7, two binary images MLeft and MRight are respectively used as input, and the MC reconstruction algorithm is used to reconstruct the 3D models MeshLeft and MeshRight of the left and right lungs.

[0033] Preferably, c1=0.4, c2=0.6.

[0034] As another aspect of the present invention, a system for automatically generating a left and right lung three-dimensional model based on a CT image is provided, comprising:

[0035] A data input module is used to obtain the original image and reconstruct it into three-dimensional data;

[0036] A data preprocessing module, used to automatically select three-dimensional data for preprocessing to obtain a secondary image (CT2);

[0037] A segmentation module is used to perform binary image segmentation on the secondary image with a predetermined threshold boundary, mark the pixel points less than the predetermined threshold boundary as 1, and mark the pixel points greater than the predetermined threshold boundary as 0, remove the image of the air area, define the image of the lung parenchyma and bronchus as a binary image M1, and find the outer contour ROI of the binary image M1;

[0038] A generation module is used to generate a Label marking image of the same outer contour ROI according to the binary image M1, define the Label marking image as L1, and clear all pixel values; automatically select the basic areas of the left lung and the right lung from the sagittal plane of the binary image M1, filter the pixels and mark them as 2 and 3 in L1 respectively; from the first layer of the cross-section of the binary image M1 close to the head, search for the pixels marked as 1 in the predetermined layer, generate a local binary image M2, perform a logical open operation on the binary image M2 to generate a binary image M3, perform a Label image feature analysis on the binary image M3, retain the pixel set of the coronary feature, clear other pixels, and set the filter bronchial pixel value in L1 to 4;

[0039] The automatic segmentation module extracts the third image (CT3) from the second image (CT2) with the outer contour ROI, and establishes the corresponding relationship between the third image (CT3) and the binary image M1; obtains the parameters of L1 as input, uses the classic watershed algorithm to separate the three regions of the left lung, right lung and bronchus, and defines the Label image output after automatic separation as L2, where the region with a value of 2 is the left lung, the region with a value of 3 is the right lung, and the region with a value of 4 is the bronchus, and the separation of the left lung, right lung and bronchus is automatically achieved;

[0040] A data extraction module is used to extract binary images of the left lung and the right lung from L2;

[0041] The reconstruction module is used to reconstruct the 3D module according to the input parameters.

[0042] Furthermore, the data preprocessing module includes a judgment module for segmented smoothing processing.

[0043] The method and system for automatically generating left and right lung three-dimensional models based on CT images provided by the present invention have the following advantages:

[0044] By combining threshold segmentation, deletion of connected areas, and maximum connected operation to retain the target area, the binary image of the lung parenchyma connecting the trachea is automatically segmented; the outer contour size of the binary image is automatically calculated, and the region of interest (ROI) is automatically generated, which reduces the size of the image involved in the calculation, reduces the amount of calculation of the algorithm, improves the execution speed of the algorithm, and eliminates the impact of data outside the ROI on the calculation. This process does not require human interaction, improves the level of automation, and solves the problem of low automation. In addition, by calculating the difference between the typical air area pixel threshold of the air area and the air threshold in the actual CT to obtain the parameters of the smoothed image, the influence of noise on CT image segmentation is automatically eliminated; the influence of noise in CT data is eliminated, and the problem of adhesion between the left and right lungs is well solved. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1A cross-sectional view of the original image provided by the present invention;

[0046] Figure 2 A sagittal view of the original image provided by the present invention;

[0047] Figure 3 A coronal image of the original image provided by the present invention;

[0048] Figure 4 A cross-sectional view of the overlap between the binary data provided by the present invention and the original image;

[0049] Figure 5 A sagittal image in which the binary data provided by the present invention and the original image overlap;

[0050] Figure 6 A coronal image in which the binary data provided by the present invention and the original image are overlapped;

[0051] Figure 7 A cross-sectional view after ROI calculation provided by the present invention;

[0052] Figure 8 The sagittal image after ROI calculation provided by the present invention;

[0053] Fig. 9 The coronal image after ROI calculation provided by the present invention;

[0054] Fig.10 The cross-sectional view is a superimposed display of the Label image provided by the present invention and the original image after ROI extraction;

[0055] Fig.11 The sagittal image is a superimposed display of the Label image provided by the present invention and the original image after ROI extraction;

[0056] Fig.12 The coronal image is a superimposed display of the Label image provided by the present invention and the original image after ROI extraction;

[0057] Fig.13 This is a rendering of the effect of the left lung, right lung and bronchus after separation provided by the present invention;

[0058] Fig.14 The cross-sectional overlap effect of the mapped original image provided by the present invention;

[0059] Fig.15 The sagittal plane image overlap effect of the mapped original image provided by the present invention;

[0060] Fig.16 The coronal plane image overlap effect of the original image mapped provided by the present invention;

[0061] Fig.17The 3D model diagram of the left lung and the right lung after 3D reconstruction provided by the present invention;

[0062] Fig.18 Separate diagram of left lung and right lung adhesion provided by the present invention;

[0063] Fig.19 The data graph before the noise processing provided by the present invention;

[0064] Fig. 20 The data graph after noise processing provided by the present invention;

[0065] Fig.21 A flow chart of the method for automatically generating three-dimensional models of left and right lungs based on CT images provided by the present invention. DETAILED DESCRIPTION

[0066] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0067] See also Figures 1 to 21 The present invention provides a method for automatically generating a left and right lung three-dimensional model based on a CT image, comprising the following steps:

[0068] Step S1, data input, obtain the original image CT1, and reconstruct it into three-dimensional data according to the TAG array of the DICOM medical image, such as Figures 1 to 3 As shown, the transverse, coronal and sagittal images are reconstructed in the form of MPR, and the images can be displayed and processed from different directions.

[0069] Step S2, data preprocessing, automatically selecting 8 azimuth angles of the three-dimensional data, taking a threshold of 9 pixels in each azimuth angle, performing threshold averaging, calculating an overall average threshold T1, T1-(-1024) based on the average thresholds of the 8 angles, the standard air threshold is -1024, and the air threshold error of the original image CT1 is obtained, the air threshold error is defined as T2, and T2 is segmented;

[0070] If T2≤30, no smoothing is performed;

[0071] If 50≥T2>30, the original image CT1 is smoothed with a Gaussian smoothing coefficient of c1;

[0072] If T2>50, the original image CT1 is smoothed with a Gaussian smoothing coefficient of c2;

[0073] Among them, 1>c2>c1>0, and the image after smoothing is defined as the secondary image CT2;

[0074] The preferred values ​​are c1=0.4 and c2=0.6.

[0075] The so-called Gaussian smoothing here is also called Gaussian blur, which is usually used to reduce image noise and reduce the level of detail. The current pixel is used as the kernel center, and the convolution kernel is used to make a weighted average of the surrounding neighborhood pixels, and its value is used as the new value of the current pixel. In the data preprocessing stage, the difference between the air area threshold in the typical and actual CT is calculated to obtain the parameters of the smoothed image, automatically eliminating the influence of noise on CT image segmentation, and overcoming the shortcomings of existing equipment in solving CT noise.

[0076] In one embodiment, the range value 26 of the air threshold error T2 is calculated, and Gaussian smoothing processing is not required. After the threshold segmentation of the lung parenchyma is performed, the left lung, the right lung and the bronchus are connected, and the overlap display image of the binary data and the original image is obtained as shown in FIG. Figures 4 to 6 shown.

[0077] Step S3, segment the lung parenchyma and bronchi, perform binary image segmentation on the secondary image CT2 with a predetermined threshold value boundary, the predetermined threshold value boundary is -300, pixels less than the predetermined threshold value boundary are marked as 1, and pixels greater than the predetermined threshold value boundary are marked as 0. The obtained binary image includes the air area around the body and the area of ​​the lungs with bronchi. The pixel of a corner of the three-dimensional data is automatically selected as a seed point and grown. The basic method is to start from the seed point, add those neighboring pixels with similar properties to the seed pre-defined to each seed to form these growth areas (such as a specific range of grayscale or color), delete the connected area of ​​the seed point, that is, remove the image of the air area, and then perform the maximum connected retention calculation; define the image of the lung parenchyma and bronchi as a binary image M1, within the range of the chest and lung CT data, the chest and lungs in the body are the largest low-density threshold area, so that the binary image M1 containing the connection between the lung parenchyma and the bronchi is obtained.

[0078] For the extracted binary image M1, search for the outer contour ROI of the pixel points to ensure that the lung parenchyma area is included and the area outside the lung parenchyma and bronchus is excluded. The format is {X-axis minimum value, X-axis maximum value, Y-axis minimum value, Y-axis maximum value, Z-axis minimum value, Z-axis maximum value}.

[0079] Step S4, generating a Label mark map, generating a Label mark map of the same outer contour ROI according to the binary image M1, defining the Label mark map as L1, and clearing all pixel values;

[0080] After automatic peripheral contour ROI calculation, the captured original image range is as follows Figures 7 to 9 As shown, this automatic ROI area can effectively reduce the image area for parameter calculation:

[0081] Automatically label the base area of ​​the left lung from the left sagittal boundary of the binary image M1 to the inner N=10 layers of the image;

[0082] Automatically label the right lung base area from the right sagittal boundary of binary image M1 to the inside of N=10 layers of images;

[0083] From the first layer of the cross section of the binary image M1 close to the head, search for 30 pixels marked as 1, generate a local binary image M2, perform a logical open operation on the binary image M2 to generate a binary image M3, perform Label image feature analysis on the binary image M3, retain the pixel set of the coronary feature, remove other pixels, and set the label value of the selected bronchial pixels in L1 to 4;

[0084] By adding the automatically labeled Label images of the left and right lungs and bronchus to the images in the automatically selected region of interest, adhesions between the left and right lungs (such as Fig.18 )’s impact.

[0085] Step S5, automatic segmentation of the left and right lungs, extracting the tertiary image CT3 from the secondary image CT2 with the outer contour ROI, the tertiary image CT3 and the binary image M1 have the same size and one-to-one correspondence in pixels, if the pixel value in the binary image M1 is 0, the pixel value in the tertiary image CT3 is set to a high value as the background to eliminate the influence on subsequent calculations, retaining the original value of the pixel point with a pixel value of 1 in the binary image M1, and using the modified tertiary image CT3 as the input original data;

[0086] The parameters of L1 are taken as input, and the classic watershed algorithm is used to separate the left lung, right lung and bronchus into three regions. The Label image output after automatic separation is defined as L2, where the region with a value of 2 is the left lung, the region with a value of 3 is the right lung, and the region with a value of 4 is the bronchus. Based on the characteristics of the CT image data containing directional coordinates, the Label seed regions of the left lung, right lung and bronchus are automatically obtained, and the left lung and right lung are automatically identified and marked;

[0087] The seed Label regions automatically found based on the azimuth information of the image are displayed in a superimposed manner. The left lung, right lung, and bronchial regions can be distinguished based on color (color image) and grayscale (black and white image). The superimposed display of the Label image and the original image after ROI extraction is shown below: Figures 10 to 12 shown.

[0088] The Label image after watershed is rendered in different colors (or grayscales). The effect is as follows: Fig.13 As shown, in Figures 14 to 16 The left lung, right lung and bronchial maps are overlapped with the original image.

[0089] Step S6, extract the left and right lung segmentation data. Based on L2, use the threshold connection algorithm to extract the left lung binary data with a Label value of 2 and define it as MLeft. Extract the right lung binary image with a Label value of 3 and define it as MRight. Automatically fill the vascular holes in MLeft and MRight through logical closing operations. According to the Label image, use threshold connection to extract the binary data of the left and right lungs according to different Label values, and use closing operations to eliminate the holes in the binary images caused by blood vessels, thereby ensuring the quality of the subsequent 3D reconstruction of the left and right lungs.

[0090] Step S7, reconstruct the 3D models of the left and right lungs, using the two binary images MLeft and MRight as input, and using the MC reconstruction algorithm to reconstruct the 3D models of the left and right lungs MeshLeft and MeshRight. Fig.17 The three-dimensional models of the left and right lungs were reconstructed.

[0091] By calculating the difference between the typical air region pixel threshold and the actual air threshold in CT, the parameters of the smoothed image are obtained, and the influence of noise on CT image segmentation is automatically eliminated, such as Fig. 20 Relative to Fig.19 , noise processing was performed; by combining threshold segmentation, deletion of connected areas and maximum connected operation to retain the target area, the binary image of the lung parenchyma connecting the trachea was automatically segmented; the outer contour size of the binary image was automatically calculated, and the region of interest (ROI) was automatically generated, which reduced the size of the image involved in the calculation, reduced the amount of calculation of the algorithm, improved the execution speed of the algorithm, and eliminated the influence of data outside the ROI on the calculation. No human interaction is required, the influence of noise in CT data is eliminated, and the problem of adhesion between the left and right lungs is well solved.

[0092] The present invention also provides a system for automatically generating left and right lung three-dimensional models based on CT images, comprising:

[0093] A data input module is used to obtain the original image and reconstruct it into three-dimensional data;

[0094] The data preprocessing module is used to automatically select the thresholds of pixels at different azimuth angles of the three-dimensional data, perform threshold averaging, calculate the overall average threshold according to the average thresholds at different azimuth angles, obtain the air threshold error of the original image, define the air threshold error as T2, perform piecewise smoothing on T2, and define the image after smoothing as a secondary image;

[0095] A segmentation module is used to perform binary image segmentation on the secondary image with a predetermined threshold boundary, mark the pixel points less than the predetermined threshold boundary as 1, and mark the pixel points greater than the predetermined threshold boundary as 0, remove the image of the air area, define the image of the lung parenchyma and bronchus as a binary image M1, and find the outer contour ROI of the binary image M1;

[0096] A generation module is used to generate a Label marking image of the same outer contour ROI according to the binary image M1, define the Label marking image as L1, and clear all pixel values; automatically select the basic areas of the left lung and the right lung from the sagittal plane of the binary image M1, filter the pixels and mark them as 2 and 3 in L1 respectively; from the first layer of the cross-section of the binary image M1 close to the head, search for the pixels marked as 1 in the predetermined layer, generate a local binary image M2, perform a logical open operation on the binary image M2 to generate a binary image M3, perform a Label image feature analysis on the binary image M3, retain the pixel set of the coronary feature, clear other pixels, and set the filter bronchial pixel value in L1 to 4;

[0097] The automatic segmentation module is used to extract the third image CT3 from the second image CT2 with the outer contour ROI, and establish the corresponding relationship between the third image CT3 and the binary image M1; obtain the parameters of L1 as input, use the classic watershed algorithm to separate the three regions of the left lung, the right lung and the bronchus, and define the Label image output after the automatic separation as L2, where the region with a value of 2 is the left lung, the region with a value of 3 is the right lung, and the region with a value of 4 is the bronchus, and the separation of the left lung, the right lung and the bronchus is automatically realized;

[0098] A data extraction module is used to extract binary images of the left lung and the right lung from L2;

[0099] The reconstruction module is used to reconstruct the 3D module according to the input parameters.

[0100] Wherein, the data preprocessing module includes a judgment module for segmented smoothing processing.

[0101] In summary, the method and system for automatically generating three-dimensional models of the left and right lungs based on CT images provided by the present invention can realize the fully automatic extraction of 3D models of the left and right lungs from chest CT data without any manual intervention in the middle, thereby improving efficiency, and can automatically serve as the basis for CT image analysis and other lung tissue analysis; the left and right lungs are automatically identified, because the internal structures of the left and right lungs are not exactly the same, and after automatic distinction, the basic model boundary can be provided for calculations such as lung lobes; the noise of the CT image is automatically eliminated to obtain higher quality 3D models of the left and right lungs; through the application of automatic regions of interest, the efficiency of extracting left and right lung models from CT images is greatly improved, and it can be completed within 15 seconds on an ordinary computer; no manual interaction process is required during the processing process, which not only improves efficiency, but also reduces the possibility of errors and errors that may be introduced due to manual operation; the fully automatic algorithm process can provide a more convenient way for practical applications, promote and optimize the efficient and seamless application of 3D visualization technology of CT images to the diagnosis and treatment process.

[0102] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for automatically generating three-dimensional models of left and right lungs based on CT images, characterized in that: The steps include: Step S1, obtaining an original image (CT1) and reconstructing it into three-dimensional data; Step S2, automatically selecting three-dimensional data for preprocessing to obtain a secondary image (CT2); Step S3, performing binary image segmentation on the secondary image (CT2) with a predetermined threshold boundary, marking pixels smaller than the predetermined threshold boundary as 1, and pixels larger than the predetermined threshold boundary as 0, removing the image of the air area, defining the image of the lung parenchyma and bronchus as a binary image M1, and finding the outer contour ROI of the binary image M1; Step S4, generating a Label map of the same outer contour ROI according to the binary image M1, defining the Label map as L1, and clearing all pixel values; Automatically select the base area of ​​the left and right lungs from the sagittal plane of the binary image M1, filter the pixels and mark them as 2 and 3 in L1 respectively; from the first layer close to the head of the cross-section of the binary image M1, search for the pixels with a predetermined number of layers marked as 1, generate a local binary image M2, perform a logical open operation on the binary image M2 to generate a binary image M3, perform a Label image feature analysis on the binary image M3, retain the pixel set of the coronary feature, remove other pixels, and set the filter bronchial pixel value in L1 to 4; Step S5, extracting the third image (CT3) from the second image (CT2) with the outer contour ROI, and establishing the corresponding relationship between the third image (CT3) and the binary image M1; obtaining the parameters of L1 as input, using the classic watershed algorithm to separate the three regions of the left lung, the right lung and the bronchus, and defining the Label image output after the automatic separation as L2, where the region with a value of 2 is the left lung, the region with a value of 3 is the right lung, and the region with a value of 4 is the bronchus; Step S6, extracting left and right lung segmentation data based on L2; Step S7, reconstructing the left and right lung 3D models.

2. The method for automatically generating left and right lung three-dimensional models based on CT images according to claim 1, characterized in that: In step S2, the preprocessing process includes: The thresholds of pixels at different azimuth angles of the three-dimensional data are selected and the thresholds are averaged. The overall average threshold is calculated based on the average thresholds at different azimuth angles to obtain the air threshold error of the original image. The air threshold error is defined as T2, T2 is smoothed in sections, and the image after smoothing is defined as the secondary image.

3. The method for automatically generating left and right lung three-dimensional models based on CT images according to claim 2, characterized in that: In step S2, there are 8 azimuth angles, and a threshold of 9 pixels is taken in each azimuth angle. The piecewise smoothing processing rules include: If T2≤30, no smoothing is performed; If 50≥T2>30, the original image (CT1) is smoothed with a Gaussian smoothing coefficient of c1; If T2>50, the original image (CT1) is smoothed with a Gaussian smoothing coefficient of c2; Among them, 1>c2>c1>0, and the image after smoothing is defined as a secondary image (CT2).

4. The method for automatically generating left and right lung three-dimensional models based on CT images according to any one of claims 1 to 3, characterized in that: In step S3, the predetermined threshold is -300, and a pixel at a corner of the three-dimensional data is automatically selected as a seed point and grown, and the connected area of ​​the seed point is deleted, and then the maximum connected retention calculation is performed.

5. The method for automatically generating left and right lung three-dimensional models based on CT images according to claim 4, characterized in that: In step S4, according to the DICOM data body position information of the original image (CT1): The Label base area of ​​the left lung is automatically obtained from N=10 layers of images from the left side boundary of the sagittal plane of the binary image M1, and the Label base area of ​​the right lung is automatically obtained from N=10 layers of images from the right side boundary of the sagittal plane of the binary image M1; the predetermined number of layers is 30.

6. The method for automatically generating left and right lung three-dimensional models based on CT images according to claim 5, characterized in that: In step S5, the corresponding relationship includes: The cubic image (CT3) and the binary image M1 have the same size and one-to-one correspondence in pixels. If the pixel value in the binary image M1 is 0, the pixel value in the cubic image (CT3) is set to a high value as the background to eliminate the impact on subsequent calculations. The original value of the pixel with a pixel value of 1 in the binary image M1 is retained, and the modified CT3 is used as the input original data.

7. The method for automatically generating left and right lung three-dimensional models based on CT images according to claim 6, characterized in that: In step S6, based on L2, the left lung binary data with a Label value of 2 is extracted using the threshold interconnection algorithm and defined as MLeft, and the right lung binary image with a Label value of 3 is extracted and defined as MRight. The vascular cavities in MLeft and MRight are automatically filled through a logical closing operation.

8. The method for automatically generating left and right lung three-dimensional models based on CT images according to claim 7, characterized in that: In step S7, the two binary images MLeft and MRight are respectively used as inputs, and the MC reconstruction algorithm is used to reconstruct the 3D models MeshLeft and MeshRight of the left and right lungs.

9. A system for automatically generating three-dimensional models of left and right lungs based on CT images, characterized in that: include: A data input module is used to obtain the original image (CT1) and reconstruct it into three-dimensional data; A data preprocessing module, used to automatically select three-dimensional data for preprocessing to obtain a secondary image (CT2); A segmentation module is used to perform binary image segmentation on the secondary image (CT2) with a predetermined threshold boundary, mark the pixel points smaller than the predetermined threshold boundary as 1, and mark the pixel points larger than the predetermined threshold boundary as 0, remove the image of the air area, define the image of the lung parenchyma and bronchus as a binary image M1, and find the outer contour ROI of the binary image M1; A generation module is used to generate a Label marking image of the same outer contour ROI according to the binary image M1, define the Label marking image as L1, and clear all pixel values; automatically select the basic areas of the left lung and the right lung from the sagittal plane of the binary image M1, filter the pixels and mark them as 2 and 3 in L1 respectively; from the first layer of the cross-section of the binary image M1 close to the head, search for the pixels marked as 1 in the predetermined layer, generate a local binary image M2, perform a logical open operation on the binary image M2 to generate a binary image M3, perform a Label image feature analysis on the binary image M3, retain the pixel set of the coronary feature, clear other pixels, and set the filter bronchial pixel value in L1 to 4; The automatic segmentation module is used to extract the third image from the secondary image with the outer contour ROI, and establish the corresponding relationship between the third image and the binary image M1; obtain the parameters of L1 as input, use the classic watershed algorithm to separate the three regions of the left lung, right lung and bronchus, and define the Label image output after automatic separation as L2, where the region with a value of 2 is the left lung, the region with a value of 3 is the right lung, and the region with a value of 4 is the bronchus, and the separation of the left lung, right lung and bronchus is automatically realized; A data extraction module is used to extract binary images of the left lung and the right lung from L2; The reconstruction module is used to reconstruct the 3D module according to the input parameters.

10. The system for automatically generating three-dimensional models of left and right lungs based on CT images according to claim 9, characterized in that: The data preprocessing module includes a judgment module for piecewise smoothing processing.