A bone segmentation result correction method, device, equipment and medium
Patent Information
- Application Number
- CN202411647211.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2026-08-28
- Estimated Expiration
- 2044-11-18
AI Technical Summary
传统的骨分割后处理方法通常采用全局阈值来处理图像,而不考虑像素之间的空间关系和上下文联系,这可能导致边界模糊或错误
[0044] According to the bone segmentation result correction method, apparatus, device, and computer-readable storage medium of the above embodiments, the orientation of skeletal regions with orientation attributes in the bone segmentation result can be accurately distinguished by using the centroid coordinates of the vertebral region as the boundary point for orientation correction of the skeletal regions with orientation attributes in the bone segmentation result. When repairing the rib region, if the number of connected components in the rib mask image does not meet the normal range of rib numbers, connected component analysis is performed on the image region corresponding to each rib mask, and each rib mask is repaired based on the connected component analysis results, improving the accuracy of the repair. When repairing the vertebral region, adjacent vertebral regions with spatially adjacent relationships are referenced, and repair is performed according to the order of vertebral mask connections, making the repair result more reasonable and accurate. When repairing the upper limb region, the pixels in the upper limb region are traversed, and the pixel values of the pixels are updated, thereby achieving comprehensive repair of the upper limb region. In summary, the technical solution of this application improves the accuracy of bone segmentation result correction.
Smart Images

Figure CN120163830B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image segmentation technology, and specifically to a method, apparatus, device, and medium for correcting bone segmentation results. Background Technology
[0002] Computed Tomography (CT) is a medical imaging technique that uses X-rays to generate images of the body's internal structures. Bone segmentation using CT images is an important medical image processing task with significant implications for clinical diagnosis, surgical planning, and fracture assessment.
[0003] Modern medical image segmentation techniques are rapidly evolving. For example, classic deep learning segmentation networks like Unet and Transformer, using convolutional and attention networks and a large number of network parameters, surpass traditional medical image segmentation techniques in both accuracy and speed. However, deep learning models typically contain multiple hyperparameters, each with multiple possible values. This leads to an exponential increase in the number of potential hyperparameter combinations, requiring significant computational resources for each training and evaluation. Especially with large-scale medical image datasets, fully exploring the hyperparameter space is difficult. To reduce the difficulty of manual hyperparameter tuning and improve the clinical applicability of deep learning model segmentation, automated segmentation frameworks are actively developing. For instance, the nnUnet framework can achieve excellent results in routine medical image segmentation tasks through highly automated configuration of appropriate network architectures, data augmentation methods, training parameters, and other hyperparameters. Building upon nnUnet, the whole-body segmentation framework TotalSegmentor, trained with labeled datasets, has achieved a segmentation model with a certain level of accuracy, enabling automatic combined segmentation of all organs and bones in the human body. It is also ready to use out of the box, significantly lowering the barrier to entry for CT image bone segmentation. However, because it is a general human segmentation model, its segmentation of different bone types is not perfect. Furthermore, the hyperparameter requirements for CT data of bones from different body parts vary, making the TotalSegmentor framework inaccurate for bone segmentation. In addition, the SegmentAnyBone framework, based on SAM, uses a large medical bone dataset for focused bone segmentation training, enabling it to segment bones in 17 parts of the body with high accuracy. However, it is mainly used for MRI images and has a limited number of segmentation categories.
[0004] In deep learning methods, due to hardware memory limitations, large-size medical images cannot be directly input into the device for training and inference. Images must be processed in blocks, which leads to a lack of contextual information in the network. Furthermore, when there are issues such as blurred bone edges, overlapping adjacent bones, and differences in image quality due to different CT equipment and scanning parameters, the final segmentation result will degrade to varying degrees compared to the actual mask image. Therefore, appropriate post-processing methods are needed to correct the results of the deep learning segmentation model, further improving the accuracy and reliability of bone segmentation. Post-processing methods can automatically correct errors that may arise in the segmentation algorithm at the software level when memory is insufficient, eliminating the need for manual editing of the segmentation file. This method can significantly improve the speed of disease diagnosis and treatment planning. Its core is to perform in-depth statistical analysis on the original segmentation results, identify and label outliers and abnormal regions, and gradually optimize these anomalies, ultimately making the corrected segmentation result more consistent with the actual distribution patterns. Commonly used post-processing methods include morphological operations, connected component analysis, and feature engineering. Traditional bone segmentation post-processing methods typically use global thresholding to process images without considering the spatial relationships and contextual connections between pixels. This can lead to blurred boundaries or errors. Current hardware cannot support direct inference from complete, high-resolution whole-body CT images by segmentation models; images need to be sliced into blocks according to certain rules and then processed in batches. This method results in the loss of some spatial correlation between segmentation blocks, manifesting as misaligned bone masks, indistinguishable left and right sides of bone masks, and an increase in abnormal regions. Simple image post-processing, such as thresholding, cannot solve these problems, requiring manual mask correction again, which is time-consuming and labor-intensive. In summary, some existing post-processing schemes only process abnormal bone masks, without considering the factors of human skeletal structure and other potentially related bone masks. Furthermore, they do not use anatomical prior knowledge to guide the design and optimization of post-processing algorithms, nor do they use prior knowledge to limit the shape range and numerical magnitude during the correction process. Therefore, the accuracy of correcting bone segmentation results using this post-processing method is not high. Summary of the Invention
[0005] The main technical problem solved by this invention is that the bone segmentation results obtained by the segmentation model are usually post-processed using a global threshold without considering the spatial relationship and contextual relationship between pixels, which leads to low accuracy of the bone segmentation results.
[0006] According to the first aspect, one embodiment provides a method for correcting bone segmentation results, comprising:
[0007] Obtain bone segmentation results, wherein the bone segmentation results include multiple different bone regions segmented from the human body scan image, each bone region contains a different bone mask, the bone mask is a bone identified from the human body scan image, each bone mask has a bone label, and the bone regions include vertebral regions, rib regions and upper limb regions;
[0008] Calculate the centroid coordinates of the vertebral region, and use the centroid coordinates as the dividing point to correct the orientation of the bone regions with orientation attributes in the bone segmentation result, so as to obtain the orientation-corrected bone segmentation result. The bone regions with orientation attributes refer to the regions where the left and right bones are located.
[0009] For the rib region in the bone segmentation result after direction correction, the bone label of each rib mask is unified to obtain a rib mask image. Connected component analysis is performed on the rib mask image to obtain the number of connected components in the rib mask image. When the number of connected components does not meet the normal range of rib number, connected component analysis is performed on the image region corresponding to each rib mask to obtain the connected component analysis result of the image region corresponding to each rib mask. Based on the connected component analysis result, each rib mask in the rib region of the bone segmentation result after direction correction is repaired to obtain the repaired rib region.
[0010] For the vertebral region in the bone segmentation result after the direction correction, connected component analysis is performed on the image region corresponding to each vertebral mask to obtain the number of connected components in the image region corresponding to each vertebral mask. When the number of connected components in the image region corresponding to a certain vertebral mask is greater than a preset first threshold, the connected components in the image region corresponding to that vertebral mask, except for the largest connected component, are regarded as abnormal connected components. It is determined which of the adjacent vertebral regions of the vertebral mask should be merged with the abnormal connected component, and the vertebral mask is repaired according to the determination result to obtain the repaired vertebral region. The vertebral region includes multiple different vertebral masks connected in a spatial order from top to bottom. The adjacent vertebral regions include the image regions corresponding to the vertebral masks that are adjacent to the vertebral masks whose number of connected components is greater than the preset first threshold in the upper and lower spatial layers.
[0011] For the upper limb region in the bone segmentation result after direction correction, a randomly selected pixel in the upper limb region is used as the starting point, and the image region corresponding to the abnormal bone mask in the upper limb region is used as the ending point. Starting from the starting point, the pixels in the upper limb region are traversed and the pixel value of each pixel is updated until the number of connected components in the upper limb region after pixel value update meets the preset number. The bone label of the abnormal bone mask is then repaired to the upper limb bone label, wherein the bone label of the abnormal bone mask is different from the upper limb bone label.
[0012] In some embodiments, the connected component analysis result of the image region corresponding to each rib mask includes the connected component image of the image region corresponding to each rib mask and the number of connected components corresponding to the connected component image. The step of repairing each rib mask in the rib region of the directionally corrected bone segmentation result based on the connected component analysis result to obtain the repaired rib region includes:
[0013] When the number of connected components corresponding to the connected component image is greater than a preset second threshold, the connected component with the largest area in the connected component image is retained, and all connected components except the connected component with the largest area are eliminated to obtain the connected component image of the image region corresponding to each rib mask after processing.
[0014] The reference coordinates of the connected component image of the image region corresponding to each rib mask after processing are calculated. The connected component images of the image region corresponding to each rib mask after processing are sorted according to the magnitude of the reference coordinates. The predefined rib mask values are then assigned to the connected component images of the image region corresponding to each rib mask after processing in the order of the sorting process, thus obtaining the repaired rib region. The reference coordinates are the coordinates of the centroid of the connected component image of the image region corresponding to each rib mask on the Z-axis.
[0015] In some embodiments, the step of using the centroid coordinate point as a boundary point to correct the orientation of the skeletal regions with orientation attributes in the bone segmentation result, to obtain the orientation-corrected bone segmentation result, includes:
[0016] The mask values of all bone masks in the bone region with orientation attributes are assigned to a preset first mask value, wherein the first mask value is the mask value of the left bone mask or the mask value of the right bone mask.
[0017] When the first mask value is the mask value of the left bone mask, the mask value of the bone mask located to the right of the centroid coordinate point in the bone region with orientation attribute is assigned the mask value of the right bone mask.
[0018] When the first mask value is the mask value of the right bone mask, the mask value of the bone mask located to the left of the centroid coordinate point in the bone region with orientation attribute is assigned the mask value of the left bone mask; wherein, the mask value is used to represent the bone label of the bone mask.
[0019] In some embodiments, the adjacent vertebral region includes a first adjacent vertebral region and a second adjacent vertebral region. The first adjacent vertebral region is the image region corresponding to a vertebral mask that is adjacent to a vertebral mask with a number of connected regions greater than a preset first threshold in the upper space. The second adjacent vertebral region is the image region corresponding to a vertebral mask that is adjacent to a vertebral mask with a number of connected regions greater than a preset first threshold in the lower space. The step of determining which of the adjacent vertebral regions of the vertebral mask the abnormal connected region should be merged with includes:
[0020] Replace the mask value of the abnormal connected region with the mask value of the first adjacent vertebral region, and perform connected region analysis on the first adjacent vertebral region to obtain the number of connected regions in the first adjacent vertebral region.
[0021] Determine whether the number of connected components in the first adjacent vertebral region is consistent with the number of connected components in the first adjacent vertebral region obtained when performing connected component analysis on the image region corresponding to each vertebral mask, and determine whether the number of connected components in the first adjacent vertebral region is less than a preset third threshold.
[0022] When the number of connected components in the first adjacent vertebral region is the same as the number of connected components in the first adjacent vertebral region obtained when performing connected component analysis on the image region corresponding to each vertebral mask, and the number of connected components in the first adjacent vertebral region is less than the third threshold, it is determined that the abnormal connected component should be merged with the first adjacent vertebral region.
[0023] Otherwise, the mask value of the abnormal connected component is replaced with the mask value of the second adjacent vertebral region, and connected component analysis is performed on the second adjacent vertebral region to obtain the number of connected components in the second adjacent vertebral region;
[0024] Determine whether the number of connected components in the second adjacent vertebral region is consistent with the number of connected components in the second adjacent vertebral region obtained when performing connected component analysis on the image region corresponding to each vertebral mask, and determine whether the number of connected components in the second adjacent vertebral region is less than a preset fourth threshold.
[0025] When the number of connected components in the second adjacent vertebral region is the same as the number of connected components in the second adjacent vertebral region obtained when performing connected component analysis on the image region corresponding to each vertebral mask, and the number of connected components in the second adjacent vertebral region is less than the fourth threshold, it is determined that the abnormal connected component should be merged with the second adjacent vertebral region.
[0026] Otherwise, calculate the centroid coordinates of the abnormal connected region, the centroid coordinates of the first adjacent vertebral region, and the centroid coordinates of the second adjacent vertebral region, respectively, and calculate the first centroid distance between the centroid coordinates of the abnormal connected region and the centroid coordinates of the first adjacent vertebral region, and calculate the second centroid distance between the centroid coordinates of the abnormal connected region and the centroid coordinates of the second adjacent vertebral region, and determine that the abnormal connected region should be merged with the adjacent vertebral region corresponding to the smallest centroid distance among the first centroid distance and the second distance.
[0027] In some embodiments, the step of repairing the vertebral mask based on the judgment result to obtain the repaired vertebral region includes:
[0028] The skeletal mask of the abnormal connected region is modified to the skeletal mask of the adjacent vertebral region that the abnormal connected region should be merged into, and the repaired vertebral region is obtained.
[0029] In some embodiments, the pixel value update process for each pixel includes:
[0030] Determine the difference between the pixel value of each pixel and a preset upper limb threshold, wherein the upper limb threshold is the difference between the mask value of the upper limb region and the preset background mask value;
[0031] When the pixel value of the pixel is less than or equal to the upper limb threshold, the pixel value of the pixel is assigned as the mask value of the upper limb region;
[0032] When the pixel value of the pixel is greater than the upper limb threshold, the pixel update process is stopped.
[0033] In some embodiments, the background mask value is 0. For the upper limb region in the bone segmentation result after direction correction, before repairing the abnormal bone mask in the upper limb region, the mask value of the scapular mask of the scapular region connected to the upper limb region is saved. After saving the mask value of the scapular mask, the mask value of the scapular mask is set to zero, so that when traversing the pixels in the upper limb region from the starting point and updating the pixel value of each pixel, the mask value of the scapular mask of the scapular region is equal to the background mask value.
[0034] According to a second aspect, one embodiment provides a bone segmentation result correction device, comprising:
[0035] The result acquisition module is used to acquire bone segmentation results, wherein the bone segmentation results include multiple different bone regions segmented from the human body scan image, each bone region contains a different bone mask, the bone mask is a bone identified from the human body scan image, each bone mask has a bone label, and the bone regions include vertebral regions, rib regions and upper limb regions.
[0036] The orientation correction module is used to calculate the centroid coordinates of the vertebral region and use the centroid coordinates as the dividing point to correct the orientation of the bone regions with orientation attributes in the bone segmentation result, so as to obtain the orientation-corrected bone segmentation result. The bone regions with orientation attributes refer to the regions where the left and right bones are located.
[0037] The rib correction module is used to unify the bone labels of each rib mask in the rib region of the bone segmentation result after direction correction, to obtain a rib mask image, perform connected component analysis on the rib mask image to obtain the number of connected components in the rib mask image, and when the number of connected components does not meet the normal range of the number of ribs, perform connected component analysis on the image region corresponding to each rib mask to obtain the connected component analysis result of the image region corresponding to each rib mask, and repair each rib mask in the rib region of the bone segmentation result after direction correction according to the connected component analysis result to obtain the repaired rib region;
[0038] The vertebral correction module is used to perform connected component analysis on the image region corresponding to each vertebral mask in the bone segmentation result after direction correction, to obtain the number of connected components in the image region corresponding to each vertebral mask. When the number of connected components in the image region corresponding to a certain vertebral mask is greater than a preset first threshold, the connected components in the image region corresponding to the vertebral mask other than the largest connected component are regarded as abnormal connected components. It is determined which of the adjacent vertebral regions of the vertebral mask should be merged with the abnormal connected component, and the vertebral mask is repaired according to the determination result to obtain the repaired vertebral region. The vertebral region includes multiple different vertebral masks connected in a spatial order from top to bottom. The adjacent vertebral regions include the image regions corresponding to the vertebral masks that are adjacent to the vertebral masks with the number of connected components greater than the preset first threshold in the upper and lower spatial layers.
[0039] The upper limb correction module is used to, for the upper limb region in the bone segmentation result after direction correction, take a randomly selected pixel in the upper limb region as the starting point and the image region corresponding to the abnormal bone mask in the upper limb region as the ending point, traverse the pixels in the upper limb region from the starting point and perform pixel value update processing on the pixel value of each pixel until the number of connected components in the upper limb region after pixel value update processing meets the preset number, and repair the bone label of the abnormal bone mask to the upper limb bone label, wherein the bone label of the abnormal bone mask is different from the upper limb bone label.
[0040] According to a third aspect, one embodiment provides a bone segmentation result correction device, comprising:
[0041] Memory, used to store programs;
[0042] A processor for implementing a bone segmentation result correction method by executing a program stored in the memory.
[0043] According to a fourth aspect, one embodiment provides a computer-readable storage medium storing a program that can be executed by a processor to implement a bone segmentation result correction method.
[0044] According to the bone segmentation result correction method, apparatus, device, and computer-readable storage medium of the above embodiments, the orientation of skeletal regions with orientation attributes in the bone segmentation result can be accurately distinguished by using the centroid coordinates of the vertebral region as the boundary point for orientation correction of the skeletal regions with orientation attributes in the bone segmentation result. When repairing the rib region, if the number of connected components in the rib mask image does not meet the normal range of rib numbers, connected component analysis is performed on the image region corresponding to each rib mask, and each rib mask is repaired based on the connected component analysis results, improving the accuracy of the repair. When repairing the vertebral region, adjacent vertebral regions with spatially adjacent relationships are referenced, and repair is performed according to the order of vertebral mask connections, making the repair result more reasonable and accurate. When repairing the upper limb region, the pixels in the upper limb region are traversed, and the pixel values of the pixels are updated, thereby achieving comprehensive repair of the upper limb region. In summary, the technical solution of this application improves the accuracy of bone segmentation result correction. Attached Figure Description
[0045] Figure 1 This is a flowchart of a bone segmentation result correction method according to an embodiment of this application;
[0046] Figure 2 A reference diagram showing the bone segmentation result of one embodiment;
[0047] Figure 3 A flowchart illustrating how to correct the orientation of skeletal regions with orientation attributes in bone segmentation results using centroid coordinates as the dividing point, as an embodiment, to obtain the orientation-corrected bone segmentation results.
[0048] Figure 4 This is a comparison image of the scapula's orientation before and after correction, according to one embodiment.
[0049] Figure 5 This is a comparison image of the lower limb region before and after orientation correction according to one embodiment;
[0050] Figure 6 As an example, a flowchart of the repaired rib region is obtained by repairing each rib mask in the rib region of the bone segmentation result after direction correction based on the connected component analysis results.
[0051] Figure 7 This is a comparison image of the rib area before and after repair in one embodiment;
[0052] Figure 8 A flowchart illustrating one embodiment of determining which of the adjacent vertebral regions of the vertebral mask an abnormal connected region should be merged with;
[0053] Figure 9 This is a comparison image of the vertebral region before and after repair in one embodiment;
[0054] Figure 10 This is a flowchart illustrating pixel value update processing for each pixel in one embodiment.
[0055] Figure 11 This is a comparison image of the upper limb area before and after repair in one embodiment;
[0056] Figure 12 This is a comparison diagram of bone segmentation results before and after repair in one embodiment;
[0057] Figure 13 This is a schematic diagram of a bone segmentation result correction device according to one embodiment;
[0058] Figure 14 This is a schematic diagram of a bone segmentation result correction device according to one embodiment. Detailed Implementation
[0059] The present invention will now be described in further detail with reference to specific embodiments and accompanying drawings. Similar elements in different embodiments are referred to by associated similar element reference numerals. In the following embodiments, many details are described to facilitate a better understanding of this application. However, those skilled in the art will readily recognize that some features may be omitted in different situations, or may be replaced by other elements, materials, or methods. In some cases, certain operations related to this application are not shown or described in the specification. This is to avoid obscuring the core parts of this application with excessive description. For those skilled in the art, detailed description of these related operations is not necessary; they can fully understand the related operations based on the description in the specification and general technical knowledge in the art.
[0060] Furthermore, the features, operations, or characteristics described in the specification can be combined in any suitable manner to form various embodiments. At the same time, the steps or actions in the method description can be rearranged or adjusted in a manner obvious to those skilled in the art. Therefore, the various orders in the specification and drawings are only for the clear description of a particular embodiment and do not imply a necessary order, unless otherwise stated that a particular order must be followed.
[0061] The serial numbers assigned to components in this document, such as "first" and "second," are used only to distinguish the described objects and have no sequential or technical meaning. The terms "connection" and "linkage" used in this application, unless otherwise specified, include both direct and indirect connections (linkages).
[0062] Please refer to Figure 1 This invention provides a method for correcting bone segmentation results, including steps S10 to S50, which are described in detail below.
[0063] Step S10: Obtain bone segmentation results.
[0064] In some embodiments, a deep learning segmentation model is used to perform bone segmentation on computed tomography (CT) images of the human body to obtain bone segmentation results.
[0065] In some embodiments, the bone segmentation result includes multiple distinct skeletal regions segmented from the human body scan image, including vertebral regions, rib regions, and upper limb regions. Each skeletal region contains a different bone mask, which is a bone identified from the human body scan image. Each bone mask has a bone label for unique identification. In some embodiments, to facilitate differentiation of bone masks from the image, each bone mask is assigned a mask value to represent its bone label, with each bone label corresponding to a mask value.
[0066] Please refer to Figure 2 In some embodiments, the skeletal region in the human body scan image selected by the red box is the rib region. This rib region contains different bone masks, meaning it contains multiple identified ribs, each with a bone label. Figure 2 Different mask values are assigned to different bone masks in the rib region, making them appear in different colors to distinguish different bone masks.
[0067] Step S20: Calculate the centroid coordinates of the vertebral region, and use the centroid coordinates as the boundary point to correct the orientation of the skeletal regions with orientation attributes in the bone segmentation result, so as to obtain the orientation-corrected bone segmentation result.
[0068] In some embodiments, because the training dataset used by the TotalSegmentor segmentation framework during model training does not distinguish between left and right orientations, the bone masks in the inferred bone segmentation results also do not distinguish between orientations. In subsequent medical diagnostic tasks, it is impossible to quickly locate the bone based solely on the bone masks. Therefore, it is necessary to correct the orientation of the bone regions with orientation attributes in the bone segmentation results.
[0069] In some embodiments, the expression for the centroid coordinates of the vertebral region is as follows:
[0070]
[0071] Where C(X,Y,Z) represents the coordinates of the centroid of the vertebral region, R represents the sum of the masses of each point in the vertebral region, and ∑ (x,y,z)∈Rx This represents the sum of the products obtained by multiplying the mass of each point in the vertebral region by its x-coordinate, and the sum of the products obtained for each point. ∑ (x,y,z)∈Ry This represents the sum of the products obtained by multiplying the mass of each point in the vertebral region by its y-coordinate, ∑. (x,y,z)∈Rz This represents the sum of the products obtained by multiplying the mass of each point in the vertebral region by its z-axis coordinate, and the sum of the products of each point.
[0072] Please refer to Figure 3 In some embodiments, step S20 uses the centroid coordinate point as the dividing point to correct the orientation of the bone region with orientation attributes in the bone segmentation result, and obtains the orientation-corrected bone segmentation result, including steps S21 to S23, which are described in detail below.
[0073] Step S21: Assign the mask value of all bone masks in the bone region with orientation attributes to the preset first mask value.
[0074] In some embodiments, the skeletal region with orientation attributes refers to the region where the left and right bones are located. The first mask value is the mask value of the left bone mask or the mask value of the right bone mask.
[0075] Step S22: When the first mask value is the mask value of the left bone mask, the mask value of the bone mask located to the right of the centroid coordinate point in the bone region with orientation attribute is assigned the mask value of the right bone mask.
[0076] Step S23: When the first mask value is the mask value of the right bone mask, the mask value of the bone mask located to the left of the centroid coordinate point in the bone region with orientation attribute is assigned the mask value of the left bone mask.
[0077] Please refer to Figure 4 , Figure 4 It contains two pairs of scapulae, among which, Figure 4 The pair of scapulae on the left correspond to the scapular region in the bone segmentation results. Within this scapula, excluding the areas highlighted by the two red boxes, the orientation of other areas is disordered. Figure 4 The bone labels of the bone masks are identified by different colors. As shown in the figure, the left scapula in the pair of scapulae on the left contains more than one bone mask, and the correct bone mask should be the mask marked by the red box in the lower left of the scapula. Therefore, the orientation of the scapula needs to be corrected. Figure 4 In the scapular region of the right scapula after orientation correction, it can be seen that the misaligned area highlighted in red in the left scapula has been corrected.
[0078] Please refer to Figure 5 , Figure 5 It includes the lower limb region from the bone segmentation results before and after direction correction, where... Figure 5 The left side shows the lower limb region in the bone segmentation results. Figure 5 The right side shows the lower limb area after orientation correction.
[0079] Step S30: For the rib region in the bone segmentation result after orientation correction, unify the bone label of each rib mask to obtain the rib mask image. Perform connected component analysis on the rib mask image to obtain the number of connected components in the rib mask image. When the number of connected components does not meet the normal range of the number of ribs, perform connected component analysis on the image region corresponding to each rib mask to obtain the connected component analysis result of the image region corresponding to each rib mask. Based on the connected component analysis result, repair each rib mask in the rib region of the bone segmentation result after orientation correction to obtain the repaired rib region.
[0080] In some embodiments, because the training image is cut into small pieces and then input into the depth segmentation model in batches for calculation when using the depth segmentation model, the depth segmentation model is unable to understand the spatial relationship between ribs to a certain extent. This leads to large-scale misalignment of the rib mask and the appearance of segmentation noise. Therefore, it is necessary to repair the rib region in the bone segmentation result after orientation correction.
[0081] In some embodiments, the bone labels of each rib mask in the rib region are unified to obtain a rib mask image. Connected component analysis is then performed on the rib mask image to obtain a connected component image of the rib mask image. The number of connected components in the rib mask image can be obtained from the connected component image of the rib mask image. When the number of connected components does not meet the normal range for the number of ribs, it indicates that there is a rib segmentation error in the rib mask image. Therefore, it is necessary to perform connected component analysis on the image region corresponding to each rib mask separately to accurately locate the erroneous rib mask for subsequent rib repair.
[0082] In some embodiments, the normal number of ribs ranges from [22, 24].
[0083] In some embodiments, connected component analysis is performed on the image region corresponding to each rib mask to obtain the connected component analysis result for each image region corresponding to each rib mask. The connected component analysis result for each image region corresponding to each rib mask includes the connected component image of each image region and the number of connected components corresponding to the connected component image.
[0084] Please refer to Figure 6 In some embodiments, step S30 repairs each rib mask in the rib region of the bone segmentation result after direction correction based on the connected component analysis results to obtain the repaired rib region, including steps S31 to S32, which are described in detail below.
[0085] Step S31: When the number of connected components corresponding to the connected component image is greater than the preset second threshold, the connected component with the largest area in the connected component image is retained, and all connected components except the connected component with the largest area are eliminated to obtain the connected component image of the image region corresponding to each rib mask after processing.
[0086] In some embodiments, the second threshold is 1. When the number of connected components corresponding to the connected component image is greater than 1, it indicates that there is more than one connected component in the connected component image of the image region corresponding to the rib mask, while there is only one connected component in the connected component image of the image region corresponding to the normal rib mask. That is, the image region corresponding to the rib mask is considered as a complete connected component. In this case, for rib masks with a number of connected components greater than 1, the connected component with the largest area in its connected component image is retained, while all connected components other than the one with the largest area are eliminated. That is, the abnormally segmented regions are eliminated, and only the part with the largest area of the connected component is retained as the connected component image of the image region corresponding to the processed rib mask.
[0087] Step S32: Calculate the reference coordinates of the connected component images of the image region corresponding to each rib mask after processing. Sort the connected component images of the image region corresponding to each rib mask after processing according to the size of the reference coordinates, and assign mask values to each connected component image in order.
[0088] Specifically, firstly, the reference coordinates of the connected component image of the image region corresponding to each rib mask after processing are calculated. Then, the connected component images of the image region corresponding to each rib mask after processing are sorted according to the size of the reference coordinates. Finally, the predefined rib mask values are assigned to the connected component images of the image region corresponding to each rib mask after processing in the order of sorting, thus obtaining the repaired rib region.
[0089] In some embodiments, the reference coordinates are the Z-axis coordinates of the centroid of the connected component image of the image region corresponding to each processed rib mask. Since the arrangement order of multiple rib masks is shuffled during the aforementioned connected component analysis, it is necessary to sort the connected component images of the image region corresponding to each processed rib mask according to the magnitude of the reference coordinates. The rib mask values represent the bone labels of the rib masks. Predefined rib mask values are assigned sequentially to the connected component images of the image region corresponding to each processed rib mask according to the sorting order, resulting in repaired rib regions that follow the normal rib arrangement order in anatomical prior knowledge.
[0090] Please refer to Figure 7 , Figure 7 The left side shows the rib region in the bone segmentation results, where different bone labels are identified by different colors. Normally, each rib should correspond to one rib mask, have only one bone label, and be identified by one color. Figure 7 The mid-bone segmentation result contained an error; some ribs were segmented into multiple bone masks with more than one bone label, that is, their masks were identified by more than one color. Figure 7The right side shows the repaired rib area. Each rib contains only one bone tag, meaning that each rib is identified by a color to indicate its corresponding bone tag.
[0091] Step S40: For the vertebral region in the bone segmentation result after direction correction, perform connected component analysis on the image region corresponding to each vertebral mask to obtain the number of connected components in the image region corresponding to each vertebral mask. When the number of connected components in the image region corresponding to a certain vertebral mask is greater than a preset first threshold, the connected components in the image region corresponding to that vertebral mask other than the largest connected component are regarded as abnormal connected components. Determine which of the adjacent vertebral regions of the abnormal connected component should be merged with the vertebral mask and repair the vertebral mask according to the judgment result to obtain the repaired vertebral region.
[0092] In some embodiments, in the vertebral region of the bone segmentation result after direction correction, each vertebral mask will also have different degrees of misalignment and abnormal segmentation. Unlike the smooth and separated characteristics of each rib mask in the rib region, the segmentation result in the vertebral region has a complex structure and each vertebral mask is in contact with each other, so it cannot be processed by conventional connected component analysis methods.
[0093] In some embodiments, the vertebral region includes multiple different vertebral masks connected in a spatial order from top to bottom. Connectivity analysis is performed on the image region corresponding to each vertebral mask to obtain a connected component image of the image region corresponding to each vertebral mask. The number of connected components can be determined from this image. Since the connected component image of the image region corresponding to a vertebral mask after normal bone segmentation contains only one connected component, a first threshold is set to 1. When the number of connected components in the image region corresponding to a certain vertebral mask is greater than 1, the connected components in the image region corresponding to that vertebral mask, excluding the largest connected component, are considered abnormal connected components.
[0094] In some embodiments, the adjacent vertebral region includes the image region corresponding to the vertebral mask that is adjacent to the vertebral mask with a number of connected regions greater than a preset first threshold in the upper and lower space.
[0095] In some embodiments, the adjacent vertebral region includes a first adjacent vertebral region and a second adjacent vertebral region. The first adjacent vertebral region is the image region corresponding to a vertebral mask that is adjacent to a vertebral mask with a number of connected domains greater than a preset first threshold in the upper space. The second adjacent vertebral region is the image region corresponding to a vertebral mask that is adjacent to a vertebral mask with a number of connected domains greater than a preset first threshold in the lower space.
[0096] Please refer to Figure 8In some embodiments, step S40 determines which of the adjacent vertebral regions of the vertebral mask the abnormal connected region should be merged with, including steps S41 to S47, which are described in detail below.
[0097] Step S41: Replace the mask value of the abnormal connected region with the mask value of the first adjacent vertebral region, and perform connected region analysis on the first adjacent vertebral region to obtain the number of connected regions in the first adjacent vertebral region.
[0098] Step S42: Determine whether the number of connected components in the first adjacent vertebral region is consistent with the number of connected components in the first adjacent vertebral region obtained when performing connected component analysis on the image region corresponding to each vertebral mask, and determine whether the number of connected components in the first adjacent vertebral region is less than a preset third threshold.
[0099] Step S43: When the number of connected components in the first adjacent vertebral region is consistent with the number of connected components in the first adjacent vertebral region obtained when performing connected component analysis on the image region corresponding to each vertebral mask, and the number of connected components in the first adjacent vertebral region is less than the third threshold, it is determined that the abnormal connected components should be merged with the first adjacent vertebral region.
[0100] Step S44: Otherwise, replace the mask value of the abnormal connected region with the mask value of the second adjacent vertebral region, and perform connected region analysis on the second adjacent vertebral region to obtain the number of connected regions in the second adjacent vertebral region.
[0101] Step S45: Determine whether the number of connected components in the second adjacent vertebral region is consistent with the number of connected components in the second adjacent vertebral region obtained when performing connected component analysis on the image region corresponding to each vertebral mask, and determine whether the number of connected components in the second adjacent vertebral region is less than the preset fourth threshold.
[0102] Step S46: When the number of connected components in the second adjacent vertebral region is consistent with the number of connected components in the second adjacent vertebral region obtained when performing connected component analysis on the image region corresponding to each vertebral mask, and the number of connected components in the second adjacent vertebral region is less than the fourth threshold, it is determined that the abnormal connected components should be merged with the second adjacent vertebral region.
[0103] Step S47: Otherwise, calculate the centroid coordinates of the abnormal connected domain, the centroid coordinates of the first adjacent vertebral region, and the centroid coordinates of the second adjacent vertebral region, respectively. Calculate the first centroid distance between the centroid coordinates of the abnormal connected domain and the centroid coordinates of the first adjacent vertebral region, and calculate the second centroid distance between the centroid coordinates of the abnormal connected domain and the centroid coordinates of the second adjacent vertebral region. Determine that the abnormal connected domain should be merged with the adjacent vertebral region corresponding to the smallest centroid distance among the first and second centroid distances.
[0104] In some embodiments, the vertebral mask is repaired based on the judgment result to obtain a repaired vertebral region, including:
[0105] The skeletal mask of the abnormal connected region is modified to the skeletal mask of the adjacent vertebral region that should be merged into the abnormal connected region, thus obtaining the repaired vertebral region.
[0106] Please refer to Figure 9 , Figure 9 The vertebral region on the left is the vertebral region in the bone segmentation results; the selected area is an abnormal connected region. Figure 9 The right side shows the repaired vertebral region.
[0107] Step S50: For the upper limb region in the bone segmentation result after direction correction, take a randomly selected pixel in the upper limb region as the starting point and the image region corresponding to the abnormal bone mask in the upper limb region as the ending point. Starting from the starting point, traverse the pixels in the upper limb region and update the pixel value of each pixel until the number of connected components in the upper limb region after pixel value update meets the preset number. Then, repair the bone label of the abnormal bone mask to the upper limb bone label.
[0108] In some embodiments, because the bone structures in the upper limb region are small and similar to other bone structures such as the lower limbs or the ends of ribs, the depth segmentation model cannot correctly distinguish the above-mentioned bone structures when performing inference in the form of image blocks. Specifically, in the bone segmentation results, the bone mask of the end of the upper limb region will be incorrectly segmented as the mask of other similar bone structures.
[0109] In some embodiments, for the upper limb region in the bone segmentation result after direction correction, before repairing the abnormal bone mask in the upper limb region, the mask value of the scapular mask of the scapula region connected to the upper limb region is saved. After saving the scapular mask value, the scapular mask value is set to zero. This ensures that when traversing the pixels in the upper limb region from the starting point and updating the pixel value of each pixel, the scapular mask value of the scapula region is equal to the background mask value. Therefore, the scapula region is not incorrectly segmented as the upper limb region. Simultaneously, after repairing the bone label of the abnormal bone mask to the upper limb bone label, the mask value of the scapular mask is restored to the saved scapular mask value. The bone label of the abnormal bone mask is different from the upper limb bone label.
[0110] Please refer to Figure 10 In some embodiments, step S50 updates the pixel value of each pixel, including steps S51 to S53, which are described in detail below.
[0111] Step S51: Determine the relationship between the pixel value of each pixel and the preset upper limb threshold.
[0112] In some embodiments, the upper limb threshold is the difference between the mask value of the upper limb region and the preset background mask value.
[0113] In some embodiments, the background mask value is 0.
[0114] Step S52: When the pixel value of a pixel is less than or equal to the upper limb threshold, the pixel value of that pixel is assigned as the mask value of the upper limb region. The mask value of the upper limb region is the mask value corresponding to the upper limb bone label.
[0115] Step S53: When the pixel value of a pixel is greater than the upper limb threshold, stop performing pixel update processing.
[0116] In some embodiments, connected component analysis is performed on the upper limb region after pixel value update processing to obtain the connected components of the upper limb region. If the number of connected components meets the preset number, it indicates that the abnormal bone mask in the upper limb region has been repaired into an upper limb bone label, thereby completing the repair of the upper limb region.
[0117] In some embodiments, the preset number is 1.
[0118] Please refer to Figure 11 In some embodiments, Figure 11 The left side shows the upper limb region from the bone segmentation results. Figure 11 The right side shows the repaired upper limb area. The area highlighted in red is the image region corresponding to the abnormal bone mask.
[0119] Please refer to Figure 12 In some embodiments, Figure 12 The left side shows the bone segmentation results. Figure 12 The right side shows the repaired bone segmentation result. For the orientation-corrected bone segmentation result, the repaired rib region, the repaired vertebral region, and the repaired upper limb region are fused to obtain the repaired bone segmentation result. Compared with the bone segmentation result output by the depth segmentation model, the repaired bone segmentation result is more accurate.
[0120] In some embodiments, the core technology of the bone segmentation result correction method of this application has two points: 1) The processing process combines skeletal anatomical features: In each bone mask processing flow, not only the bone structure corresponding to the abnormal bone mask is referenced, but also the bone structure associated with it is referenced, and the morphological order relationship between bone masks is effectively combined, making the processing result more reasonable and accurate. 2) Using anatomical prior knowledge to constrain the processing process: In the correction process, anatomical prior knowledge is used to constrain the variation range of the image mask in terms of shape and position, thereby effectively limiting the error in post-processing. Compared with the existing whole-body bone segmentation post-processing methods, the bone segmentation result correction method of this application sets a reasonable correction order, ensuring the coherence and efficiency of the entire correction process, and realizing a coarse-to-fine optimization process. The correction accuracy is higher, the edges of the correction result are smoother and more fluid, and unnatural abrupt changes are avoided, so that the final bone segmentation correction result is more consistent with the real bone structure. At the same time, the processing process combines skeletal structural features, avoids invalid iterations, improves processing speed and efficiency, and realizes rapid image processing.
[0121] Please refer to Figure 13 In some embodiments, a bone segmentation result correction device includes a result acquisition module 10, a direction correction module 20, a rib correction module 30, a vertebral correction module 40, and an upper limb correction module 50, which are described in detail below.
[0122] Result acquisition module 10 is used to acquire bone segmentation results.
[0123] In some embodiments, the bone segmentation result includes multiple different bone regions segmented from the human body scan image. Each bone region contains a different bone mask, which is a bone identified from the human body scan image. Each bone mask has a bone label. The bone regions include vertebral regions, rib regions, and upper limb regions.
[0124] The orientation correction module 20 is used to calculate the centroid coordinates of the vertebral region and use the centroid coordinates as the boundary point to correct the orientation of the skeletal regions with orientation attributes in the bone segmentation result, so as to obtain the orientation-corrected bone segmentation result.
[0125] In some embodiments, the skeletal region with orientation attributes refers to the region where the bones that distinguish left from right are located.
[0126] The rib correction module 30 is used to unify the bone labels of each rib mask in the rib region of the bone segmentation result after direction correction, obtain the rib mask image, perform connected component analysis on the rib mask image to obtain the number of connected components in the rib mask image, when the number of connected components does not meet the normal range of the number of ribs, perform connected component analysis on the image region corresponding to each rib mask separately to obtain the connected component analysis result of the image region corresponding to each rib mask, and repair each rib mask in the rib region of the bone segmentation result after direction correction according to the connected component analysis result to obtain the repaired rib region.
[0127] The vertebral correction module 40 is used to perform connected component analysis on the image region corresponding to each vertebral mask in the bone segmentation result after direction correction, to obtain the number of connected components in the image region corresponding to each vertebral mask. When the number of connected components in the image region corresponding to a certain vertebral mask is greater than a preset first threshold, the connected components in the image region corresponding to the vertebral mask other than the largest connected component are regarded as abnormal connected components. It is determined which of the adjacent vertebral regions of the vertebral mask the abnormal connected component should be merged with, and the vertebral mask is repaired according to the judgment result to obtain the repaired vertebral region.
[0128] In some embodiments, the vertebral region includes multiple different vertebral masks connected in a spatial order from top to bottom, and the adjacent vertebral region includes the image region corresponding to the vertebral mask that is adjacent to the vertebral mask with a number of connected regions greater than a preset first threshold in the upper and lower spatial layers.
[0129] The upper limb correction module 50 is used to, for the upper limb region in the bone segmentation result after direction correction, take a randomly selected pixel in the upper limb region as the starting point and the image region corresponding to the abnormal bone mask in the upper limb region as the ending point, traverse the pixels in the upper limb region from the starting point and perform pixel value update processing on the pixel value of each pixel until the number of connected components in the upper limb region after pixel value update processing meets the preset number, and repair the bone label of the abnormal bone mask to the upper limb bone label.
[0130] In some embodiments, the bone labels of the abnormal bone mask are different from those of the upper limb bones.
[0131] Please refer to Figure 14 Some embodiments provide a bone segmentation result correction device, including:
[0132] Memory 1000 is used to store programs;
[0133] The processor 1100 is configured to implement the bone segmentation result correction method of any embodiment of the present application by executing the program stored in the memory.
[0134] Those skilled in the art will understand that all or part of the functions of the various methods in the above embodiments can be implemented by hardware or by computer programs. When all or part of the functions in the above embodiments are implemented by computer programs, the program can be stored in a computer-readable storage medium, which may include: read-only memory, random access memory, disk, optical disk, hard disk, etc., and the program is executed by a computer to achieve the above functions. For example, the program can be stored in the memory of a device, and when the program in the memory is executed by the processor, all or part of the above functions can be achieved. In addition, when all or part of the functions in the above embodiments are implemented by computer programs, the program can also be stored in a server, another computer, disk, optical disk, flash drive, or external hard drive, etc., and can be downloaded or copied to the memory of a local device, or the system of the local device can be updated. When the program in the memory is executed by the processor, all or part of the functions in the above embodiments can be achieved.
[0135] The above examples illustrate the present invention only to aid in understanding it and are not intended to limit the scope of the invention. Those skilled in the art can make various simple deductions, modifications, or substitutions based on the ideas of this invention.
Claims
1. A method for correcting bone segmentation results, characterized in that, include: Obtain bone segmentation results, wherein the bone segmentation results include multiple different bone regions segmented from the human body scan image, each bone region contains a different bone mask, the bone mask is a bone identified from the human body scan image, each bone mask has a bone label, and the bone regions include vertebral regions, rib regions and upper limb regions; Calculate the centroid coordinates of the vertebral region, and use the centroid coordinates as the dividing point to correct the orientation of the bone regions with orientation attributes in the bone segmentation result, so as to obtain the orientation-corrected bone segmentation result. The bone regions with orientation attributes refer to the regions where the left and right bones are located. For the rib region in the bone segmentation result after direction correction, the bone label of each rib mask is unified to obtain a rib mask image. Connected component analysis is performed on the rib mask image to obtain the number of connected components in the rib mask image. When the number of connected components does not meet the normal range of rib number, connected component analysis is performed on the image region corresponding to each rib mask to obtain the connected component analysis result of the image region corresponding to each rib mask. Based on the connected component analysis result, each rib mask in the rib region of the bone segmentation result after direction correction is repaired to obtain the repaired rib region. For the vertebral region in the bone segmentation result after the direction correction, connected component analysis is performed on the image region corresponding to each vertebral mask to obtain the number of connected components in the image region corresponding to each vertebral mask. When the number of connected components in the image region corresponding to a certain vertebral mask is greater than a preset first threshold, the connected components in the image region corresponding to that vertebral mask, except for the largest connected component, are regarded as abnormal connected components. It is determined which of the adjacent vertebral regions of the vertebral mask should be merged with the abnormal connected component, and the vertebral mask is repaired according to the determination result to obtain the repaired vertebral region. The vertebral region includes multiple different vertebral masks connected in a spatial order from top to bottom. The adjacent vertebral regions include the image regions corresponding to the vertebral masks that are adjacent to the vertebral masks whose number of connected components is greater than the preset first threshold in the upper and lower spatial layers. For the upper limb region in the bone segmentation result after direction correction, a randomly selected pixel in the upper limb region is used as the starting point, and the image region corresponding to the abnormal bone mask in the upper limb region is used as the ending point. Starting from the starting point, the pixels in the upper limb region are traversed, and the pixel value of each pixel is updated until the number of connected components in the upper limb region after pixel value update meets the preset number. The bone label of the abnormal bone mask is then repaired to the upper limb bone label, wherein the bone label of the abnormal bone mask is different from the upper limb bone label. The pixel value update process for each pixel includes: determining the difference between the pixel value of each pixel and a preset upper limb threshold, wherein the upper limb threshold is the difference between the mask value of the upper limb region and a preset background mask value; when the pixel value of the pixel is less than or equal to the upper limb threshold, the pixel value of the pixel is assigned to the mask value of the upper limb region; when the pixel value of the pixel is greater than the upper limb threshold, the pixel update process is stopped.
2. The bone segmentation result correction method as described in claim 1, characterized in that, The connected component analysis result of the image region corresponding to each rib mask includes the connected component image of the image region corresponding to each rib mask and the number of connected components corresponding to the connected component image. The repair process is performed on each rib mask in the rib region of the directionally corrected bone segmentation result based on the connected component analysis result to obtain the repaired rib region, including: When the number of connected components corresponding to the connected component image is greater than a preset second threshold, the connected component with the largest area in the connected component image is retained, and all connected components except the connected component with the largest area are eliminated to obtain the connected component image of the image region corresponding to each rib mask after processing. The reference coordinates of the connected component image of the image region corresponding to each rib mask after processing are calculated. The connected component images of the image region corresponding to each rib mask after processing are sorted according to the magnitude of the reference coordinates. The predefined rib mask values are then assigned to the connected component images of the image region corresponding to each rib mask after processing in the order of the sorting process, thus obtaining the repaired rib region. The reference coordinates are the coordinates of the centroid of the connected component image of the image region corresponding to each rib mask on the Z-axis.
3. The bone segmentation result correction method as described in claim 1, characterized in that, The step of correcting the orientation of bone regions with orientation attributes in the bone segmentation result using the centroid coordinate point as the boundary point to obtain the orientation-corrected bone segmentation result includes: The mask values of all bone masks in the bone region with orientation attributes are assigned to a preset first mask value, wherein the first mask value is the mask value of the left bone mask or the mask value of the right bone mask. When the first mask value is the mask value of the left bone mask, the mask value of the bone mask located to the right of the centroid coordinate point in the bone region with orientation attribute is assigned the mask value of the right bone mask. When the first mask value is the mask value of the right bone mask, the mask value of the bone mask located to the left of the centroid coordinate point in the bone region with orientation attribute is assigned the mask value of the left bone mask; wherein, the mask value is used to represent the bone label of the bone mask.
4. The bone segmentation result correction method as described in claim 1, characterized in that, The adjacent vertebral regions include a first adjacent vertebral region and a second adjacent vertebral region. The first adjacent vertebral region is the image region corresponding to a vertebral mask that is adjacent to a vertebral mask with a number of connected regions greater than a preset first threshold in the upper space. The second adjacent vertebral region is the image region corresponding to a vertebral mask that is adjacent to a vertebral mask with a number of connected regions greater than a preset first threshold in the lower space. The step of determining which of the adjacent vertebral regions of the vertebral mask the abnormal connected region should be merged with includes: Replace the mask value of the abnormal connected region with the mask value of the first adjacent vertebral region, and perform connected region analysis on the first adjacent vertebral region to obtain the number of connected regions in the first adjacent vertebral region. Determine whether the number of connected components in the first adjacent vertebral region is consistent with the number of connected components in the first adjacent vertebral region obtained when performing connected component analysis on the image region corresponding to each vertebral mask, and determine whether the number of connected components in the first adjacent vertebral region is less than a preset third threshold. When the number of connected components in the first adjacent vertebral region is the same as the number of connected components in the first adjacent vertebral region obtained when performing connected component analysis on the image region corresponding to each vertebral mask, and the number of connected components in the first adjacent vertebral region is less than the third threshold, it is determined that the abnormal connected component should be merged with the first adjacent vertebral region. Otherwise, the mask value of the abnormal connected component is replaced with the mask value of the second adjacent vertebral region, and connected component analysis is performed on the second adjacent vertebral region to obtain the number of connected components in the second adjacent vertebral region; Determine whether the number of connected components in the second adjacent vertebral region is consistent with the number of connected components in the second adjacent vertebral region obtained when performing connected component analysis on the image region corresponding to each vertebral mask, and determine whether the number of connected components in the second adjacent vertebral region is less than a preset fourth threshold. When the number of connected components in the second adjacent vertebral region is the same as the number of connected components in the second adjacent vertebral region obtained when performing connected component analysis on the image region corresponding to each vertebral mask, and the number of connected components in the second adjacent vertebral region is less than the fourth threshold, it is determined that the abnormal connected component should be merged with the second adjacent vertebral region. Otherwise, calculate the centroid coordinates of the abnormal connected region, the centroid coordinates of the first adjacent vertebral region, and the centroid coordinates of the second adjacent vertebral region, respectively, and calculate the first centroid distance between the centroid coordinates of the abnormal connected region and the centroid coordinates of the first adjacent vertebral region, and calculate the second centroid distance between the centroid coordinates of the abnormal connected region and the centroid coordinates of the second adjacent vertebral region, and determine that the abnormal connected region should be merged with the adjacent vertebral region corresponding to the smallest centroid distance among the first centroid distance and the second centroid distance.
5. The bone segmentation result correction method as described in claim 1, characterized in that, The process of repairing the vertebral mask based on the judgment result to obtain the repaired vertebral region includes: The skeletal mask of the abnormal connected region is modified to the skeletal mask of the adjacent vertebral region that the abnormal connected region should be merged into, and the repaired vertebral region is obtained.
6. The bone segmentation result correction method as described in claim 1, characterized in that, The background mask value is 0. For the upper limb region in the bone segmentation result after direction correction, before repairing the abnormal bone mask in the upper limb region, the mask value of the scapula mask of the scapula region connected to the upper limb region is saved. After saving the mask value of the scapula mask, the mask value of the scapula mask is set to zero so that when traversing the pixels in the upper limb region from the starting point and updating the pixel value of each pixel, the mask value of the scapula mask of the scapula region is equal to the background mask value.
7. A bone segmentation result correction device, characterized in that, include: The result acquisition module is used to acquire bone segmentation results, wherein the bone segmentation results include multiple different bone regions segmented from the human body scan image, each bone region contains a different bone mask, the bone mask is a bone identified from the human body scan image, each bone mask has a bone label, and the bone regions include vertebral regions, rib regions and upper limb regions. The orientation correction module is used to calculate the centroid coordinates of the vertebral region and use the centroid coordinates as the dividing point to correct the orientation of the bone regions with orientation attributes in the bone segmentation result, so as to obtain the orientation-corrected bone segmentation result. The bone regions with orientation attributes refer to the regions where the left and right bones are located. The rib correction module is used to unify the bone labels of each rib mask in the rib region of the bone segmentation result after direction correction, to obtain a rib mask image, perform connected component analysis on the rib mask image to obtain the number of connected components in the rib mask image, and when the number of connected components does not meet the normal range of the number of ribs, perform connected component analysis on the image region corresponding to each rib mask to obtain the connected component analysis result of the image region corresponding to each rib mask, and repair each rib mask in the rib region of the bone segmentation result after direction correction according to the connected component analysis result to obtain the repaired rib region; The vertebral correction module is used to perform connected component analysis on the image region corresponding to each vertebral mask in the bone segmentation result after direction correction, to obtain the number of connected components in the image region corresponding to each vertebral mask. When the number of connected components in the image region corresponding to a certain vertebral mask is greater than a preset first threshold, the connected components in the image region corresponding to the vertebral mask other than the largest connected component are regarded as abnormal connected components. It is determined which of the adjacent vertebral regions of the vertebral mask should be merged with the abnormal connected component, and the vertebral mask is repaired according to the determination result to obtain the repaired vertebral region. The vertebral region includes multiple different vertebral masks connected in a spatial order from top to bottom. The adjacent vertebral regions include the image regions corresponding to the vertebral masks that are adjacent to the vertebral masks with the number of connected components greater than the preset first threshold in the upper and lower spatial layers. The upper limb correction module is used to process the upper limb region in the bone segmentation result after direction correction. Starting from a randomly selected pixel in the upper limb region as the starting point, and ending at the image region corresponding to the abnormal bone mask in the upper limb region as the ending point, it iterates through the pixels in the upper limb region and updates the pixel value of each pixel until the number of connected components in the upper limb region after pixel value update meets a preset number. The module then repairs the bone label of the abnormal bone mask to an upper limb bone label, wherein the bone label of the abnormal bone mask is different from the upper limb bone label. The pixel value update process for each pixel includes: determining the difference between the pixel value of each pixel and a preset upper limb threshold, where the upper limb threshold is the difference between the mask value of the upper limb region and a preset background mask value; when the pixel value of a pixel is less than or equal to the upper limb threshold, assigning the pixel value of the pixel to the mask value of the upper limb region; and stopping the pixel update process when the pixel value of a pixel is greater than the upper limb threshold.
8. A bone segmentation result correction device, characterized in that, include: Memory, used to store programs; A processor for implementing the bone segmentation result correction method as described in any one of claims 1-6 by executing a program stored in the memory.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program that can be executed by a processor to implement the bone segmentation result correction method as described in any one of claims 1-6.
Citation Information
Patent Citations
Bone segmentation method and device and fracture detection method and device
CN112489005A
Data processing method, device and equipment after skeleton segmentation and readable storage medium
CN116523938A