CT image processing method and device, electronic equipment and storage medium
By using preset segmentation thresholds and watershed algorithms in CT image processing, the bed board area is progressively removed, which solves the problem of difficulty in removing the bed board when it is connected to human tissue, and improves the bed board removal accuracy and imaging quality of CT images.
Patent Information
- Application Number
- CN202410565323.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-08
- Publication Date
- 2024-09-17
AI Technical Summary
Existing CT image processing technology is difficult to accurately identify and remove bed boards, especially when the bed boards are connected to human tissue, which affects the accuracy of imaging results.
The CT image segmentation method based on preset segmentation thresholds is used, and the watershed algorithm combined with two-dimensional morphological operations and distance transformation is used to progressively remove the bed board area and improve the removal accuracy.
It effectively separates the body area from the adhering bed board area, improves the accuracy of bed board removal in CT images, and improves the quality of imaging results.
Smart Images

Figure CN118657708A
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a CT image processing method, device, electronic device and storage medium. Background Art
[0002] In computer tomography (CT) imaging technology, since the density of the bed board is similar to that of some human tissues (such as bones), it is easy to reconstruct the bed board in applications such as 3D volume rendering and maximum density projection, which blocks effective anatomical information and affects the accuracy of the imaging results. Therefore, it is necessary to remove the bed board from the CT image.
[0003] The current automatic bed board removal method mainly involves first automatically identifying the bed board in the CT image, that is, accurately locating the bed board on the image, which requires statistics on the actual physical properties of the bed board (such as length, width, thickness, etc.); secondly, completely removing the bed board from the CT image. However, according to investigations, due to the fact that the physical properties of the bed board (including length, shape and thickness, etc.) in the CT images collected by different hospitals are somewhat different, and there are cases where the bed board is connected to human tissue in the CT image, it is difficult to accurately identify and completely remove the bed board. Summary of the invention
[0004] The present application provides a CT image processing method, device, electronic device and storage medium, which can effectively separate the body area and the bed board area adhered to the body, and improve the accuracy of bed board removal in CT images.
[0005] In a first aspect, a CT image processing method is provided, comprising:
[0006] Segmenting the CT image based on a preset segmentation threshold to obtain an initial three-dimensional foreground image including a body region and a bed board region, wherein the bed board region includes a first bed board region whose contact area with the body region is less than a preset area threshold, and a second bed board region whose contact area with the body region is greater than or equal to the preset area threshold;
[0007] Filling the holes in the body area in the initial three-dimensional foreground image to obtain a first three-dimensional foreground image;
[0008] Removing the first bed board area in the first three-dimensional foreground image by two-dimensional morphological operation, and removing the second bed board area in the first three-dimensional foreground image by a watershed algorithm based on distance transform, so as to obtain a second three-dimensional foreground image;
[0009] A maximum connected domain analysis is performed in the second three-dimensional foreground image to obtain the body region after removing the bed board region.
[0010] In a second aspect, a CT image processing device is provided, comprising:
[0011] a segmentation module, configured to segment the CT image based on a preset segmentation threshold value to obtain an initial three-dimensional foreground image including a body region and a bed board region, wherein the bed board region includes a first bed board region whose contact area with the body region is less than a preset area threshold value, and a second bed board region whose contact area with the body region is greater than or equal to the preset area threshold value;
[0012] A filling module, used for filling the holes in the body area in the initial three-dimensional foreground image to obtain a first three-dimensional foreground image;
[0013] A removal module, used to remove the first bed board area in the first three-dimensional foreground image through two-dimensional morphological operation, and to remove the second bed board area in the first three-dimensional foreground image through a watershed algorithm based on distance transformation, so as to obtain a second three-dimensional foreground image;
[0014] The analysis module is used to perform maximum connected domain analysis in the second three-dimensional foreground image to obtain the body area after removing the bed board area.
[0015] According to a third aspect, an electronic device is provided, comprising: a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the method in the first aspect or its various implementations.
[0016] According to a fourth aspect, a computer-readable storage medium is provided for storing a computer program, wherein the computer program enables a computer to execute the method according to the first aspect or its various implementations.
[0017] Through the technical solution provided by the present application, after acquiring a CT image, the CT image can be segmented based on a preset segmentation threshold to obtain an initial three-dimensional foreground image including a body area, a first bed board area with less contact with the body area, and a second bed board area with more contact with the body area; then the holes of the body area in the initial three-dimensional foreground image are filled to obtain a first three-dimensional foreground image; the first bed board area in the first three-dimensional foreground image is removed by two-dimensional morphological operation, and the second bed board area in the first three-dimensional foreground image is removed by a watershed algorithm based on distance transformation to obtain a second three-dimensional foreground image; finally, a maximum connected domain analysis is performed in the second three-dimensional foreground image to obtain the body area after the bed board area is removed. The technical solution in the present application, in view of the situation where the bed board is connected to human tissue, first performs a two-dimensional morphological operation to remove the bed board area with little adhesion to the body, and then uses the watershed algorithm of distance transformation to remove the bed board area with a lot of adhesion to the body. Through this progressive bed board removal method, the body area and the bed board area adhered to the body can be effectively separated, and the accuracy of bed board removal in CT images can be improved.
[0018] It should be understood that the above general description and the following detailed description are only exemplary and explanatory and cannot limit the present application. Other features and advantages of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0020] Figure 1 An application scenario diagram provided for an embodiment of the present application;
[0021] Figure 2 A schematic diagram of a flow chart of a CT image processing method provided in an embodiment of the present application;
[0022] Figure 3 A schematic flow chart of a CT image processing method provided in another embodiment of the present application;
[0023] Figure 4 A schematic diagram of a transformation of a first three-dimensional foreground image provided in an embodiment of the present application;
[0024] Figure 5 A schematic diagram of performing a two-dimensional morphological operation and grayscale transformation on a first three-dimensional foreground image provided in an embodiment of the present application;
[0025] Figure 6 A schematic diagram of a body area after removing the bed board area provided in an embodiment of the present application;
[0026] Figure 7 A schematic diagram of the structure of a CT image processing device provided in an embodiment of the present application;
[0027] Figure 8 A schematic diagram of the structure of a CT image processing device provided in another embodiment of the present application;
[0028] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0031] The current automatic bed board removal method mainly involves first automatically identifying the bed board in the CT image, that is, accurately locating the bed board on the image, which requires statistics on the actual physical properties of the bed board (such as length, width, thickness, etc.); secondly, completely removing the bed board from the CT image. However, according to investigations, due to the fact that the physical properties of the bed board (including length, shape and thickness, etc.) in the CT images collected by different hospitals are somewhat different, and there are cases where the bed board is connected to human tissue in the CT image, it is difficult to accurately identify and completely remove the bed board.
[0032] In order to solve the above technical problems, the inventive concept of the present invention is: according to the maximum inter-class variance method, the segmentation threshold is found, the original CT three-dimensional image is binarized, and the holes in the body are filled to obtain a foreground area, which includes the body area and the bed board area that is adhered to the body area. For the bed board area that is adhered to the body, a two-dimensional morphological operation is first performed to remove the bed board area that is less adhered to the body. Then, a watershed algorithm based on distance transformation is used to remove the bed board area that is much adhered to the body. Finally, the maximum connected region analysis is used to obtain the final body area. The technical solution in this application, for the case where the bed board is connected to the human tissue, firstly performs a two-dimensional morphological operation to remove the bed board area that is less adhered to the body, and then uses the watershed algorithm based on distance transformation to remove the bed board area that is much adhered to the body. Through this progressive bed board removal method, the body area and the bed board area that is adhered to the body can be effectively separated, and the accuracy of bed board removal in CT images can be improved.
[0033] It should be understood that the technical solution of the present invention can be applied to the following scenarios, but is not limited to:
[0034] In some possible implementations, Figure 1 An application scenario diagram provided by an embodiment of the present invention, such as Figure 1 As shown, the application scenario may include an electronic device 110 and a network device 120. The electronic device 110 may establish a connection with the network device 120 via a wired network or a wireless network.
[0035] Exemplarily, the electronic device 110 may be a desktop computer, a laptop computer, a tablet computer, etc., but is not limited thereto. The network device 120 may be a terminal device or a server, but is not limited thereto. In one embodiment of the present invention, the electronic device 110 may send a request message to the network device 120, and the request message may be used to request to obtain the segmentation result of the CT image with respect to the body area and the bed board area. Further, the electronic device 110 may receive a response message sent by the network device 120, and the response message includes the segmentation result of the CT image with respect to the body area and the bed board area.
[0036] also, Figure 1 An electronic device 110 and a network device 120 are provided as an example, but other numbers of electronic devices and network devices may be included in practice, and the present invention is not limited thereto.
[0037] In some other possible implementations, the technical solution of the present invention may also be executed by the above-mentioned electronic device 110, or the technical solution of the present invention may also be executed by the above-mentioned network device 120, and the present invention does not limit this.
[0038] After introducing the application scenarios of the embodiments of the present invention, the technical solutions of the present invention will be described in detail below:
[0039] Figure 2 A flowchart of a CT image processing method provided by an embodiment of the present invention, the method can be as follows Figure 1 The electronic device 110 shown in the figure performs, but is not limited to this. Figure 2 As shown, the method may include the following steps:
[0040] Step 210: Segment the CT image based on a preset segmentation threshold to obtain an initial three-dimensional foreground image including a body area and a bed area.
[0041] Among them, the CT image may be a CT scan sequence image, which is a continuous tomographic image obtained by computed tomography (CT) technology. These images are displayed in the form of continuous slices, each slice representing a cross-sectional view of the body structure on a specific plane. CT scanning is a medical imaging technology that uses X-rays and computer technology to generate images of the internal structure of the body. During the CT scan, the X-ray source rotates around the patient, and the detector records the intensity of the X-rays passing through the patient's body. Since different tissues absorb X-rays to different degrees, the detector can record these differences and convert them into digital signals. The computer then reconstructs these digital signals into a two-dimensional image, namely a CT image.
[0042] In the following embodiment steps of the present disclosure, the image of the body area that does not include the bed can be extracted from the CT image by processing the CT image. The preset segmentation threshold is the segmentation threshold for binarizing the CT image, and the segmentation threshold is the value that divides the CT image into two areas (black and white). Binarization is a process of converting an image into only two colors (black and white). Specifically, in the CT image, pixels with pixel values higher than the preset segmentation threshold can be set to white, and pixels with pixel values lower than the preset segmentation threshold can be set to black. The area corresponding to the white pixel value is the foreground area where the body area and the bed board area are located, and the area corresponding to the black pixel value is the background area that does not include the body area and the bed board area.
[0043] In CT imaging technology, since the density of the bed board is similar to that of some human tissues (such as bones), it is easy to reconstruct the bed board in applications such as three-dimensional volume rendering and maximum density projection, which blocks effective anatomical information and affects the accuracy of the imaging results. Correspondingly, the bed board area includes a first bed board area that has less contact with the body area, and a second bed board area that has more contact with the body area. In a specific application scenario, in order to define the first bed board area and the second bed board area, a preset area threshold can be set, and the bed board area whose contact area with the body area is less than the preset area threshold is determined as the first bed board area, and the bed board area whose contact area with the body area is greater than or equal to the preset area threshold is determined as the second bed board area. Among them, the specific value of the preset area threshold can be set according to the actual application scenario, and is not specifically limited here.
[0044] Step 220: Fill the holes in the body area in the initial three-dimensional foreground image to obtain a first three-dimensional foreground image.
[0045] Holes in the body region in the initial 3D foreground image refer to the low-density images of certain areas inside the body due to various reasons during the CT scanning process, which appear as hollow structures in the 3D image. These holes may be caused by low pixel values (such as the lung area) or by the absence or absorption of substances such as gas, liquid, soft tissue or bone. Holes usually appear as black or dark areas in CT images, with obvious density differences from the surrounding tissues. They may appear in different parts of the body such as the lungs, liver, kidneys, bones, etc., with different shapes and sizes. In specific application scenarios, holes may affect the quality of the image, such as causing dark or bright areas in the image, thereby affecting subsequent image processing and analysis. By filling holes, the quality of the image can be improved, making it clearer and easier to analyze; holes may cause errors in image processing and analysis. For example, in segmentation and measurement, holes may be mistaken for other structures, resulting in incorrect segmentation and measurement results. By filling the holes, these errors can be avoided and the accuracy of the analysis can be improved; in addition, holes may affect the visualization of the image, for example, in 3D reconstruction, holes may cause incomplete or incoherent structures in the image. By filling the holes, the visualization of the image can be improved, making it more complete and coherent.
[0046] Step 230 : remove the first bed board area in the first three-dimensional foreground image through two-dimensional morphological operation, and remove the second bed board area in the first three-dimensional foreground image through a watershed algorithm based on distance transform, so as to obtain a second three-dimensional foreground image.
[0047] Among them, the two-dimensional morphological operation can process the first three-dimensional foreground image by means of corrosion, expansion, opening operation and closing operation, so as to remove the first bed board area that is not in contact with the body or has little adhesion to the body. Specifically, the shape and structure of the image can be changed by morphological processing on the first three-dimensional foreground image to make it clearer and easier to analyze; the watershed algorithm based on distance transformation can remove the bed board area in contact with the body in the first three-dimensional foreground image because it can segment and classify the image, thereby separating the bed board area from other areas.
[0048] Specifically, the watershed algorithm based on distance transformation can remove the bed area in any of the following ways:
[0049] 1. Distance transformation: Distance transformation can calculate the distance from each pixel in the first three-dimensional foreground image to the nearest zero pixel, thereby separating the object and the background in the first three-dimensional foreground image.
[0050] 2. Watershed algorithm: The watershed algorithm can divide the image into multiple areas, thereby separating the bed area from other areas.
[0051] 3. Combination of distance transform and watershed algorithm: By combining distance transform and watershed algorithm, the bed board area can be removed more accurately. Specifically, the image can be distance transformed first, and then the watershed algorithm can be applied to it to separate the bed board area from other areas.
[0052] In the following embodiment steps of the present disclosure, the removal of the second bed board area in the first three-dimensional foreground image based on the combination of distance transformation and watershed algorithm is taken as an example to illustrate the technical solution of the present disclosure, but it does not constitute a specific limitation.
[0053] Step 240: Perform maximum connected domain analysis in the second three-dimensional foreground image to obtain the body region after removing the bed board region.
[0054] Among them, the maximum connected domain analysis is an image processing method that can be used to extract the largest connected region from an image. In the second three-dimensional foreground image, the maximum connected domain usually corresponds to the main part of the body, that is, the body area, so the image can be subjected to the maximum connected domain analysis to extract the body area after removing the bed board area.
[0055] For the disclosed embodiment, the connected domain analysis can be performed on the second three-dimensional foreground image by using a connected domain labeling algorithm or other methods to find out all connected regions in the second three-dimensional foreground image. Then, among all the connected regions, the connected domain with the largest area, i.e., the maximum connected domain, can be found by using area statistics or other methods. The maximum connected domain is determined as the body region after removing the bed board region.
[0056] In summary, according to the CT image processing method provided by the present invention, after acquiring the CT image, the CT image can be segmented based on a preset segmentation threshold to obtain an initial three-dimensional foreground image including a body area, a first bed board area with less contact with the body area, and a second bed board area with more contact with the body area; then the holes of the body area in the initial three-dimensional foreground image are filled to obtain a first three-dimensional foreground image; and the first bed board area in the first three-dimensional foreground image is removed by two-dimensional morphological operation, and the second bed board area in the first three-dimensional foreground image is removed by a watershed algorithm based on distance transformation to obtain a second three-dimensional foreground image; finally, the maximum connected domain analysis is performed in the second three-dimensional foreground image to obtain the body area after the bed board area is removed. The technical solution in the present application, in view of the situation where the bed board is connected to the human tissue, first performs a two-dimensional morphological operation to remove the bed board area with little adhesion to the body, and then uses the watershed algorithm of distance transformation to remove the bed board area with a lot of adhesion to the body. Through this progressive bed board removal method, the body area and the bed board area adhered to the body can be effectively separated, and the accuracy of bed board removal in the CT image can be improved.
[0057] based on Figure 2 The embodiment shown is a refinement and extension of the above embodiment. In order to fully illustrate the specific implementation process of the method of this embodiment, this embodiment provides the following Figure 3 The specific method shown. Figure 3 based on Figure 2 As shown in 3, the method comprises the following steps:
[0058] Step 310: Segment the CT image based on a preset segmentation threshold to obtain an initial three-dimensional foreground image including a body area and a bed area.
[0059] The bed board area includes a first bed board area whose contact area with the body area is less than a preset area threshold, and a second bed board area whose contact area with the body area is greater than or equal to the preset area threshold.
[0060] In a specific application scenario, before executing the steps of this embodiment, a preset segmentation threshold can be found according to the maximum inter-class variance method, and the original CT image can be binarized based on the preset segmentation threshold to obtain an initial three-dimensional foreground image. Accordingly, the steps of the embodiment can also include: determining the preset segmentation threshold corresponding to the CT image based on the maximum inter-class variance formula;
[0061] Among them, the formula characteristics of the maximum inter-class variance formula are described as follows:
[0062]
[0063] In the formula, σ is the inter-class variance value, P1 is the probability that any pixel in the CT image belongs to the foreground area, P2 is the probability that any pixel in the CT image belongs to the background area, m1 is the pixel mean of all foreground pixels in the CT image, m2 is the pixel mean of all background pixels in the CT image, and mG is the pixel mean of all pixels in the CT image. Specifically, the inter-class variance value σ that maximizes the above formula can be determined as the preset segmentation threshold T_seg.
[0064] For the embodiment of the present disclosure, when the CT image is segmented based on the preset segmentation threshold, each pixel point x in the CT image may be segmented using the preset segmentation threshold T_seg, and the obtained f(x) is the mask value of the pixel point x:
[0065]
[0066] After the above transformation, the area where f(x) is 0 is the background area. Connected domain analysis is performed on all pixels where f(x) is 1 to obtain the largest connected area, which is the foreground area. It consists of two parts: one part is the body area, which has many small holes and is an area with low pixel values (such as the lung area); the other part is the bed board area that is attached to the body.
[0067] Step 320: Expand the background pixels of the first mask image corresponding to the initial three-dimensional foreground image to obtain an expanded image containing the complete body area.
[0068] For the disclosed embodiment, the background pixel points of the first mask image corresponding to the initial three-dimensional foreground image can be expanded. Specifically, a preset number of pixels can be expanded in each of the three directions of length, width and height of the first mask image, and the pixel value is set to 0, that is, the background value, to obtain an expanded image. The preset number can be set according to the actual application scenario, such as being set to 1, that is, 1 pixel is expanded in each of the three directions of length, width and height of the first mask image, and the pixel value is set to 0. The purpose of expanding the background pixel points of the first mask image is to make the body area appear in the image as being completely wrapped by the background area, so as to facilitate the connected domain analysis and extraction of the body area.
[0069] Step 330: use any pixel point in the background area of the expanded image as a seed point to perform three-dimensional region growth to obtain a second mask image, and invert the mask value of the second mask image to obtain a first three-dimensional foreground image after hole filling.
[0070] Among them, in the second mask image, the mask value of the background area is 1, and the mask value of the remaining area is 0; in the first three-dimensional foreground image, the mask value of the background area is 0, and the mask value of the remaining area is 1.
[0071] 3D Region Growing is an image processing technique that is used to grow groups of pixels or volume elements (voxels) into larger three-dimensional regions. In 3D region growing, the algorithm starts with one or more seed points, and then gradually merges adjacent pixels or voxels that have similar properties (such as intensity, grayscale, color, texture, etc.) to these seed points into the same region. This process continues until there are no more similar pixels or voxels that can be merged, or a preset stop condition is reached. For the disclosed embodiment, any pixel point in the background area of the expanded image can be found on the further obtained expanded image, and it can be used as a seed point for 3D region growing to obtain a second mask image. In the second mask image, the mask value of the background area is 1, and the mask value of the remaining area is 0. The hole to be filled is not in the background area, so the value is 0. Furthermore, the mask value of the second mask image can be inverted to obtain the first three-dimensional foreground image g(x). In the first three-dimensional foreground image g(x), the mask value of the background area is 0, the mask values of the rest are 1, the value of the holes to be filled is 1, and each pixel x is set to obtain the mask image with the holes filled.
[0072]
[0073] The above two steps, such as Figure 4 As shown in the figure: the first one is the original CT image, the second one is the initial 3D foreground image obtained by binarizing the CT image, and the third one is the first 3D foreground image obtained after filling the holes in the body area.
[0074] Step 340: remove the first bed board area in the first three-dimensional foreground image through two-dimensional morphological operation, and remove the second bed board area in the first three-dimensional foreground image through a watershed algorithm based on distance transform, so as to obtain a second three-dimensional foreground image.
[0075] For the disclosed embodiment, when removing the first bed board area in the first three-dimensional foreground image through two-dimensional morphological operation, each slice image in the first three-dimensional foreground image may be subjected to two-dimensional corrosion processing respectively. The corrosion processing may use a kernel of (5,5), mainly to remove the bed board area that is less attached to the body. After the two-dimensional corrosion operation is performed on all layers, the eroded mask image g_erode(x) is obtained. This operation may remove part of the outer layer area such as the body skin. Then, the eroded mask image g_erode(x) may be subjected to two-dimensional dilation processing. The dilation processing may use a kernel of (3,3) to dilate back the part of the outer layer area such as the body skin removed in the first step. After the two-dimensional dilation operation is performed on all layers, the dilated mask image g_dilate(x) is obtained. Accordingly, the embodiment steps may include: performing two-dimensional corrosion processing and two-dimensional dilation processing on each slice image in the first three-dimensional foreground image in turn to remove the first bed board area in the first three-dimensional foreground image.
[0076] In a specific application scenario, two-dimensional morphological operations can be used to remove the bed board area that is less adhered to the body, but some slices contain bed board areas that are more adhered to the body and have not been removed. It is also necessary to perform distance transformation on each slice image in the expanded mask image g_dilate(x). Calculate the distance from each non-zero pixel to the nearest zero point, that is, the shortest distance to all non-zero points, and obtain a distance transformed grayscale image g_distance(x). Find the local maximum point set P = (p1, p2, ..., p k ), these k points are used as initial marking points. Then, the watershed algorithm can be operated based on these k initial marking points. Assume that k holes are made on the k marking points, and water is allowed to rise through the holes at a uniform speed, flooding various terrains from low to high. When the rising water in different catchment basins gathers, a dam is built to prevent this aggregation. The boundaries of these dams correspond to the segmentation lines of the watershed, that is, the boundaries extracted by the watershed algorithm. The multiple catchment basins starting from these k initial marking points become larger and larger in the process of growth. A threshold value T_watershed is set. Pixels smaller than the threshold value T_watershed are flooded, and pixels larger than the threshold value T_watershed intersect with the dam and are disconnected from the dam, that is, the body area and the bed board area that are adhered a lot are disconnected, and the separated body area and bed board area are obtained, that is, the second three-dimensional foreground image is obtained.
[0077] Accordingly, for the embodiment of the present disclosure, when removing the second bed board area in the first three-dimensional foreground image by using a watershed algorithm based on distance transformation, the embodiment steps may include: determining multiple initial marking points in the first three-dimensional foreground image; calculating the shortest distance from each pixel point in the first three-dimensional foreground image to the nearest marking point among the multiple initial marking points, and generating a distance transformation image based on the shortest distance; based on the distance transformation image, applying the watershed algorithm to segment the second bed board area in the first three-dimensional foreground image.
[0078] Correspondingly, when determining multiple initial marking points in the first three-dimensional foreground image, the implementation steps may include: performing distance transformation on each layer of slice image in the first three-dimensional foreground image to obtain a grayscale image after distance transformation; performing local maximum value extraction in a preset range area of the grayscale image to obtain multiple initial marking points.
[0079] This step diagram is as follows Figure 5 As shown: the first figure is the mask image g_dilate(x) obtained after morphological erosion and expansion operations, and the second figure is the grayscale image g_distance(x) obtained by performing distance transformation on the mask image g_dilate(x), that is, the second three-dimensional foreground image.
[0080] Step 350: Perform maximum connected domain analysis in the second three-dimensional foreground image to obtain the body region after removing the bed board region.
[0081] For the embodiments of the present disclosure, Figure 6 As shown, the second three-dimensional foreground image g_distance(x) obtained in step 350 of the embodiment can be subjected to a three-dimensional maximum connected region analysis to obtain a connected region, that is, the body region after the bed board is removed. Accordingly, the embodiment steps may include: conducting a connected region analysis on the second three-dimensional foreground image to obtain at least one connected region contained in the second three-dimensional foreground image, and the area and / or number of pixels of the connected region; determining the connected region with the largest area and / or the largest number of pixels in the at least one connected region as the body region after the bed board region is removed.
[0082] In summary, according to the CT image processing method provided by the present invention, after acquiring the CT image, the CT image can be segmented based on a preset segmentation threshold to obtain an initial three-dimensional foreground image including a body area, a first bed board area with less contact with the body area, and a second bed board area with more contact with the body area; then the holes of the body area in the initial three-dimensional foreground image are filled to obtain a first three-dimensional foreground image; the first bed board area in the first three-dimensional foreground image is removed by two-dimensional morphological operation, and the second bed board area in the first three-dimensional foreground image is removed by a watershed algorithm based on distance transformation to obtain a second three-dimensional foreground image; finally, the maximum connected domain analysis is performed in the second three-dimensional foreground image to obtain the body area after the bed board area is removed. The technical solution in the present application, in view of the situation where the bed board is connected to the human tissue, first performs a two-dimensional morphological operation to remove the bed board area with little adhesion to the body, and then uses the watershed algorithm of distance transformation to remove the bed board area with a lot of adhesion to the body. Through this progressive bed board removal method, the body area and the bed board area adhered to the body can be effectively separated, and the accuracy of bed board removal in the CT image can be improved.
[0083] Based on the above Figure 2 , Figure 3 A detailed description of the CT image processing method is provided, such as Figure 7 As shown, Figure 7 FIG. 1 is a block diagram of a CT image processing device according to an exemplary embodiment. Figure 7 As shown, the device comprises:
[0084] The segmentation module 41 is configured to segment the CT image based on a preset segmentation threshold value to obtain an initial three-dimensional foreground image including a body region and a bed region, wherein the bed region includes a first bed region whose contact area with the body region is less than a preset area threshold value, and a second bed region whose contact area with the body region is greater than or equal to the preset area threshold value;
[0085] A filling module 42, which can be used to fill the holes in the body area in the initial three-dimensional foreground image to obtain a first three-dimensional foreground image;
[0086] The removal module 43 may be used to remove the first bed board area in the first three-dimensional foreground image through two-dimensional morphological operation, and remove the second bed board area in the first three-dimensional foreground image through a watershed algorithm based on distance transformation, so as to obtain a second three-dimensional foreground image;
[0087] The analysis module 44 can be used to perform maximum connected domain analysis in the second three-dimensional foreground image to obtain the body area after removing the bed board area.
[0088] In some embodiments of the present application, Figure 8 As shown, the device further includes: a determination module 45;
[0089] A determination module 45, which can be used to determine a preset segmentation threshold corresponding to the CT image based on a maximum inter-class variance formula;
[0090] Among them, the formula characteristics of the maximum inter-class variance formula are described as follows:
[0091]
[0092] Where σ is the inter-class variance, P1 is the probability that any pixel in the CT image belongs to the foreground area, P2 is the probability that any pixel in the CT image belongs to the background area, m1 is the pixel mean of all foreground pixels in the CT image, m2 is the pixel mean of all background pixels in the CT image, and mG is the pixel mean of all pixels in the CT image.
[0093] In some embodiments of the present application, the filling module 42 can be used to expand the background pixels of the first mask image corresponding to the initial three-dimensional foreground image to obtain an expanded image containing the complete body area; use any pixel point in the background area of the expanded image as a seed point to perform three-dimensional region growth to obtain a second mask image, wherein, in the second mask image, the mask value of the background area is 1, and the mask value of the remaining area is 0; invert the mask value of the second mask image to obtain a first three-dimensional foreground image after hole filling, wherein, in the first three-dimensional foreground image, the mask value of the background area is 0, and the mask value of the remaining area is 1.
[0094] In some embodiments of the present application, when removing the first bed board area in the first three-dimensional foreground image through two-dimensional morphological operations, the removal module 43 can be used to perform two-dimensional corrosion processing and two-dimensional dilation processing on each layer of slice image in the first three-dimensional foreground image in sequence to remove the first bed board area in the first three-dimensional foreground image.
[0095] In some embodiments of the present application, when removing the second bed board area in the first three-dimensional foreground image by using a watershed algorithm based on distance transformation, the removal module 43 may be used to determine a plurality of initial marking points in the first three-dimensional foreground image; calculate the shortest distance from each pixel point in the first three-dimensional foreground image to the nearest marking point among the plurality of initial marking points, and generate a distance transformation image based on the shortest distance; and apply the watershed algorithm to segment the second bed board area in the first three-dimensional foreground image based on the distance transformation image.
[0096] In some embodiments of the present application, when multiple initial marking points are determined in the first three-dimensional foreground image, the removal module 43 can be used to perform distance transformation on each layer of slice image in the first three-dimensional foreground image to obtain a grayscale image after distance transformation; perform local maximum value extraction in a preset range area of the grayscale image to obtain multiple initial marking points.
[0097] In some embodiments of the present application, the analysis module 44 can be used to perform a connected domain analysis on the second three-dimensional foreground image to obtain at least one connected region contained in the second three-dimensional foreground image, and the area and / or number of pixels of the connected region; and determine the connected region with the largest area and / or the largest number of pixels in the at least one connected region as the body region after removing the bed board region.
[0098] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0099] In the embodiment of the present application, the technical solution in the present disclosure can segment the CT image based on a preset segmentation threshold after acquiring the CT image, and obtain an initial three-dimensional foreground image including the body area, the first bed board area with less contact with the body area, and the second bed board area with more contact with the body area; then fill the holes of the body area in the initial three-dimensional foreground image to obtain the first three-dimensional foreground image; and remove the first bed board area in the first three-dimensional foreground image through two-dimensional morphological operation, and remove the second bed board area in the first three-dimensional foreground image through a watershed algorithm based on distance transformation to obtain the second three-dimensional foreground image; finally, perform maximum connected domain analysis in the second three-dimensional foreground image to obtain the body area after removing the bed board area. In the technical solution of the present application, for the case where the bed board is connected to the human tissue, first perform a two-dimensional morphological operation to remove the bed board area with little adhesion to the body, and then use the watershed algorithm based on distance transformation to remove the bed board area with a lot of adhesion to the body. In this way, the body area and the bed board area with adhesion to the body can be effectively separated, and the accuracy of bed board removal in the CT image can be improved.
[0100] The CT image processing device of the embodiment of the present invention is described above from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in the form of hardware, can be implemented in the form of software instructions, or can be implemented in the form of a combination of hardware and software modules. Specifically, the steps of the CT image processing method embodiment in the embodiment of the present invention can be completed by the hardware integrated logic circuit and / or software instructions in the processor, and the steps of the CT image processing method applied in conjunction with the embodiment of the present invention can be directly embodied as a hardware decoding processor to execute, or can be executed by a combination of hardware and software modules in the decoding processor. Optionally, the software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps in the above CT image processing method embodiment in conjunction with its hardware.
[0101] Fig. 9 It is a schematic block diagram of an electronic device 700 according to an embodiment of the present invention.
[0102] like Fig. 9 As shown, the electronic device 700 may include:
[0103] The memory 710 and the processor 720, the memory 710 is used to store the computer program and transmit the program code to the processor 720. In other words, the processor 720 can call and run the computer program from the memory 710 to implement the method in the embodiment of the present invention.
[0104] For example, the processor 720 may be configured to execute the above method embodiments according to instructions in the computer program.
[0105] In some embodiments of the present invention, the processor 720 may include but is not limited to:
[0106] General-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.
[0107] In some embodiments of the present invention, the memory 710 includes but is not limited to:
[0108] Volatile memory and / or non-volatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM) or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM).
[0109] In some embodiments of the present invention, the computer program may be divided into one or more modules, which are stored in the memory 710 and executed by the processor 720 to complete the method provided by the present invention. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the controller.
[0110] like Fig. 9 As shown, the electronic device 700 may further include:
[0111] The transceiver 730 may be connected to the processor 720 or the memory 710 .
[0112] The processor 720 may control the transceiver 730 to communicate with other devices, specifically, to send data to other devices or receive data sent by other devices. The transceiver 730 may include a transmitter and a receiver. The transceiver 730 may further include an antenna, and the number of antennas may be one or more.
[0113] It should be understood that the various components in the electronic device are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.
[0114] The present invention also provides a computer storage medium having a computer program stored thereon, which, when executed by a computer, enables the computer to perform the method of the above method embodiment. In other words, an embodiment of the present invention also provides a computer program product containing instructions, which, when executed by a computer, enables the computer to perform the method of the above method embodiment.
[0115] When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (Digital Video Disc, DVD)), or a semiconductor medium (e.g., a solid-state drive (Solid State Disk, SSD)), etc.
[0116] Those skilled in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments applied herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0117] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the module is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0118] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. For example, each functional module in each embodiment of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0119] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in this application, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A CT image processing method, characterized in that: include: Segmenting the CT image based on a preset segmentation threshold to obtain an initial three-dimensional foreground image including a body region and a bed board region, wherein the bed board region includes a first bed board region whose contact area with the body region is less than a preset area threshold, and a second bed board region whose contact area with the body region is greater than or equal to the preset area threshold; Filling holes in the body area of the initial three-dimensional foreground image to obtain a first three-dimensional foreground image; Removing the first bed board area in the first three-dimensional foreground image by two-dimensional morphological operation, and removing the second bed board area in the first three-dimensional foreground image by a watershed algorithm based on distance transform, so as to obtain a second three-dimensional foreground image; A maximum connected domain analysis is performed in the second three-dimensional foreground image to obtain a body region after removing the bed board region.
2. The method according to claim 1, characterized in that Before segmenting the CT image based on the preset segmentation threshold to obtain an initial three-dimensional foreground image including the body area and the bed area, the method further includes: Determine a preset segmentation threshold corresponding to the CT image based on a maximum inter-class variance formula; The formula characteristic description of the maximum inter-class variance formula is as follows: Wherein, σ is the inter-class variance value, P1 is the probability that any pixel in the CT image belongs to the foreground area, P2 is the probability that any pixel in the CT image belongs to the background area, m1 is the pixel mean of all foreground pixels in the CT image, m2 is the pixel mean of all background pixels in the CT image, and mG is the pixel mean of all pixels in the CT image.
3. The method according to claim 1, characterized in that The step of filling the holes in the body area in the initial three-dimensional foreground image to obtain a first three-dimensional foreground image includes: Expanding background pixels of a first mask image corresponding to the initial three-dimensional foreground image to obtain an expanded image including a complete body area; Taking any pixel point in the background area of the expanded image as a seed point to perform three-dimensional region growth, to obtain a second mask image, wherein in the second mask image, the mask value of the background area is 1, and the mask value of the remaining area is 0; The mask value of the second mask image is inverted to obtain a first three-dimensional foreground image after hole filling, wherein, in the first three-dimensional foreground image, the mask value of the background area is 0, and the mask value of the remaining area is 1.
4. The method according to claim 1, characterized in that The removing the first bed board area in the first three-dimensional foreground image by performing a two-dimensional morphological operation includes: A two-dimensional erosion process and a two-dimensional dilation process are sequentially performed on each layer of slice image in the first three-dimensional foreground image to remove the first bed plate area in the first three-dimensional foreground image.
5. The method according to claim 1, characterized in that The watershed algorithm based on distance transformation, removing the second bed board area in the first three-dimensional foreground image, includes: Determining a plurality of initial marking points in the first three-dimensional foreground image; Calculating the shortest distance from each pixel point in the first three-dimensional foreground image to the nearest marking point among the multiple initial marking points, and generating a distance transformation image based on the shortest distance; Based on the distance transformation image, a watershed algorithm is applied to segment the second bed board area in the first three-dimensional foreground image.
6. The method according to claim 5, characterized in that The step of determining a plurality of initial marking points in the first three-dimensional foreground image comprises: For each layer of slice image in the first three-dimensional foreground image, respectively, distance transformation is performed to obtain a grayscale image after distance transformation; A local maximum value is extracted in a preset range of the grayscale image to obtain a plurality of initial marking points.
7. The method according to claim 1, characterized in that The performing of the maximum connected domain analysis in the second three-dimensional foreground image to obtain the body region after removing the bed board region includes: Performing a connected domain analysis on the second three-dimensional foreground image to obtain at least one connected region contained in the second three-dimensional foreground image, and an area and / or number of pixels of the connected region; The connected region with the largest area and / or the largest number of pixels in the at least one connected region is determined as the body region after the bed board region is removed.
8. A CT image processing device, characterized in that: include: a segmentation module, configured to segment the CT image based on a preset segmentation threshold value to obtain an initial three-dimensional foreground image including a body region and a bed board region, wherein the bed board region includes a first bed board region whose contact area with the body region is less than a preset area threshold value, and a second bed board region whose contact area with the body region is greater than or equal to the preset area threshold value; A filling module, used for filling the holes in the body area in the initial three-dimensional foreground image to obtain a first three-dimensional foreground image; a removal module, configured to remove the first bed board area in the first three-dimensional foreground image by two-dimensional morphological operation, and remove the second bed board area in the first three-dimensional foreground image by a watershed algorithm based on distance transform, so as to obtain a second three-dimensional foreground image; The analysis module is used to perform maximum connected domain analysis in the second three-dimensional foreground image to obtain the body area after removing the bed board area.
9. An electronic device, characterized in that: include: A processor and a memory, the memory being used to store a computer program, and the processor being used to call and run the computer program stored in the memory to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein the computer program enables a computer to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method for segmenting adhesion cells in image
CN102013102A
Image segmentation method based on watershed algorithm and morphological marker
CN103914843A
Adipocyte profile parameter image measuring method
CN107067406A
A liquid biopsy detection method for circulating tumor cells
CN107748256A
Bed board removing method and system based on CT image, electronic equipment and storage medium
CN113077474A
Cited By
Human body contour sketching algorithm system based on CT image
CN121414737A
A human body contour sketching algorithm system based on CT images
CN121414737B
