A lung parenchyma extraction method, device and equipment based on CT images
By converting axial CT images into coronal CT images and performing RGB image processing, combined with morphological and image segmentation algorithms, the problem of accuracy in extracting lung parenchymal areas is solved, thereby improving the accuracy of lung disease diagnosis.
Patent Information
- Application Number
- CN202510969561.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-15
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2045-07-15
AI Technical Summary
Existing technologies have difficulty in accurately extracting the lung parenchyma area, resulting in limited accuracy in diagnosing lung diseases.
Axial CT image sequences were converted into coronal CT image sequences to form RGB images. Morphological processing and cavity filling algorithm were used to extract the area within the lung parenchyma boundary, and the lung parenchyma area was generated through image segmentation.
The accuracy of lung parenchymal area extraction is improved, and the reliability of lung disease diagnosis is enhanced.
Smart Images

Figure CN120471920B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of medical image processing technology, and in particular to a method, device and equipment for extracting lung parenchyma based on CT images. Background Art
[0002] The lung parenchyma is the main structure within the lungs and the primary site of lesions in lung diseases. Accurately extracting it is crucial for assisting physicians in making accurate diagnoses. Imaging is currently the primary method used in hospitals to diagnose lung cancer, with computed tomography (CT) being the most common. CT imaging diagnosis, based on radiomics methods, has shown great potential in quantitative tumor analysis. It is a necessary prerequisite and an important foundation for assisting radiologists in downstream image analysis and is crucial for guiding clinical decision-making. However, lung lesions can cause abnormalities in the shape of the lung parenchyma, making accurate extraction of the parenchyma challenging. Summary of the Invention
[0003] The present application provides a method, device and equipment for extracting lung parenchyma based on CT images, which can improve the accuracy of extracting lung parenchyma areas.
[0004] In order to achieve the above objectives, this application adopts the following technical solutions:
[0005] In a first aspect of an embodiment of the present application, a method for extracting lung parenchyma based on CT images is provided, the method comprising:
[0006] Acquire axial CT image sequences;
[0007] converting the axial CT image sequence into a coronal CT image sequence;
[0008] Selecting three consecutive frames of images from the coronal CT image sequence to form three channels of an RGB image, thereby obtaining an RGB image;
[0009] determining a first lung region according to pixel values of the RGB image;
[0010] After performing morphological processing and cavity filling on the first lung region, the region within the lung parenchyma boundary is extracted to obtain a second lung region;
[0011] After performing image segmentation processing on the second lung region, a lung segmentation region is obtained;
[0012] A lung parenchymal region is generated based on the lung segmentation region and the corresponding coronal CT image.
[0013] As a possible implementation manner, converting the axial CT image sequence into a coronal CT image sequence includes:
[0014] Obtain the first row resolution, first column resolution, first slice thickness, first slice spacing, first pixel spacing, and total number of axial sequences of axial CT images;
[0015] determining the number of images of the coronal CT image according to the first row resolution;
[0016] determining a second column resolution of the coronal CT image according to the first column resolution;
[0017] determining a second row resolution of the coronal CT image according to the total number of axial sequences, the first slice thickness, and the first pixel spacing;
[0018] determining a second layer thickness of the coronal CT image according to the first pixel spacing;
[0019] determining a second pixel spacing of the coronal CT image according to the first slice spacing;
[0020] A coronal CT image sequence is generated according to the number of images, the second column resolution, the second row resolution, the second slice thickness, and the second pixel spacing.
[0021] As a possible implementation, after converting the axial CT image sequence into a coronal CT image sequence, the method further includes: normalizing the image bit number of the coronal CT image to obtain a target coronal CT image sequence;
[0022] The selecting three consecutive frames of images from the coronal CT image sequence to form three channels of RGB images includes: forming three channels of RGB images from three consecutive frames of images from the target coronal CT image sequence.
[0023] As a possible implementation, after obtaining the RGB image, the method further includes:
[0024] Obtaining a preset color set, wherein the color set includes a plurality of preset pixel values;
[0025] For each pixel in the RGB image, calculating the difference between the pixel and each preset pixel value, taking the preset pixel value corresponding to the minimum difference as the pixel value of the pixel, and obtaining the target RGB image;
[0026] Determining the lung area according to the pixel values of the RGB image includes:
[0027] A first lung region is determined according to pixel values of the target RGB image.
[0028] As a possible implementation manner, the preset pixel value includes 0, and determining the first lung region according to the pixel value of the target RGB image includes:
[0029] Modify the pixel values of the pixel points with pixel values of 0 in the target RGB image to 255, and modify the pixel values of the pixel points with pixel values not equal to 0 in the target RGB image to 0, to obtain a detection image;
[0030] An area consisting of pixels with a pixel value of 255 in the detection image is determined as the first lung area.
[0031] As a possible implementation, after performing morphological processing and cavity filling on the first lung region, extracting the region within the lung parenchyma boundary to obtain the second lung region includes:
[0032] Using a morphological operator, first performing a dilation operation and then performing an erosion operation on the first lung region to obtain a processed region;
[0033] After processing the processing area using a hole filling algorithm, a filling area is obtained;
[0034] Performing a dilation operation on the filled area using a morphological operator to obtain a first area;
[0035] Performing an erosion operation on the filled area using a morphological operator to obtain a second area;
[0036] obtaining a lung parenchymal wall template region according to an area difference between the first region and the second region;
[0037] The pixel value of the first pixel point in the lung parenchymal wall template area is modified to the pixel value of the corresponding first target pixel point, the pixel value of the second target pixel point, and the pixel value of the third target pixel point, and the pixel values of the pixels other than the first pixel point in the lung parenchymal wall template area are modified to 0, thereby obtaining three corresponding second lung areas;
[0038] Among them, the first pixel point is a pixel point with a pixel value of 255, the first target pixel point is the first frame image selected from the three consecutive frames of images, the second target pixel point is the second frame image selected from the three consecutive frames of images, and the third target pixel point is the third frame image selected from the three consecutive frames of images.
[0039] As a possible implementation manner, performing image segmentation processing on the second lung region to obtain a lung segmentation region includes:
[0040] The three second lung regions are respectively input into the trained Unet network for image segmentation processing to obtain lung segmentation regions.
[0041] As a possible implementation, generating a lung parenchyma region based on the lung segmentation region and the corresponding coronal CT image includes:
[0042] After processing the lung segmentation region using a cavity filling algorithm, a lung parenchyma template region is obtained;
[0043] The pixel value of the first pixel point in the lung parenchyma template area is modified to the corresponding pixel value of the first target pixel point, the pixel value of the second target pixel point and the pixel value of the third target pixel point, and the pixel values of the pixel points other than the first pixel point in the lung parenchyma template area are modified to 0 to obtain the corresponding three lung parenchyma area images.
[0044] In a second aspect of an embodiment of the present application, a device for extracting lung parenchyma based on CT images is provided, the device comprising:
[0045] An acquisition module, used for acquiring axial CT image sequences;
[0046] a conversion module, configured to convert the axial CT image sequence into a coronal CT image sequence;
[0047] A processing module is configured to select three consecutive frames of images from the coronal CT image sequence to form three channels of an RGB image to obtain an RGB image; determine a first lung region based on pixel values of the RGB image; perform morphological processing and cavity filling on the first lung region, extract an area within the lung parenchyma boundary to obtain a second lung region; perform image segmentation processing on the second lung region to obtain a lung segmentation region; and generate a lung parenchyma region based on the lung segmentation region and the corresponding coronal CT image.
[0048] In a third aspect of an embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the method for extracting lung parenchyma based on CT images in the first aspect of an embodiment of the present application is implemented.
[0049] In a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for extracting lung parenchyma based on CT images described in the first aspect of an embodiment of the present application is implemented.
[0050] The beneficial effects of the technical solutions provided in the embodiments of the present application include at least:
[0051] The embodiment of the present application provides a lung parenchyma extraction method based on CT images, which obtains an axial CT image sequence; converts the axial CT image sequence into a coronal CT image sequence; selects three consecutive frames of images from the coronal CT image sequence to form three channels of an RGB image to obtain an RGB image; determines a first lung region based on the pixel values of the RGB image; performs morphological processing and cavity filling on the first lung region, extracts the region within the lung parenchyma boundary to obtain a second lung region; performs image segmentation processing on the second lung region to obtain a lung segmentation region; generates a lung parenchyma region based on the lung segmentation region and the corresponding coronal CT image. The present application detects the lung parenchyma by generating a coronal image from an axial position, and obtains an RGB image through a multi-channel data synthesis algorithm to obtain local 3D information. Furthermore, based on visual perception, a color mapping mechanism is proposed to focus on the area where the lungs are located, which can improve the accuracy of lung parenchyma region extraction. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 A flowchart of a lung parenchyma extraction method based on CT images provided in an embodiment of the present application;
[0053] Figure 2 An axial CT image sequence diagram provided in an embodiment of the present application;
[0054] Figure 3 A coronal CT image sequence diagram provided in an embodiment of the present application;
[0055] Figure 4 An RGB image provided in an embodiment of the present application;
[0056] Figure 5 A target RGB image provided in an embodiment of the present application;
[0057] Figure 6 A CT image of a first lung region provided in an embodiment of the present application;
[0058] Figure 7 A CT image of a treatment area provided in an embodiment of the present application;
[0059] Figure 8 A CT image of a filling area provided in an embodiment of the present application;
[0060] Figure 9 A CT image of a lung parenchymal wall template area provided in an embodiment of the present application;
[0061] Figure 10 A CT image of three second lung regions provided in an embodiment of the present application;
[0062] Figure 11 A CT image of three lung segmentation areas provided in an embodiment of the present application;
[0063] Figure 12 A CT image of three lung parenchyma regions provided in an embodiment of the present application;
[0064] Figure 13 A structural diagram of a lung parenchyma extraction device based on CT images provided in an embodiment of the present application;
[0065] Figure 14 A schematic diagram of the internal structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0066] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0067] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present disclosure, unless otherwise specified, "plurality" means two or more.
[0068] Additionally, the use of “based on” or “according to” is intended to be open and inclusive, in that a process, step, calculation, or other action “based on” or “according to” one or more conditions or values may, in practice, be based on additional conditions or beyond values.
[0069] The present invention provides a method for extracting lung parenchyma based on CT images. Figure 1 As shown, the method includes the following steps:
[0070] Step 101: Acquire an axial CT image sequence.
[0071] Read CT image data, such as Figure 2 The following is a diagram of the axial CT image sequence. According to the CT image sequence data parameters, the axial image sequence is read as IA ,in IA i is the i-th frame axial CT image.
[0072] For example, the parameters of CT image sequence data in DICOM format are shown in Table 1.
[0073] Table 1 CT image sequence data parameters
[0074]
[0075] Step 102: Convert the axial CT image sequence into a coronal CT image sequence.
[0076] It is understandable that since the coronal sequence has more information about the lung parenchyma structure, the axial CT image sequence is converted into the coronal CT image sequence. Figure 3 The following is a coronal CT image sequence diagram. The coronal CT image sequence is recorded as IC, in IC i is the i-th frame coronal CT image.
[0077] Step 103: Select three consecutive frames of images from the coronal CT image sequence to form three channels of an RGB image, thereby obtaining an RGB image.
[0078] It can be understood that, by drawing on the principle of visual color image perception, three consecutive frames of images are selected for multi-channel data synthesis to form three channels of the RGB image and obtain the RGB image.
[0079] Step 104: determining a first lung region according to the pixel values of the RGB image;
[0080] Step 105: After performing morphological processing and cavity filling on the first lung region, extract the region within the lung parenchyma boundary to obtain a second lung region;
[0081] Step 106: performing image segmentation processing on the second lung region to obtain a lung segmentation region;
[0082] Step 107: Generate a lung parenchymal region based on the lung segmentation region and the corresponding coronal CT image.
[0083] Optionally, converting the axial CT image sequence into a coronal CT image sequence includes:
[0084] Obtain the first row resolution, first column resolution, first slice thickness, first slice spacing, first pixel spacing, and total number of axial sequences of axial CT images;
[0085] determining the number of images of the coronal CT image according to the first row resolution;
[0086] determining a second column resolution of the coronal CT image according to the first column resolution;
[0087] determining a second row resolution of the coronal CT image according to the total number of axial sequences, the first slice thickness, and the first pixel spacing;
[0088] determining a second layer thickness of the coronal CT image according to the first pixel spacing;
[0089] determining a second pixel spacing of the coronal CT image according to the first slice spacing;
[0090] A coronal CT image sequence is generated according to the number of images, the second column resolution, the second row resolution, the second slice thickness, and the second pixel spacing.
[0091] In actual implementation, the resolution of the first row of axial CT images is H A , the first column resolution is W A The first layer is thick L A_th The first layer spacing is L A_sp , the first pixel spacing is P A_sp and the total number of axial sequences N A , during the conversion process:
[0092] ,
[0093] ,
[0094] ,
[0095] in, N C is the image number of the coronal CT image, W C is the second column resolution of the coronal CT image, H C is the second row resolution of the coronal CT image, L C_th is the second layer thickness of the coronal CT image, P C_sp is the second pixel spacing of the coronal CT image;
[0096] In getting N C , W C , H C , LC_th and P C_sp After that, the coronal CT images corresponding to the axial CT images are generated, and each axial CT image is converted into the corresponding coronal CT image to obtain the coronal CT image sequence.
[0097] Optionally, after converting the axial CT image sequence into a coronal CT image sequence, the method further includes: normalizing the image bit number of the coronal CT images to obtain a target coronal CT image sequence.
[0098] The selecting three consecutive frames of images from the coronal CT image sequence to form three channels of RGB images includes: forming three channels of RGB images from three consecutive frames of images from the target coronal CT image sequence.
[0099] In the actual implementation process, according to the image bit number B (such as 12, 16), the data is normalized to 8 bits, and IC i ( x , y ) is the axial position i The pixel value of the frame image at (x, y) corresponds to the target coronal CT image, that is, the normalized coronal CT image. MIC i ( x , y )for:
[0100]
[0101] After normalizing each frame of the coronal CT image, a target coronal CT image sequence is obtained. After obtaining the target coronal CT image sequence, three channels of RGB images are formed from three consecutive frames of the target coronal CT image sequence.
[0102] It is understandable that, drawing on the principle of visual color image perception, we start from the target coronal CT image sequence MIC Extract 3 consecutive frames of images to form a sequence ( MIC m , MIC m+1 , MIC m+2 ) The three channels that form the RGB image are recorded as ,m=3k+1,k=0,1,2,…K,where the total number of RGB images is K=Nc / 3. Since the lung parenchyma has a spatial structure and m , m+1 , m+2If there is a correlation between them, it will appear as consistency in a certain area on the RGB image, and the obtained RGB image is as follows Figure 4 shown.
[0103] Optionally, after obtaining the RGB image, the method further includes: obtaining a preset color set, wherein the color set includes a plurality of preset pixel values; for each pixel point in the RGB image, calculating the difference between the pixel point and each preset pixel value, and taking the preset pixel value corresponding to the minimum difference as the pixel value of the pixel point, to obtain a target RGB image, wherein the target RGB image is as follows: Figure 5 shown.
[0104] Correspondingly, determining the lung region according to the pixel values of the RGB image includes: determining a first lung region according to the pixel values of the target RGB image.
[0105] Understandably, in order to highlight The differences between images of different channels are divided into 10 different colors according to the visual principle. d 1, d 2,… d 10}, where D is the preset color set, d i For D{ d 1, d 2,… d 10}. Calculate and d i The color with the smallest difference is assigned a value.
[0106]
[0107] Optionally, the preset pixel value includes 0, and determining the first lung region according to the pixel value of the target RGB image includes:
[0108] The pixel values of the pixel points with pixel values of 0 in the target RGB image are modified to 255, and the pixel values of the pixel points with pixel values not equal to 0 in the target RGB image are modified to 0 to obtain a detection image; and the area composed of the pixel points with pixel values of 255 in the detection image is determined as the first lung area.
[0109] Understandably, since the lungs are full of air, The corresponding area is closer to black d 1. And the selected continuous images can reflect the spatial changes. So the changing area does not tend to d1. Therefore, the lung area can be roughly located, that is, the first lung area is recorded as U k , the CT image of the first lung area is as follows Figure 6 As shown, the corresponding pixel value is recorded as 255, and the others are set to 0.
[0110]
[0111] Optionally, after performing morphological processing and cavity filling on the first lung region, extracting the region within the lung parenchyma boundary to obtain the second lung region includes:
[0112] Using a morphological operator, first performing a dilation operation and then performing an erosion operation on the first lung region to obtain a processed region;
[0113] After processing the processing area using a hole filling algorithm, a filling area is obtained;
[0114] Performing a dilation operation on the filled area using a morphological operator to obtain a first area;
[0115] Performing an erosion operation on the filled area using a morphological operator to obtain a second area;
[0116] obtaining a lung parenchymal wall template region according to an area difference between the first region and the second region;
[0117] The pixel value of the first pixel point in the lung parenchymal wall template area is modified to the pixel value of the corresponding first target pixel point, the pixel value of the second target pixel point, and the pixel value of the third target pixel point, and the pixel values of the pixels other than the first pixel point in the lung parenchymal wall template area are modified to 0, thereby obtaining three corresponding second lung areas;
[0118] Among them, the first pixel point is a pixel point with a pixel value of 255, the first target pixel point is the first frame image selected from the three consecutive frames of images, the second target pixel point is the second frame image selected from the three consecutive frames of images, and the third target pixel point is the third frame image selected from the three consecutive frames of images.
[0119] In the actual implementation process, the morphological operator E is used to perform the first lung region U k First perform the expansion operation ⊕, then perform the corrosion operation ⊙ and record the result as A k , the parameters of expansion and corrosion calculation are 10, and the processing area A is obtained k , the CT images of the processing area are as follows Figure 7 shown.
[0120] A k =U k ⊕E⊙E
[0121] In the treated area A k After that, since the lungs are two independent regions, the two largest regions are selected as potential lung parenchyma regions, which are also target processing regions. The two target processing regions are filled with mathematical morphology algorithms to obtain the filled images, which are also called filled regions and are denoted as G. k , the CT image of the filled area is as follows Figure 8 shown.
[0122] After obtaining the filled area G k After that, a potential lung parenchymal wall template area Mask is formed k , the CT image of the lung parenchymal wall template area is as follows Figure 9 As shown, the formula is
[0123] Mask k =(G k ⊕E)-(G k ⊙E)
[0124] The pixel value of the corresponding lung parenchymal wall template area is 255, and the pixel value of other areas is 0.
[0125] After obtaining the lung parenchyma wall template area Mask k Then, Mask k Perform the following calculations to obtain the corresponding three second lung regions. The CT images of the three second lung regions are as follows: Figure 10 shown.
[0126]
[0127] in, IC m ( x , y ) are the selected 3 frames of images ( MIC m , MIC m+1 , MIC m+2 ) correspond to 3 frames of coronal CT images 。
[0128] Optionally, performing image segmentation processing on the second lung region to obtain the lung segmentation region includes: inputting the three second lung regions into a trained Unet network respectively to perform image segmentation processing to obtain the lung segmentation region.
[0129] In the actual implementation process, H m(m=3k+1, 3k+2, 3k+3) are input into the trained Unet network. A multi-scale module is added based on the Unet network to fuse information of different dimensions. The lung area segmentation is achieved through the established multi-scale Unet network, and the lung segmentation area is obtained, which is recorded as UA m , the CT images of the three lung segmentation areas are as follows Figure 11 shown.
[0130] Optionally, generating a lung parenchymal region based on the lung segmentation region and the corresponding coronal CT image includes:
[0131] After processing the lung segmentation region using a cavity filling algorithm, a lung parenchyma template region is obtained;
[0132] The pixel value of the first pixel point in the lung parenchyma template area is modified to the corresponding pixel value of the first target pixel point, the pixel value of the second target pixel point and the pixel value of the third target pixel point, and the pixel values of the pixel points other than the first pixel point in the lung parenchyma template area are modified to 0 to obtain the corresponding three lung parenchyma area images.
[0133] In the actual implementation process, the cavity filling algorithm is used to process the three lung segmentation regions respectively to obtain the lung parenchyma template regions corresponding to the three frames, which are recorded as UB. m (m=3k+1, 3k+2,3k+3);
[0134] About UB m After the following processing, three frames of lung parenchyma area images corresponding to the image are extracted, as shown in the following figure: Figure 12 shown.
[0135]
[0136] in, IC m ( x , y ) are the selected 3 frames of images ( MIC m , MIC m+1 , MIC m+2 ) correspond to 3 frames of coronal CT images 。
[0137] It should be noted that, from step 103 to step 107, the present application processes three consecutive frames of coronal CT images each time, and repeats the above steps 103 to step 107 until all images in the coronal CT image sequence are executed, and the lung parenchyma area in each frame of CT image is extracted.
[0138] The embodiment of the present application provides a lung parenchyma extraction method based on CT images, which obtains an axial CT image sequence; converts the axial CT image sequence into a coronal CT image sequence; selects three consecutive frames of images from the coronal CT image sequence to form three channels of an RGB image to obtain an RGB image; determines a first lung region based on the pixel values of the RGB image; performs morphological processing and cavity filling on the first lung region, extracts the region within the lung parenchyma boundary to obtain a second lung region; performs image segmentation processing on the second lung region to obtain a lung segmentation region; generates a lung parenchyma region based on the lung segmentation region and the corresponding coronal CT image. The present application detects the lung parenchyma by generating a coronal image from an axial position, and obtains an RGB image through a multi-channel data synthesis algorithm to obtain local 3D information. Furthermore, based on visual perception, a color mapping mechanism is proposed to focus on the area where the lungs are located, which can improve the accuracy of lung parenchyma region extraction.
[0139] The present application also provides a lung parenchyma extraction device based on CT images, such as Figure 13 As shown, the device includes:
[0140] An acquisition module 11 is used to acquire an axial CT image sequence;
[0141] A conversion module 12, configured to convert the axial CT image sequence into a coronal CT image sequence;
[0142] The processing module 13 is configured to select three consecutive frames of images from the coronal CT image sequence to form three channels of an RGB image, thereby obtaining an RGB image; determine a first lung region based on pixel values of the RGB image; perform morphological processing and cavity filling on the first lung region, and then extract an area within the lung parenchyma boundary to obtain a second lung region; perform image segmentation processing on the second lung region to obtain a lung segmentation region; and generate a lung parenchyma region based on the lung segmentation region and the corresponding coronal CT image.
[0143] In one embodiment, the conversion module 12 is specifically configured to:
[0144] Obtain the first row resolution, first column resolution, first slice thickness, first slice spacing, first pixel spacing, and total number of axial sequences of axial CT images;
[0145] determining the number of images of the coronal CT image according to the first row resolution;
[0146] determining a second column resolution of the coronal CT image according to the first column resolution;
[0147] determining a second row resolution of the coronal CT image according to the total number of axial sequences, the first slice thickness, and the first pixel spacing;
[0148] determining a second layer thickness of the coronal CT image according to the first pixel spacing;
[0149] determining a second pixel spacing of the coronal CT image according to the first slice spacing;
[0150] A coronal CT image sequence is generated according to the number of images, the second column resolution, the second row resolution, the second slice thickness, and the second pixel spacing.
[0151] In one embodiment, the conversion module 12 is further configured to:
[0152] After normalizing the image bit number of the coronal CT image, a target coronal CT image sequence is obtained;
[0153] The processing module 13 is further configured to:
[0154] Three channels of RGB images are formed from three consecutive frames of the target coronal CT image sequence.
[0155] In one embodiment, the processing module 13 is further configured to:
[0156] Obtaining a preset color set, wherein the color set includes a plurality of preset pixel values;
[0157] For each pixel in the RGB image, calculating the difference between the pixel and each preset pixel value, taking the preset pixel value corresponding to the minimum difference as the pixel value of the pixel, and obtaining the target RGB image;
[0158] Determining the lung area according to the pixel values of the RGB image includes:
[0159] A first lung region is determined according to pixel values of the target RGB image.
[0160] In one embodiment, the processing module 13 is specifically configured to:
[0161] Modify the pixel values of the pixel points with pixel values of 0 in the target RGB image to 255, and modify the pixel values of the pixel points with pixel values not equal to 0 in the target RGB image to 0, to obtain a detection image;
[0162] An area consisting of pixels with a pixel value of 255 in the detection image is determined as the first lung area.
[0163] In one embodiment, the processing module 13 is specifically configured to:
[0164] Using a morphological operator, first performing a dilation operation and then performing an erosion operation on the first lung region to obtain a processed region;
[0165] After processing the processing area using a hole filling algorithm, a filling area is obtained;
[0166] Performing a dilation operation on the filled area using a morphological operator to obtain a first area;
[0167] Performing an erosion operation on the filled area using a morphological operator to obtain a second area;
[0168] obtaining a lung parenchymal wall template region according to an area difference between the first region and the second region;
[0169] The pixel value of the first pixel point in the lung parenchymal wall template area is modified to the pixel value of the corresponding first target pixel point, the pixel value of the second target pixel point, and the pixel value of the third target pixel point, and the pixel values of the pixels other than the first pixel point in the lung parenchymal wall template area are modified to 0, thereby obtaining three corresponding second lung areas;
[0170] Among them, the first pixel point is a pixel point with a pixel value of 255, the first target pixel point is the first frame image selected from the three consecutive frames of images, the second target pixel point is the second frame image selected from the three consecutive frames of images, and the third target pixel point is the third frame image selected from the three consecutive frames of images.
[0171] In one embodiment, the processing module 13 is specifically configured to:
[0172] The three second lung regions are respectively input into the trained Unet network for image segmentation processing to obtain lung segmentation regions.
[0173] In one embodiment, the processing module 13 is specifically configured to:
[0174] After processing the lung segmentation region using a cavity filling algorithm, a lung parenchyma template region is obtained;
[0175] The pixel value of the first pixel point in the lung parenchyma template area is modified to the corresponding pixel value of the first target pixel point, the pixel value of the second target pixel point and the pixel value of the third target pixel point, and the pixel values of the pixel points other than the first pixel point in the lung parenchyma template area are modified to 0 to obtain the corresponding three lung parenchyma area images.
[0176] The CT image-based lung parenchyma extraction device provided in the embodiment of the present application can execute the above-mentioned CT image-based lung parenchyma extraction method embodiment. Its implementation principle and technical effects are similar and will not be elaborated here.
[0177] For the specific definition of the lung parenchyma extraction device based on CT images, please refer to the definition of the lung parenchyma extraction method based on CT images above, which will not be repeated here. The various modules in the above-mentioned lung parenchyma extraction device based on CT images can be implemented in whole or in part by software, hardware and their combination. The above-mentioned modules can be embedded in or independent of the processor of the electronic device in the form of hardware, or can be stored in the memory of the electronic device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0178] The execution entity of the lung parenchyma extraction method based on CT images provided in the embodiment of the present application can be an electronic device, which can be a controller, a processor, a processing chip, a computer device, a terminal device, a server or a server cluster. The embodiment of the present application does not make any specific restrictions on this.
[0179] Figure 14 This is a schematic diagram of the internal structure of an electronic device provided in an embodiment of the present application. Figure 14 As shown, the electronic device includes a processor and a memory connected via a system bus. The processor is used to provide computing and control capabilities. The memory may include a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The computer program can be executed by the processor to implement the steps of the CT image-based lung parenchyma extraction method provided in each of the above embodiments. The internal memory provides a high-speed cache operating environment for the operating system and computer program in the non-volatile storage medium.
[0180] Those skilled in the art will understand that Figure 14 The internal structure diagram of the electronic device shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the electronic device to which the solution of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0181] In another embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the lung parenchyma extraction method based on CT images as in the embodiment of the present application are implemented.
[0182] In another embodiment of the present application, a computer program product is also provided, which includes computer instructions. When the computer instructions are run on a lung parenchyma extraction device based on CT images, the lung parenchyma extraction device based on CT images executes each step of the lung parenchyma extraction method based on CT images in the method flow shown in the above method embodiment.
[0183] In the above embodiments, all or part of the embodiments can be implemented using software, hardware, firmware, or any combination thereof. When implemented using a software program, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer-executable instructions are loaded and executed on a computer, all or part of the processes or functions according to the embodiments of the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more servers that can be integrated with the medium. The available media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, solid state disks (SSDs)).
[0184] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0185] The above embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A lung parenchyma extraction method based on CT images, characterized in that: The method comprises: Acquire axial CT image sequences; converting the axial CT image sequence into a coronal CT image sequence; Selecting three consecutive frames of images from the coronal CT image sequence to form three channels of an RGB image, thereby obtaining an RGB image; determining a first lung region according to pixel values of the RGB image; After performing morphological processing and cavity filling on the first lung region, the region within the lung parenchyma boundary is extracted to obtain a second lung region; After performing image segmentation processing on the second lung region, a lung segmentation region is obtained; generating a lung parenchymal region based on the lung segmentation region and the corresponding coronal CT image; After performing morphological processing and cavity filling on the first lung region, extracting the region within the lung parenchyma boundary to obtain the second lung region includes: Using a morphological operator, first performing a dilation operation and then performing an erosion operation on the first lung region to obtain a processed region; After selecting two target processing areas from the processing area, the target processing areas are processed using a hole filling algorithm to obtain a filling area; Performing a dilation operation on the filled area using a morphological operator to obtain a first area; Performing an erosion operation on the filled area using a morphological operator to obtain a second area; obtaining a lung parenchymal wall template region according to an area difference between the first region and the second region; The pixel value of the first pixel point in the lung parenchymal wall template area is modified to the pixel value of the corresponding first target pixel point, the pixel value of the second target pixel point, and the pixel value of the third target pixel point, and the pixel values of the pixels other than the first pixel point in the lung parenchymal wall template area are modified to 0, thereby obtaining three corresponding second lung areas; The first pixel point is a pixel point with a pixel value of 255, the first target pixel point is the first frame image selected from three consecutive frames of images, the second target pixel point is the second frame image selected from three consecutive frames of images, and the third target pixel point is the third frame image selected from three consecutive frames of images; Generating a lung parenchyma region based on the lung segmentation region and the corresponding coronal CT image includes: After processing the lung segmentation region using a cavity filling algorithm, a lung parenchyma template region is obtained; The pixel value of the first pixel point in the lung parenchyma template area is modified to the corresponding pixel value of the first target pixel point, the pixel value of the second target pixel point and the pixel value of the third target pixel point, and the pixel values of the pixel points other than the first pixel point in the lung parenchyma template area are modified to 0 to obtain the corresponding three lung parenchyma area images.
2. The method according to claim 1, characterized in that The converting of the axial CT image sequence into a coronal CT image sequence comprises: Obtain the first row resolution, first column resolution, first slice thickness, first slice spacing, first pixel spacing, and total number of axial sequences of axial CT images; determining the number of images of the coronal CT image according to the first row resolution; determining a second column resolution of the coronal CT image according to the first column resolution; determining a second row resolution of the coronal CT image according to the total number of axial sequences, the first slice thickness, and the first pixel spacing; determining a second layer thickness of the coronal CT image according to the first pixel spacing; determining a second pixel spacing of the coronal CT image according to the first slice spacing; A coronal CT image sequence is generated according to the number of images, the second column resolution, the second row resolution, the second slice thickness, and the second pixel spacing.
3. The method according to claim 1, characterized in that After converting the axial CT image sequence into a coronal CT image sequence, the method further comprises: normalizing the image bit number of the coronal CT images to obtain a target coronal CT image sequence; The selecting three consecutive frames of images from the coronal CT image sequence to form three channels of RGB images includes: forming three channels of RGB images from three consecutive frames of images from the target coronal CT image sequence.
4. The method according to claim 3, characterized in that After obtaining the RGB image, the method further includes: Obtaining a preset color set, wherein the color set includes a plurality of preset pixel values; For each pixel in the RGB image, calculating the difference between the pixel and each preset pixel value, taking the preset pixel value corresponding to the minimum difference as the pixel value of the pixel, and obtaining the target RGB image; Determining the lung area according to the pixel values of the RGB image includes: A first lung region is determined according to pixel values of the target RGB image.
5. The method according to claim 4, characterized in that The preset pixel value includes 0, and determining the first lung region according to the pixel value of the target RGB image includes: Modify the pixel values of the pixel points with pixel values of 0 in the target RGB image to 255, and modify the pixel values of the pixel points with pixel values not equal to 0 in the target RGB image to 0, to obtain a detection image; An area consisting of pixels with a pixel value of 255 in the detection image is determined as the first lung area.
6. The method according to claim 1, characterized in that After performing image segmentation processing on the second lung region, a lung segmentation region is obtained, including: The three second lung regions are respectively input into the trained Unet network for image segmentation processing to obtain lung segmentation regions.
7. A lung parenchyma extraction device based on CT images, characterized in that: The device comprises: An acquisition module, used for acquiring axial CT image sequences; a conversion module, configured to convert the axial CT image sequence into a coronal CT image sequence; a processing module configured to select three consecutive frames of images from the coronal CT image sequence to form three channels of an RGB image, thereby obtaining an RGB image; determine a first lung region based on pixel values of the RGB image; perform morphological processing and cavity filling on the first lung region, thereby extracting an area within the lung parenchyma boundary, thereby obtaining a second lung region; perform image segmentation processing on the second lung region, thereby obtaining a lung segmentation region; and generate a lung parenchyma region based on the lung segmentation region and the corresponding coronal CT image; The processing module is specifically used to: use a morphological operator to first perform an expansion operation on the first lung area, and then perform an erosion operation to obtain a processing area; after selecting two target processing areas from the processing area, use a hole filling algorithm to process the target processing areas to obtain a filling area; use a morphological operator to perform an expansion operation on the filling area to obtain a first area; use a morphological operator to perform an erosion operation on the filling area to obtain a second area; obtain a lung parenchymal wall template area based on the area difference between the first area and the second area; modify the pixel value of the first pixel point in the lung parenchymal wall template area to the pixel value of the corresponding first target pixel point, the pixel value of the second target pixel point and the pixel value of the third target pixel point, and modify the pixel values of the pixels in the lung parenchymal wall template area other than the first pixel point to 0 to obtain three corresponding second lung areas; wherein the first pixel point is a pixel point with a pixel value of 255, the first target pixel point is the first frame image selected from 3 consecutive frames of images, the second target pixel point is the second frame image selected from 3 consecutive frames of images, and the third target pixel point is the third frame image selected from 3 consecutive frames of images; The processing module is specifically used to: obtain a lung parenchyma template area after processing the lung segmentation area using a hole filling algorithm; modify the pixel value of the first pixel point in the lung parenchyma template area to the corresponding pixel value of the first target pixel point, the pixel value of the second target pixel point and the pixel value of the third target pixel point, and modify the pixel values of the pixel points in the lung parenchyma template area other than the first pixel point to 0, to obtain three corresponding lung parenchyma area images.
8. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the method for extracting lung parenchyma based on CT images according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Pulmonary nodule segmentation method based on average intensity projection and translation gaussian model
CN102360495A
Stomach CT image lymph gland recognition system and method based on low-rank decomposition
CN103839048A