A method, device and storage medium for removing bed board in CT sequence images
By sampling the CT sequence image, the maximum connectivity domain difference is calculated and the template is corrected. Combined with the constrained expansion algorithm, the versatility and efficiency of bed plate segmentation in CT images are solved, and efficient bed plate area removal is achieved.
Patent Information
- Application Number
- CN202210593473.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-27
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2042-05-27
AI Technical Summary
The prior art is difficult to effectively remove the bed plate area in the CT sequence image, especially when the bed plate size, gray scale range and inspection location are different, resulting in insufficient universality of the segmentation algorithm and time-consuming.
By sampling the CT sequence image, the difference in the maximum connectivity domain is calculated and processed to obtain the reference template; then the intersection with the reference template is judged, the template is corrected, and the final correction template is processed layer by layer to obtain the final correction template; the final correction template area is removed, binarization and accumulation processing is performed, the high grayscale area is calculated as seed points, and the constrained expansion algorithm is used to process it to obtain the final divided bed plate area.
The effective removal of the bed plate area in the CT sequence image is achieved, and the universality and efficiency of the segmentation algorithm is improved. It is suitable for images of bed plates of different sizes and shapes and different CT devices.
Smart Images

Figure CN114972566B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of image processing, and in particular relates to a method, a device and a storage medium for removing a bed board in a CT sequence image. Background Art
[0002] The bed board in the CT sequence images is invalid information other than the human body parts, which interferes with the image three-dimensional reconstruction, auxiliary diagnosis and image automatic analysis, affecting the doctor's work efficiency, so it needs to be removed. Due to the different equipment manufacturers and grayscale ranges of CT sequence images, different bed boards have different sizes and shapes, and because the range of examination parts of a CT sequence is large, the universality of the algorithm is a technical difficulty.
[0003] Bed board segmentation method based on region growing. This type of method requires determining the seed point. The main methods for extracting seed points are: after filtering the image, find the second-order derivative in the X and Y directions, calculate the correlation of the second-order derivative, take the maximum correlation value as the final matching value, and binarize the final matching value to obtain the binarized matching image, and select a point in the longest line segment as the seed point. In addition, the edge of the bed board is screened out at a certain threshold on the edge of the extracted image, and the edge is used as the seed point for region growing to achieve bed board segmentation.
[0004] Select any point of the longest line segment in the Gaussian template matching image as the seed point for region growing. In the actual CT image sequence, the bed board is continuous on the side close to the human body, but may be discontinuous and divided into two segments on the side away from the human body. Using one seed point cannot completely segment the bed board. Extract the edge information of the image and extract the edge image of the bed board according to a certain threshold. The size and shape of bed boards in different hospitals are different, so it is impossible to use a unified threshold to extract the edge of the bed board. Based on the region growing algorithm, due to the different sizes and shapes of bed boards in different hospitals and the different grayscale ranges of different CT equipment manufacturers, it is impossible to use a unified growth condition. Some CT sequence images have many layers, and the bed board area must be removed from all layers, so the algorithm is time-consuming. Summary of the invention
[0005] The present invention aims to solve the technical problems existing in the background technology and to provide a method, device and storage medium for removing bed boards in CT sequence images, so as to solve the problems of bed board size and shape, grayscale range and different inspection parts in CT images in bed board segmentation of CT images and realize a segmentation scheme with strong versatility.
[0006] In order to solve the technical problem, the technical solution of the present invention is:
[0007] A method for removing a bed board in a CT sequence image, the method comprising:
[0008] Read in CT sequence images;
[0009] Based on the CT sequence images, the difference of the maximum connected domain is calculated after sampling and then processed by union, and the union result is used as the reference template;
[0010] Based on the CT sequence images, after sampling, it is determined whether there is an intersection with the reference template and the reference template is corrected to obtain a corrected template. After processing layer by layer, the union is calculated to obtain the final corrected template.
[0011] Based on the CT sequence images, the area of the final correction template is removed after sampling, and binarization and accumulation processing are performed to obtain a grayscale image;
[0012] The high grayscale area of the grayscale image is calculated, and the high grayscale area is used as the seed point of the constrained dilation algorithm. The seed point is processed by the constrained dilation algorithm to obtain a dilated image, and the dilated image is the bed plate area that is finally segmented.
[0013] Furthermore, the finally segmented bed board area in the CT sequence images is removed, that is, the bed board in the CT sequence images is removed.
[0014] Furthermore, the difference of the maximum connected domain is calculated after sampling and then processed by union, specifically including:
[0015] For the CT sequence images, equally spaced sampling is performed in the slice direction to obtain multiple sampling slices;
[0016] Based on multiple sampling slices, the current sampling slice and the next sampling slice are displayed in terms of window width and window position, and binarized to obtain a binarized image of the current sampling slice and a binarized image of the next sampling slice;
[0017] Performing maximum connected domain extraction on the binary image of the current sampling slice and the binary image of the next sampling slice to obtain the maximum connected domain of the current sampling slice and the maximum connected domain of the next sampling slice;
[0018] Determine whether there is an overlapping area between the maximum connected domain of the current sampling slice and the maximum connected domain of the next sampling slice. If there is an overlapping area, perform an XOR operation on the overlapping area to obtain the XOR result of the current sampling slice.
[0019] Loop through each sampling slice, sum all XOR results, and use the sum result as a reference template.
[0020] Furthermore, based on the CT sequence images being sampled at equal intervals in the slice direction, each sampled slice is binarized and then connected domains are marked, connected domains with an area greater than a threshold are retained, and it is determined whether the reference template and the connected domains with an area greater than the threshold have an intersection. If so, the connected domain is unioned with the reference template to obtain a corrected template.
[0021] Further, the step of obtaining the union after layer-by-layer processing specifically includes:
[0022] Each sampling slice is traversed in a loop to perform binarization, connected domain marking, connected domain retention and judgment processing, and the connected domain that meets the threshold condition is combined with the correction template to obtain a final correction template.
[0023] Furthermore, the CT sequence images are sampled at equal intervals in the slice direction, and for each sampled slice, after removing the final corrected template area, binarization is performed to obtain a binary image, and each sampled slice is looped through, and after repeating the equal-interval sampling, removing the final corrected template area and binarization, the binary images are accumulated to obtain a grayscale image.
[0024] Further, the high grayscale area of the grayscale image is calculated, the high grayscale area is used as a seed point of the constrained dilation algorithm, and the seed point is processed by the constrained dilation algorithm, specifically including:
[0025] A threshold value is calculated for the mean variance of the target area in the grayscale image to obtain a threshold value of the target area; based on the threshold value of the target area, the grayscale image is binarized, the binarization result is used as a seed point, and a constrained dilation algorithm is used to process the image to obtain a dilated image, which is the final segmented bed board area.
[0026] A device for removing a bed board in a CT sequence image, the device comprising:
[0027] A reading module is used to read CT sequence images;
[0028] The first processing module is used to calculate the difference of the maximum connected domain after sampling based on the CT sequence image and perform a union process, and use the union result as a reference template;
[0029] The second processing module is used to determine whether there is an intersection with the reference template after sampling based on the CT sequence image, and to correct the reference template to obtain a corrected template, and to obtain a union after layer-by-layer processing to obtain a final corrected template;
[0030] The third processing module is used to remove the area of the final correction template after sampling based on the CT sequence image, perform binarization and accumulation processing, and obtain a grayscale image;
[0031] The calculation module is used to calculate the high grayscale area of the grayscale image, take the high grayscale area as the seed point of the constrained expansion algorithm, and use the constrained expansion algorithm to process the seed point to obtain the expanded image, which is the bed plate area finally segmented.
[0032] A computer-readable storage medium stores computer-executable instructions, which are used to implement the method described above when executed by a processor.
[0033] Compared with the prior art, the advantages of the present invention are:
[0034] By calculating the difference between the maximum connected domains between image slices, the body part area is roughly located;
[0035] The roughly located body part region is corrected by the intersection of the roughly located body part and the larger connected region of the connected region;
[0036] After removing the body part area, the obtained image is binarized and superimposed to obtain a grayscale image;
[0037] After accumulation, the image is binarized and the binarized image is constrainedly expanded;
[0038] Equally spaced sampling improves the efficiency of algorithm execution. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 , a main flow chart of a method for removing a bed board in a CT sequence image of the present invention;
[0040] Figure 2 , maximum connected domain labeling graph;
[0041] Figure 3 , find the XOR graph of the maximum connected domain of adjacent sampling slices;
[0042] Figure 4 , reference template diagram;
[0043] Figure 5 , find the intersection graph of the sampling slice and the connected domain;
[0044] Figure 6 , final revision template;
[0045] Figure 7 , remove the reference template binarization result;
[0046] Figure 8 , two The valued results are accumulated to obtain a grayscale image;
[0047] Fig. 9 , the constrained algorithm obtains the final bed area. DETAILED DESCRIPTION
[0048] The specific implementation mode of the present invention is described below in conjunction with embodiments:
[0049] It should be noted that the structures, proportions, sizes, etc. shown in this specification are only used to match the contents disclosed in the specification so that people familiar with this technology can understand and read them, and are not used to limit the conditions under which the present invention can be implemented. Any structural modification, change in proportional relationship or adjustment of size should still fall within the scope of the technical content disclosed in the present invention without affecting the effects and purposes that can be achieved by the present invention.
[0050] At the same time, the terms such as "upper", "lower", "left", "right", "middle" and "one" cited in this specification are only for the convenience of description and are not used to limit the scope of implementation of the present invention. Changes or adjustments to their relative relationships should be regarded as the scope of implementation of the present invention without substantially changing the technical content.
[0051] Embodiment 1:
[0052] 1. Read in CT sequence images
[0053] 2. Transform the grayscale range of the CT sequence images so that the minimum grayscale value is -1024 and the CT value of the body part is the actual CT value
[0054] 3. Sample the CT sequence images at equal intervals in the slice direction. Binarize the current sampled slice and the next sampled slice according to a certain window width and bed position, and then extract the maximum connected domain of the binary image.
[0055] 4. Determine whether the maximum connected domains of the two sample slices mentioned above overlap. If so, perform an XOR operation on the overlapping areas.
[0056] 5. Loop through each sample slice, sum all XOR results, and use the sum result as a reference template
[0057] 6. Sample the image sequence at equal intervals in the slice direction. For each sampled slice, after binarization, mark the connected domain, retain the connected domain with an area greater than the threshold, and determine whether the reference template in step 5 has an intersection with the connected domain. If so, find the union of the connected domain and the reference template to obtain the corrected template.
[0058] 7. Loop through all the sample slices and perform the same steps as step 6. The connected domain that meets the conditions is combined with the correction template calculated by the previous slice to obtain the final correction template.
[0059] 8. Sample the image sequence at equal intervals in the slice direction. After removing the modified template area in step 7, perform binarization on each sampled slice to obtain a binary image. Loop through each sampled slice and perform the same operation.
[0060] 9. Accumulate all binary images in step 8 to obtain a grayscale image
[0061] 10. Calculate the threshold value according to the mean variance of the target area of the grayscale image in step 8, binarize the grayscale image, use the binarization result as the seed point, perform a constrained dilation operation, and obtain the dilated image as the final segmented bed area.
[0062] Reference template: Get the difference area of all adjacent sample slices as the area of the partial body part;
[0063] Correcting template: Correcting the reference template by judging whether the larger connected domain of the sampled slice overlaps with the reference template;
[0064] Final revised template: Based on the revised template, the overlapping areas between the larger connected domains of all sampled slices and the revised template are judged to find the area covering the largest range of human body parts.
[0065] Embodiment 2:
[0066] The algorithm concept of the present invention is that human tissue changes continuously between different layers, while the position of the bed board between different layers is fixed. The reference template is constructed using the continuity of the maximum connected domain to determine the location of human tissue. In some CT image sequences, human tissue is not included in the maximum connected domain. Therefore, a connected domain with a larger area that intersects with the reference template is used, and the reference template and the connected domain are unioned. The reference template is corrected to obtain a corrected template. The human tissue area in the corrected template area is removed from the CT image, and all layers are superimposed after binarization to obtain a grayscale image. Finally, the area of the machine tool part can be obtained through a constrained expansion algorithm.
[0067] Figure 1 The flowchart of a method for removing a bed board in a CT sequence image provided by an embodiment of the present invention is shown. The method comprises the following steps:
[0068] Step S1: read in CT sequence images;
[0069] Step S2: pre-processing the volume data, arranging the CT volume data from large to small according to slice location;
[0070] Step S3: sampling is performed at equal intervals in the slice direction according to a certain sampling step length, and the current sample slice and the next sample slice are binarized after being displayed according to a certain window width and window position, wherein the window width, window position, and binarization threshold are 800, 100, and 30, respectively, and then connected domains are marked respectively to obtain the respective maximum connected domains;
[0071] See also Figure 2 The current sampling slice provides a method for automatically removing the bed board from the CT image. Figure 2As shown in a, Figure 2 The b in it is the largest connected domain after the image is binarized;
[0072] S4: Determine whether the maximum connected domains of the two binary graphs have overlapping areas. If so, calculate the XOR of the two maximum connected domains and save them; if not, loop to calculate the next sampling slice, loop through each sampling slice, and perform the same operation. Calculate the union of all XOR results, and use the union result as a reference template.
[0073] Figure 3 a, b, and c in it are the maximum connected domain of a certain sampling slice, the maximum connected domain of the next sampling slice, and the result of the XOR of two connected domains.
[0074] See also Figure 4 The XOR union of the connected domains of all intersections is shown as a reference template;
[0075] S5: sampling the image sequence at equal intervals in the slice direction, and marking the connected domain after binarization for each sampled slice, retaining the connected domain with an area greater than a threshold. In this embodiment, the area threshold is 300, and checking whether the reference template has an intersection with the connected domain. If so, retain the connected domain, and calculate the union of the connected domain and the reference template to obtain a modified template;
[0076] See also Figure 5 a, b, and c are slices sampled at axial intervals, the binarization result of the slice, and the connected domains that intersect the reference template and the connected domains in the binary image whose area is greater than the threshold.
[0077] S6: Loop through all the sampled slices and perform the same steps as in step 5. The connected domain that meets the conditions is combined with the revised template calculated by the previous slice to obtain the final revised template.
[0078] See also Figure 6 is the final modified template, which is the largest connected domain that contains human tissue as much as possible;
[0079] S7: The image sequence is sampled at equal intervals in the slice direction. After removing the modified template area in step 6 from each sampled slice, the sampled slice is binarized to obtain a binary image. Each sampled slice is traversed in a loop to perform the same operation.
[0080] See also Figure 7 The binarization result after removing the correction template for a certain sampling slice. Loop through all sampling slices and perform the same operation;
[0081] S8: Accumulate all binary images in step 7 to obtain a merged grayscale image;
[0082] See also Figure 8The grayscale image is obtained by merging the binary images after removing the modified template from all sample slices;
[0083] S9: Calculate the threshold value according to the mean variance of the target area of the grayscale image in step 8. In this embodiment, the threshold value is 32.56. Binarize the grayscale image and use the binarization result as the seed point to perform a constrained dilation operation. The dilated image obtained is the final segmented bed area.
[0084] See also Fig. 9 The result of the constrained dilation algorithm after binarizing the merged grayscale image, where a is the binarization result, which serves as the seed point for dilation, b is the binarization result of the merged result with 0 as the threshold, and each dilation result must be within b, and c is the final result of the constrained dilation algorithm (other constraints are that the dilation is stopped if the number of dilations exceeds 5 or the number of newly added constrained points after dilation is less than or equal to 20), which is also the final result of bed board segmentation.
[0085] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0086] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0087] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0088] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0089] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit its protection scope. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that after reading the present invention, those skilled in the art can still make various changes, modifications or equivalent substitutions to the specific implementation methods of the invention, but these changes, modifications or equivalent substitutions are all within the protection scope of the pending claims of the invention.
Claims
1. A method for removing bed boards in CT sequence images, characterized in that: The method comprises: Read in CT sequence images; Based on the CT sequence images, the difference of the maximum connected domain is calculated after sampling and then processed by union, and the union result is used as the reference template; Based on the CT sequence images, after sampling, it is determined whether there is an intersection with the reference template and the reference template is corrected to obtain a corrected template. After processing layer by layer, the union is calculated to obtain the final corrected template. Based on the CT sequence images, the area of the final correction template is removed after sampling, and binarization and accumulation processing are performed to obtain a grayscale image; Calculate the high grayscale area of the grayscale image, use the high grayscale area as the seed point of the constrained dilation algorithm, use the constrained dilation algorithm to process the seed point to obtain a dilated image, and the dilated image is the bed plate area that is finally segmented; The finally segmented bed board area in the CT sequence images is removed, that is, the bed board in the CT sequence images is removed; The calculation of the difference of the maximum connected domain after sampling and the processing of the union specifically include: For the CT sequence images, equally spaced sampling is performed in the slice direction to obtain multiple sampling slices; Based on multiple sampling slices, the current sampling slice and the next sampling slice are displayed in terms of window width and window position, and binarized to obtain a binarized image of the current sampling slice and a binarized image of the next sampling slice; Performing maximum connected domain extraction on the binary image of the current sampling slice and the binary image of the next sampling slice to obtain the maximum connected domain of the current sampling slice and the maximum connected domain of the next sampling slice; Determine whether there is an overlapping area between the maximum connected domain of the current sampling slice and the maximum connected domain of the next sampling slice. If there is an overlapping area, perform an XOR operation on the overlapping area to obtain the XOR result of the current sampling slice. Loop through each sampling slice, sum all XOR results, and use the sum result as a reference template; Based on the CT sequence images, the CT image is sampled at equal intervals in the slice direction. After binarization, each sampled slice is marked with a connected domain. The connected domain with an area greater than a threshold is retained. It is determined whether the reference template has an intersection with the connected domain with an area greater than the threshold. If so, the connected domain is unioned with the reference template to obtain a modified template.
2. The method for removing bed boards in CT sequence images according to claim 1, characterized in that: The step of obtaining the union after layer-by-layer processing specifically includes: Each sampling slice is traversed in a loop to perform binarization, connected domain marking, connected domain retention and judgment processing, and the connected domain that meets the threshold condition is combined with the correction template to obtain a final correction template.
3. The method for removing bed boards in CT sequence images according to claim 1, characterized in that: The CT sequence images are sampled at equal intervals in the slice direction, and for each sampled slice, after removing the final corrected template area, binarization is performed to obtain a binary image, and each sampled slice is traversed in a loop, and after repeating the equal interval sampling, removing the final corrected template area and binarization, the binary images are accumulated to obtain a grayscale image.
4. The method for removing bed boards in CT sequence images according to claim 1, characterized in that: The calculating of the high grayscale area of the grayscale image, taking the high grayscale area as the seed point of the constrained dilation algorithm, and processing the seed point by using the constrained dilation algorithm specifically includes: A threshold value is calculated for the mean variance of the target area in the grayscale image to obtain a threshold value of the target area; based on the threshold value of the target area, the grayscale image is binarized, the binarization result is used as a seed point, and a constrained dilation algorithm is used to process the image to obtain a dilated image, which is the final segmented bed board area.
5. A device for removing bed boards in CT sequence images, characterized in that: The device comprises: A reading module is used to read in CT sequence images; The first processing module is used to calculate the difference of the maximum connected domain after sampling based on the CT sequence image and perform a union process, and use the union result as a reference template; The second processing module is used to determine whether there is an intersection with the reference template after sampling based on the CT sequence image, and to correct the reference template to obtain a corrected template, and to obtain a union after layer-by-layer processing to obtain a final corrected template; The third processing module is used to remove the area of the final correction template after sampling based on the CT sequence image, perform binarization and accumulation processing, and obtain a grayscale image; A calculation module is used to calculate the high grayscale area of the grayscale image, take the high grayscale area as the seed point of the constrained expansion algorithm, and process the seed point using the constrained expansion algorithm to obtain an expanded image, and the expanded image is the bed plate area that is finally segmented; The finally segmented bed board area in the CT sequence images is removed, that is, the bed board in the CT sequence images is removed; The calculation of the difference of the maximum connected domain after sampling and the processing of the union specifically include: For the CT sequence images, equally spaced sampling is performed in the slice direction to obtain multiple sampling slices; Based on multiple sampling slices, the current sampling slice and the next sampling slice are displayed in terms of window width and window position, and binarized to obtain a binarized image of the current sampling slice and a binarized image of the next sampling slice; Performing maximum connected domain extraction on the binary image of the current sampling slice and the binary image of the next sampling slice to obtain the maximum connected domain of the current sampling slice and the maximum connected domain of the next sampling slice; Determine whether there is an overlapping area between the maximum connected domain of the current sampling slice and the maximum connected domain of the next sampling slice. If there is an overlapping area, perform an XOR operation on the overlapping area to obtain the XOR result of the current sampling slice. Loop through each sampling slice, sum all XOR results, and use the sum result as a reference template; Based on the CT sequence images, the CT image is sampled at equal intervals in the slice direction. After binarization, each sampled slice is marked with a connected domain. The connected domain with an area greater than a threshold is retained. It is determined whether the reference template has an intersection with the connected domain with an area greater than the threshold. If so, the connected domain is unioned with the reference template to obtain a modified template.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 4 when executed by a processor.
Citation Information
Patent Citations
Medicine bottle foreign matter detection method based on medical visual detection robot image correction
CN103226814A
Quick checkerboard image feature matching algorithm based on connected domain segmentation
CN104091324A