Shank bone automatic three-dimensional modeling and entity separation method based on DICOM (Digital Imaging and Communications in Medicine) image
By improving the aT-Mask bed removal algorithm and the SDC-HDOI hierarchical search strategy, the problems of scanning bed and osteoporosis noise in DICOM images are solved, achieving efficient and accurate 3D modeling and solid separation of the leg bones, generating lower limb bone models suitable for CAD/3D printing.
Patent Information
- Application Number
- CN202511795535.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-02
- Publication Date
- 2026-03-06
AI Technical Summary
Existing technologies struggle to effectively remove scanning bed artifacts and process noise artifacts caused by osteoporosis and joint adhesions when processing DICOM images, affecting the accuracy and efficiency of leg bone 3D modeling and solid separation.
An improved aT-Mask scanning bed automatic removal algorithm is adopted, combined with a hierarchical DOI search strategy that takes into account spatial distribution (SDC-HDOI), and bone separation and hole repair are achieved through hole boundary localization method and local replacement method, generating a high-quality three-dimensional model of lower limb bones.
It significantly improves the accuracy and robustness of 3D modeling of leg bones, reduces the processing range and improves computational efficiency, and generates a topologically closed, normal-consistent lower limb bone model, which is suitable for subsequent CAD/3D printing and preoperative planning.
Smart Images

Figure CN121616749A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical image processing technology, and in particular to a method for automatic 3D modeling and solid separation of leg bones based on DICOM images. Background Technology
[0002] The assessment and preoperative planning of lower limb deformities in clinical practice increasingly rely on CT-based three-dimensional bone models. Compared with traditional two-dimensional measurements, three-dimensional models can more intuitively reflect the spatial relationships and force line deviations of the femur, tibia, and fibula, facilitating the development of osteotomy and correction plans. Currently, hospital radiology departments generally store lower limb CT images in DICOM format, including slice sequences arranged in the head-to-foot direction. However, due to limitations in examination procedures and equipment structure, the metal scanning bed is inevitably introduced into the field of view during CT scans; at the same time, due to individual differences, osteoporosis, and close proximity of bone surfaces at joints, the original images often exhibit similar gray levels, boundary adhesion, and noise artifacts, posing challenges to automatic modeling and solid separation.
[0003] Our research team has long been reviewing and studying a large amount of relevant data on lower limb 3D modeling technology. Relying on relevant resources and conducting numerous experiments, we discovered existing technologies such as CN110613469A, CN110613469B, CN119919406B, and CN114723897B, including a planning method and device for an intelligent navigation system for tibial osteotomy. The method includes: image segmentation and 3D image reconstruction of medical images of the human lower limb skeleton to obtain a 3D image containing the tibia and fibula; key point identification of the 3D image containing the tibia and fibula to determine the parameter information of the tibial osteotomy site; generating an osteotomy guide plate model based on the parameter information and acquiring the data of the osteotomy guide plate model; and fabricating a high tibial osteotomy guide plate using 3D printing based on the acquired osteotomy guide plate model data.
[0004] This invention was developed to address the shortcomings in the field regarding bed stability, accuracy and efficiency of bone separation, and reliability of post-reconstruction hole repair, which makes it difficult to adapt to complex situations such as diverse bed types, joint adhesions, and double-layered bone shells. Summary of the Invention
[0005] The purpose of this invention is to address the shortcomings existing in the field by proposing an automatic 3D modeling and solid separation method for leg bones based on DICOM images.
[0006] To overcome the shortcomings of the prior art, the present invention adopts the following technical solution: A method for automatic 3D modeling and solid separation of the leg bone based on DICOM images, comprising the following steps: S1. Using DICOM images of the lower limb CT scan as the target, automatically remove the scanning bed while preserving the continuous and clear boundaries of bone tissue, and output the final refined bed-removed image I. cleaned ; S2. Using the refined bed image as the object, the lower limb bone entity separation algorithm SDC-HDOI, which considers spatial distribution and employs a hierarchical DOI, performs a step-by-step search and filtering to complete the separation of the hip and femur, tibia and fibula and foot bones, femur and tibia and fibula, and tibia and fibula. It also removes non-target bones such as the pelvis and foot bones, disconnects the hip, knee, and ankle joints, and outputs the binary voxel sequence M of the target bone. target ; S3, the target bone binary voxel sequence M output in step S22 target As input, MC surface drawing is used to draw eight cube elements by taking four adjacent points from each of two adjacent slices. At a set isovalue threshold, the intersection points of the isosurface and each edge of the cube element are calculated, and the intersection points are connected into triangular patches according to the lookup table rules, thereby extracting the isosurface and generating an initial triangular mesh. Then, Laplacian smoothing and regularization are performed on the initial triangular mesh, and automatic hole detection and filling are performed to complete the topological closure. Finally, the lower limb bone 3D model in OBJ format is exported. In step S3, automatic hole detection and filling are achieved through hole boundary positioning and local replacement methods.
[0007] Furthermore, step S1 is achieved through the following steps: S11: Convert the image's grayscale values to CT values, then adjust the image's window level / width to 1600 / 1000, classifying the portions of the image with CT values less than 0 as the background. For pixels with grayscale values greater than 0 after adjusting the window level / width, set their pixel values to the maximum value, as shown in formula (S-1), generating an aT mask image. Apply the mask image to I... original By using a mask operation, most of the bed structure is removed, leaving only discontinuous small connected regions, thus obtaining the processed image. (S-1) Wherein, the image is a single slice image from a DICOM image sequence, and the image is represented by the symbol I. original express, The maximum grayscale value of the image; GrayValue is the grayscale value after the window level / width is 1600 / 1000; CTValue is the CT value of the image; B(i,j) is the grayscale value of the image at position (i,j); S12: A 3×3 pixel filter window is selected to perform Median filtering on the processed image to complete image denoising. The image grayscale values are converted to a suitable non-linear space using formula (S-2), which enhances the contrast of the intermediate grayscale areas, making the transition area between the bone and the surrounding tissue clearer, and obtaining an enhanced image. (S-2) Where -20 is the brightness offset, C(i,j) is the gray value of the enhanced image, and the Gamma correction coefficient is 2.2; S13: For the enhanced image, an adaptive thresholding method based on local gray-level statistics is used, combined with directional morphological sequence cleansing, along with connected component filtering and pinhole suppression to generate a binary mask image M. final The image is then subjected to fine bed removal and boundary smoothing processing based on the binary mask image, and a fine bed removal image I is output. cleaned .
[0008] Furthermore, step S2 is achieved through the following steps: S21: The DICOM image sequence after the fine de-bed processing in step S1 is denoted as , where z is the slice index, and the fine de-bed image with slice index s is represented as I. s For each slice I s Perform morphological dilation and use a threshold Binarization is performed to generate a preliminary skeleton mask B. s (x,y), and then according to the proportion of center / periphery and total foreground pixels along the slice index from head to foot, slices before the spinal feature area and after the boneless blank area are removed to obtain the cropped fine bed-removed body image sequence {I′s}. S22: with {I′s} and B s Let (x, y) be the object, and {I′s} have a total of N slices. total The primary regions of interest (Pri-DOIs) for the hip, knee, and ankle joints are automatically determined according to a preset ratio to limit the processing area. When the number and location of connected components do not match the anatomical prior, secondary regions of interest (Sec-DOIs) are established for local refinement. Within the Pri-DOI and Sec-DOIs, a hierarchical DOI separation strategy that takes into account spatial distribution is used to perform connected component search and filtering by number, area, and location. If necessary, interactive boundary mapping and masking operations are used to sequentially complete the separation of hip bone-femur, tibia-fibula-foot bones, femur-tibia-fibula, and tibia-fibula. The pelvis and foot bones are removed, and decoupling is achieved at the hip, knee, and ankle joints. Finally, the binary voxel sequence M of the target bone is output. targe .
[0009] Furthermore, the hole boundary positioning method is achieved through the following steps: S31: Input an initial triangular mesh with holes, first search for the edges of the holes; S32: Parallel traverse all triangular faces of the initial triangular mesh, starting from the first triangular face and matching faces according to common edges until the last triangular face, find all adjacent faces, record the adjacency relationship between triangular faces, generate a triangular face information set Fs, and construct an edge set Es from the three undirected edges of each triangular face. S33: Traverse all vertices v of the initial triangular mesh of the lower limb bone 3D model, summarize the associated edges and faces, generate a vertex information set Vs, and use the three sets of structures (Fs,Es,Vs) to completely describe the mesh topology, providing a data foundation for the subsequent fast and accurate tracking and closure of hole boundaries; S34: Select a common edge AC from the edge set Es, and the adjacent triangular faces △ABC and △ACD on both sides of the common edge. (x1,y1,z1) and (x3,y3,z3) are the coordinates of points A and C on the common edge AC, respectively; (x2,y2,z2) are the coordinates of the third vertex B of the adjacent triangular face △ABC, and (x4,y4,z4) are the coordinates of the third vertex D of the adjacent triangular face △ACD. Project points B and D onto line AC according to formula (S4-1) to obtain the foot of the perpendicular P. B With P D Then, construct the orthogonal vectors n1 and n2 according to equation (S4-2), and calculate the dihedral angle θ of adjacent triangular faces △ABC and △ACD using equation (S4-3). If the value of the dihedral angle θ is less than the threshold of 15°, then the common side AC is included in the hole boundary set. (S4-1) Among them, (x B ,y B ,z B ) is P B The coordinates, (x D ,y D ,z D ) is P D The coordinates; (S4-2) (S4-3) S35: Based on the triangular faces associated with the vertex, continue searching for adjacent hole boundary lines until the boundary lines close to complete the location of a hole boundary.
[0010] Furthermore, the local replacement method is implemented through the following steps: S41: After locating the hole boundary using the hole boundary positioning method, the two endpoints of a common edge on the boundary uniquely determine the adjacent triangular faces △ABC and △ACD on both sides. Based on the coordinate correspondence between the 2D image and the 3D model points during modeling, the vertices of these two triangular faces are projected back onto the image I. original This yields the corresponding Region of Interest (ROI). S42: Re-binarize the ROI with a calculation threshold smaller than 110, T local The threshold calculation model for (x,y) is: T local (x,y)=μ(x,y)+t×σ(x,y), then perform morphological expansion and contraction operations, connect the breakpoints to eliminate burrs; Where μ(x,y) and σ(x,y) are the mean and standard deviation of gray levels within a 15×15 pixel window centered at (x,y) in the ROI, respectively, and t is an empirically obtained adjustment coefficient in the range of 0.2–0.6. The largest connected component in the processed image is extracted, and an optimized binary mask is generated as the local mask M using a skeleton thinning algorithm. ROI If the local mask M ROI If the number of connected components is greater than 1, it indicates that the original erroneous connection has been corrected; otherwise, the threshold is reduced iteratively with a step size of 5, and step S42 is repeated until effective separation is achieved. S43: Using the final local mask M ROI A masking operation is performed on the ROI in the image to obtain a corrected local image of bone tissue. Using voxel sub-blocks of local bone tissue images as input, a new set of triangular patches is locally reconstructed using the moving cube algorithm. Topological or geometric consistency constraints are applied to the boundaries of the new patches and the original model: normal consistency, boundary vertex correspondence, edge length and face angle threshold checks, and seamless embedding and overlap, as well as degenerate face removal, to achieve accurate hole repair and topological closure.
[0011] The beneficial effects achieved by this invention are: 1. An improved aT-Mask scanning bed automatic removal algorithm is proposed: through multi-stage grayscale preprocessing, adaptive threshold segmentation and directional morphological purification, different styles of metal scanning beds are robustly removed without damaging the continuity of bone tissue boundaries, which significantly improves the accuracy and robustness of subsequent segmentation and 3D reconstruction.
[0012] 2. A hierarchical DOI search strategy that takes into account spatial distribution (SDC-SS) is proposed and applied to lower limb bone separation in SDC-HDOI: Combining anatomical priors of hip / knee / ankle with constraints on the number / area / position of connected components, supplemented by multi-view observation and necessary interactive boundary mapping, the femur, tibia, and fibula can be separated quickly and accurately, while pelvic and foot bones are removed and decoupled at the joints; this hierarchical localization can significantly reduce the search range of the entire sequence and improve the overall computational efficiency (in practice, it can reduce the processing range by about 50% and improve the efficiency by about 40%).
[0013] 3. A model-image matching hole repair algorithm is proposed: the hole region of the 3D model is reverse mapped to the original DICOM slice. After local threshold resegmentation and morphological processing, local MarchingCubes reconstruction is used and the facets are seamlessly replaced. The algorithm automatically and batch repairs small holes caused by osteoporosis and noise, and obtains a lower limb bone model with topological closure, consistent normals and excellent mesh quality. This significantly improves the integrity and visualization quality of the model and is suitable for subsequent CAD / 3D printing and preoperative planning. Attached Figure Description
[0014] The invention will be further understood from the following description taken in conjunction with the accompanying drawings. The components in the drawings are not necessarily drawn to scale, but rather the emphasis is on illustrating the principles of the embodiments. In different views, the same reference numerals designate corresponding parts.
[0015] Figure 1 This is a flowchart illustrating step S1 of the present invention.
[0016] Figure 2 This is an experimental demonstration diagram of step S34 of the present invention.
[0017] Figure 3 This is a comparative experimental diagram showing the process before and after step S1 of the present invention.
[0018] Figure 4 This is a comparative experimental diagram showing the process before and after step S2 of the present invention.
[0019] Figure 5 This is a comparison diagram of the experiment before and after the treatment in step 3 of the present invention. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to its embodiments. It should be noted that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of this invention. Other systems, methods, and / or features of this embodiment will become apparent to those skilled in the art after reviewing the following detailed description. Furthermore, the terminology used to describe positional relationships in the accompanying drawings is for illustrative purposes only and should not be construed as limiting this patent. Those skilled in the art can understand the specific meaning of the above terms according to the specific circumstances.
[0021] Example 1: Combined with Appendix Figure 1 Appendix Figure 2 Appendix Figure 3 Appendix Figure 4 and attached Figure 5 This embodiment constructs an automatic 3D modeling and solid separation method for leg bones based on DICOM images. The automatic 3D modeling and solid separation method for leg bones based on DICOM images includes the following steps: S1. Using DICOM images of the lower limb CT scan as the target, automatically remove the scanning bed while preserving the continuous and clear boundaries of bone tissue, and output the final refined bed-removed image I. cleaned .
[0022] S2. Using the refined bed image as the object, the lower limb bone entity separation algorithm SDC-HDOI, which considers spatial distribution and employs a hierarchical DOI, performs a step-by-step search and filtering to complete the separation of the hip and femur, tibia and fibula and foot bones, femur and tibia and fibula, and tibia and fibula. It also removes non-target bones such as the pelvis and foot bones, disconnects the hip, knee, and ankle joints, and outputs the binary voxel sequence M of the target bone. target ; S3, the target bone binary voxel sequence M output in step S22 target As input, MC surface drawing is used to draw eight cube elements by taking four adjacent points from each of two adjacent slices. At a set isovalue threshold, the intersection points of the isosurface and each edge of the cube element are calculated, and the intersection points are connected into triangular patches according to the lookup table rules, thereby extracting the isosurface and generating an initial triangular mesh. Then, Laplacian smoothing and regularization are performed on the initial triangular mesh, and automatic hole detection and filling are performed to complete the topological closure. Finally, the lower limb bone 3D model in OBJ format is exported. In step S3, automatic hole detection and filling are achieved through hole boundary positioning and local replacement methods.
[0023] Step S1 is achieved through the following steps S11-S13: S11: Convert the image's grayscale values to CT values, then adjust the image's window level / width to 1600 / 1000 (at this window level / width, the bed's brightness is weakest, making bed removal possible), classifying the portion of the image with CT values less than 0 as background. After adjusting the window level / width, set the pixel values of pixels with grayscale values greater than 0 to their maximum values, as shown in formula (S-1), generating an aT mask image. Apply the mask image to I... original By using a mask operation, most of the bed structure is removed, leaving only discontinuous small connected regions, thus obtaining the processed image. (S-1) Wherein, the image is a single slice image from a DICOM image sequence, and the image is represented by the symbol I. original express, The maximum grayscale value of the image; GrayValue is the grayscale value after the window level / width is 1600 / 1000; CTValue is the CT value of the image, and B(i,j) is the grayscale value of the image at position (i,j).
[0024] After roughing out the aT mask image, noise exists in the processed image. In addition, some bone edges are not obvious, which will directly affect the subsequent reconstruction of the 3D model. Therefore, we still need to perform smoothing and contrast adjustment in step S12.
[0025] S12: A 3×3 pixel filter window is selected to perform Median filtering on the processed image to complete image denoising. The image grayscale values are converted to a suitable non-linear space using formula (S-2), which enhances the contrast of the intermediate grayscale areas, making the transition area between the bone and the surrounding tissue clearer, and obtaining an enhanced image. (S-2) Where -20 is the brightness offset, C(i,j) is the gray value of the enhanced image, and the Gamma correction coefficient is 2.2.
[0026] S13: For the enhanced image, an adaptive thresholding method based on local gray-level statistics is used, combined with directional morphological sequence cleansing, along with connected component filtering and pinhole suppression to generate a binary mask image M. final The image is then subjected to fine bed removal and boundary smoothing processing based on the binary mask image, and a fine bed removal image I is output. cleaned .
[0027] Specifically, step S13 is achieved through steps S131-S134: S131: An adaptive threshold segmentation algorithm based on local gray-level statistics is used for the smoothed enhanced image. Specifically, the enhanced image is divided into multiple local windows (e.g., (pixels), calculate the grayscale mean and standard deviation within each window, and dynamically generate local thresholds, as shown in formula (S-3).
[0028] (S-3) Where: T(i,j), μ(i,j), and σ(i,j) are the local threshold, gray mean, and standard deviation within the local window centered on image (i,j), respectively; the size of the local window is 32×32 pixels, which was determined experimentally based on the resolution of the enhanced image and the size of the skeletal structure; k is an adjustment coefficient with a value range of [1.0, 1.5].
[0029] The image is binarized based on the local threshold, and the resulting binary image effectively handles areas with uneven gray levels, improving the separation accuracy between the bed and the skeleton.
[0030] S132: Binary image B obtained after adaptive threshold segmentation adaptive A series of improved morphological operations are performed to purify connected components: a circular structuring element B with a radius of 1 pixel is used. disk(1) For binary image B adaptive Perform corrosion calculation: E1=B adaptive B disk(1) ; Using the same structural element pair Perform the expansion operation: D1 = E1 ⊕ B disk(1) To restore the volume lost by bone due to erosion and smooth the edges; To specifically address bone adhesions in a particular direction, a 3-pixel long, horizontally oriented (...) element was used. The linear structural element B) line(3,0) right Perform a secondary corrosion calculation: E2 = D1 B line(3,0) ; Use a circular structural element B with a radius of 1 pixel. disk(1) right Perform the final dilation operation and output the purified binary image D. final :D final= E2⊕B disk(1) This sequence operation effectively removes noise and breaks pseudo-connections while preserving the integrity of the original skeletal structure to the greatest extent.
[0031] S133: Regarding D final Connectivity analysis is performed, and the image is labeled using the 8-neighborhood connectivity rule to obtain a label graph L(i,j). The R value for each connected component is then calculated. k pixel area A kBased on the minimum bounding rectangle position, the top N candidate skeletal connected components are retained in descending order of area. The value of N is set according to the prior anatomical location, and a dynamic area threshold T is set. area :T area =0.001×max(A k ), delete all areas smaller than T area The connected components are then extracted, and the outer contours of the retained connected components are determined. Internal holes in the outer contours are then filled only if their area is less than T. area Holes are added to eliminate noise interference while preserving the true anatomical structure gaps. All processed contour regions are then merged to generate the final binary mask image M. final It is used for subsequent fine removal bed operations.
[0032] Where, max(A) k The value that has the largest pixel area among all connected domains.
[0033] S134: Using the generated binary mask image M final For the image I original Fine-tuning of the skeleton: For pixel regions with a value of 1 in the binary mask image, the grayscale values of the original image are directly retained to complete the extraction of the main skeleton. cleaned (i,j)=B(i,j)×M final (i,j), To eliminate jagged artifacts at the boundaries of binary mask images, the edges of skeletal regions in the binary mask image are processed (by calculating...). The distance transformation is determined and smoothing is performed on each edge pixel ( Generate a distance-based weight coefficient α(i,j). Then use the weight coefficient to perform alpha fusion with the image: I cleaned (i,j)=B(i,j)×α(i,j). This operation creates a smooth grayscale transition at the bone boundaries, significantly improving the visual quality and geometric accuracy of the subsequent 3D model surface. The final refined image of the skeleton is output. .
[0034] Among them, I cleaned (i,j) represents the gray value of the image at position (i,j), M final (i,j) is the gray value of the binary mask image at position (i,j), and B(i,j) is the gray value of the image at position (i,j).
[0035] When capturing CT images, the metal bed of the CT scan bed is inevitably included. However, the ultimate goal is to construct a complete 3D model of the lower limb bones, which requires removing the bed portion without damaging the lower limb bone image. Current challenges in bed removal include: the U-shaped bed and the different bed styles of various instruments make uniform removal by cutting impossible; while adjusting the window level / width can highlight the lower limb bones and downplay other parts of the human body in the image, the metal bed and human bones have similar brightness at the same window level / width, making them difficult to distinguish and even harder to remove completely. Simple threshold extraction algorithms are not feasible in this situation. Therefore, step S1 of this invention proposes an improved aT-Mask (adaptiveThreshold-Mask) bed removal algorithm, which uses the aT mask generated by the algorithm to remove the metal bed of various CT scan beds.
[0036] The bed removal algorithm based on improved aT-Mask proposed in this invention can completely and efficiently remove various metal scanning beds from images, and is applicable to scanning equipment from different manufacturers and styles, such as... Figure 5 As shown, the image after bed removal effectively avoids the influence of bed artifacts on subsequent processing. Compared with existing skull bed removal algorithms, this invention, based on step S1, specifically targets the characteristics of multi-connected regions in the lower limb bones, avoiding the problem of missing bone extraction caused by region growing methods. Moreover, it can still maintain good performance when processing shorter contours such as the fibula and tibia. Actual tests show that the accuracy of bed removal on different datasets reaches over 98%, which is significantly better than traditional thresholding and contour extraction methods.
[0037] Example 2: Combined with Appendix Figure 1 Appendix Figure 2 Appendix Figure 3 Appendix Figure 4 and attached Figure 5 In addition to the content of the above embodiments, step S2 is implemented through the following steps S21 and S22: S21: The DICOM image sequence after the fine de-bed processing in step S1 is denoted as , where z is the slice index, and the fine de-bed image with slice index s is represented as I. s For each slice I s Perform morphological dilation and use a threshold Binarization is performed to generate a preliminary skeleton mask B. s (x,y), and then according to the proportion of center / periphery and total foreground pixels along the slice index from head to foot, slices before the spinal feature area and after the boneless blank area are removed to obtain the cropped fine bed-removed body image sequence {I′s}.
[0038] Specifically, the DICOM image sequence after the bed-body processing in step S1 is denoted as {I}. s}, where s is the slice index, and the fine-grained body image with slice index s is represented as I. s To compensate for some volumetric effects, morphological dilation is used for enhancement to obtain a dilated image. The radius of the structuring element... Based on the physical resolution R of the image xy (mm / pixel) and slice spacing D s (mm) Adaptive determination: K_radius=⌈D s / (2×R xy )⌉ .
[0039] For dilated images, a threshold is applied. Binarization is performed to generate a preliminary skeleton mask B. s (x, y), where 1 represents the skeleton and 0 represents the background. Starting from the head (s=0) and moving towards the feet, calculate the foreground pixel ratio between the center and surrounding areas of each slice mask. When continuous... The proportion of slices with a central area is significantly higher than that of the surrounding area (P). center (s)>P periphery (s) and P center (s)>T ratio When the area is identified as a spinal feature region, all slices preceding this location are removed. From the foot (s max Traverse towards the head, when consecutive The total foreground pixel ratio of the slice P total (s) <T foot At that time, it was determined to be a blank area without skeleton, and all slices after this position were removed to obtain the cropped fine body image sequence {I' s}
[0040] S22: with {I′s} and B s Let (x, y) be the object, and {I′s} have a total of N slices. total The primary regions of interest (Pri-DOIs) for the hip, knee, and ankle joints are automatically determined according to a preset ratio to limit the processing area. When the number and location of connected components do not match the anatomical prior, secondary regions of interest (Sec-DOIs) are established for local refinement. Within the Pri-DOI and Sec-DOIs, a hierarchical DOI separation strategy that takes into account spatial distribution is used to perform connected component search and filtering by number, area, and location. If necessary, interactive boundary mapping and masking operations are used to sequentially complete the separation of hip bone-femur, tibia-fibula-foot bones, femur-tibia-fibula, and tibia-fibula. The pelvis and foot bones are removed, and decoupling is achieved at the hip, knee, and ankle joints. Finally, the binary voxel sequence M of the target bone is output. targe .
[0041] Due to factors such as bone compression and osteoporosis, over-segmentation or fragmented segmentation may occur during bone separation. Therefore, simply setting a threshold is insufficient for perfect segmentation. This invention employs a step-by-step search separation algorithm that considers spatial distribution for bone separation. The specific steps in step S22 include steps S221-S226: S221. Preliminary segmentation of the region of interest (DOI): The hip, knee, and ankle joints are key locations for skeletal separation. Regardless of whether the condition is normal or deformed, their spatial positions within the entire lower limb skeleton are relatively fixed. To improve computational efficiency, this algorithm first extracts the regions of interest (ROIs) located at these key locations, referred to as the primary region of interest (Pri-DOI). The starting slice index for the hip joint ROI (Hip Joint Pri-DOI) is located from the top of the entire lower limb skeleton to one-fifth of its length. hip start With end slice index hip end Determined by the following formula: Index hip start =0, Index hip end =floor(N total *0.2).
[0042] The starting slice index for the region of interest (Knee joint Pri-DOI) is located from 3 / 8 to 5 / 8. knee start With end slice index knee end Determined by the following formula: Index knee start =floor(N total *0.375), Index knee end =floor(N total *0.625).
[0043] The starting slice index for the ankle joint Pri-DOI is located from the base to four-fifths of the entire lower limb bone. ankle start With end slice index ankle end Determined by the following formula: Index ankle start =floor(N total *0.8), Index ankle end =N total -1.
[0044] The hip, knee, and ankle joints, as key connection points of the lower limb skeleton, possess anatomically stable relative spatial positions within the entire lower limb bone sequence. Based on this prior knowledge, this invention proposes the concept of a primary region of interest (Pri-DOI). By automatically locating and defining these key regions before segmentation, a full sequence search is avoided, thereby significantly improving the computational efficiency of subsequent separation algorithms.
[0045] Obtain the cropped fine body image sequence {I' s The total number of slices is N. total The slice index range for each Pri-DOI is automatically calculated using the following mathematical formula: a. Hip joint Pri-DOI: Index_hip_start=0, Index_hip_end=floor(N total *0.2).
[0046] b. Knee joint Pri-DOI: Index_knee_start=floor(N total *0.375), Index_knee_end=floor(N total *0.625).
[0047] c. Ankle joint Pri-DOI: Index_ankle_start=floor(N total *0.8), Index_ankle_end=N total -1.
[0048] Here, * is the multiplication sign, and floor() is the floor function to ensure that the index is an integer. This S221 step transforms anatomical knowledge into precise, programmable mathematical rules, realizing adaptive limitation of the processing area. According to tests, this S221 step can reduce the processing range of subsequent computationally intensive algorithms by about 50% and improve the overall computing efficiency by more than 40%, laying the foundation for rapid 3D modeling.
[0049] S222, Separation of the hip and femur: An 8-neighborhood connected component search was used to search for connected regions in the region of interest (ROI) of the hip joint. Since the two femurs are located on the lower sides of the ROI image, with the middle part being the background, and the lowermost part of the ROI has relatively simple components, consisting only of large connected regions of the femurs, a search strategy was adopted that started from the bottom up and from the middle outwards to eliminate small connected regions formed by factors such as metal objects on clothing and image noise.
[0050] When searching upwards to the hip bone region, the binary image may contain 1 to 5 connected regions. Based on the spatial distribution of the femur across all slice images—that is, the femoral head is usually located on the far left and far right sides of the image—the algorithm first identifies and retains the two largest connected regions on the left and right sides from the bottom of the image, while removing the remaining smaller connected regions, thus generating an initial mask image. As the search progresses layer by layer, if more or fewer than two large connected regions appear on the left and right sides in a certain layer, it is determined that the system has entered a complex region of connection between the femoral head and the hip bone. At this point, the system automatically establishes a new secondary region of interest (Sec-DOI) at this location, with a height of 1 / 5 of the height of the primary region of interest for the hip joint. Within this Sec-DOI range, residual small connected regions are further removed to generate an optimized mask image, achieving accurate extraction of the femoral structure.
[0051] To ensure the quality of hip and femur separation, adjacent binary and slice images within the region of interest (ROI) are connected to generate observation views, which are divided into a frontal view and a lateral view. Since adjacent slice images are the same size and present adjacent hip joint areas, the horizontal center portion of the connected regions preserved in adjacent mask images is taken, with a width set to half the number of pixels converted from the slice gap (rounded up). The horizontal center portions of the connected regions in all slice images of the entire ROI are then merged together to generate the frontal view. Similarly, the vertical center portion of the connected regions preserved in adjacent mask images is taken, with a width set to half the number of pixels converted from the slice gap (rounded up). The vertical center portions of the connected regions in all slice images of the entire ROI are then merged together to generate the lateral view.
[0052] After outputting the frontal and lateral observation views (both binary images), the operator assesses the separation of the hip and femur. Accurate separation is achieved by introducing interactive boundary mapping and a 3D segmentation algorithm. If automatic segmentation is complete, the system automatically picks the hip bone boundary line L. boundary If adhesion exists, the boundary lines are drawn manually. Then, the two-dimensional boundary lines are inverted to three-dimensional space using a coordinate mapping model: Let p be any point on the observation view. view(u,v) Its corresponding three-dimensional voxel coordinates p vol(x,y,z) Determined by the following formula: For a forward view: x = u + offset x y=center y z=v; For the side view: x=center x y=u+offset y z=v; Where offset is the offset when extracting the observed view, center is the coordinate of the image center, and offsetx and offset y These are the horizontal / vertical offsets (in pixels) when viewing the view. The three-dimensional boundary point set {P} obtained by mapping the front view and the side view vol}, based on {P vol Implicit surface fitting using radial basis functions (RBF) yields a segmented surface S(x,y,z)=0. Finally, a femoral mask is generated using a spatial decision function. ; Among them, M femur (i,j,k) represents: the femoral mask in voxels The value at the specified location. By performing logical operations (such as bitwise multiplication or index suppression of non-target voxels) on the original image using a femoral mask, high-precision separation of the hip bone and femur can be achieved.
[0053] S223, Separation of the tibia and fibula from the foot bones: To accurately isolate the tibia and fibula within the Pri-DOI of the ankle joint, a three-dimensional connected component filtering algorithm based on spatial prior and adaptive thresholding was employed. The algorithm first performs 8-neighborhood connected component analysis in the upper region (e.g., the top 30%) of each slice. To remove noise and preserve true bone, a dynamic area thresholding model was introduced: only slices satisfying Area(C) were retained. i )≥μ s +k×σ s , Among them, Area(C i ) is the current layer The pixel area of each connected region, μ s and σ s The mean and standard deviation of the area of the connected components in the current layer are given, k is an adjustment coefficient of 1.5 to 2.5, and the centroid is located in the upper left / right half of the image (e.g., ...). The connected components of ) are ∧, which is the symbol for logical AND, also called conjunction, and W and H are the width and height (in pixels) of the slice image.
[0054] By iterating layer by layer and verifying the intersection-union ratio (IoU) of connected domains in adjacent layers (IoU>0.3) to ensure three-dimensional continuity, robust extraction and noise filtering of the tibia and fibula are finally achieved.
[0055] When searching downwards to the foot bone region, the binary image may contain 1–6 connected components. Based on anatomical priors (fibula on the lateral side, tibia on the medial side), a dual constraint of quantity and area is applied: when a total of 4 connected components are identified on both sides, only the first 4 are retained in descending order of area (the rest are considered noise); if the quantity significantly deviates from 4, it indicates the entry into a complex tibia-fibula-foot bone connection area, and a secondary region of interest (Sec-DOI) is established at this location with a height H. sec Calculated as: H sec =max(H pri / 5,H min ), Among them, H pri The height of the hip joint Pri-DOI, H min To ensure operational feasibility, a minimum height constraint (e.g., 10-layer slice) is applied. Within this Sec-DOI, the same dual-constraint rules are used for secondary fine-tuning to ensure accurate separation of the skeleton even at complex connections.
[0056] To ensure the quality of the separation between the tibia and fibula and the foot bones, adjacent binary images and slice images of the region of interest (ROI) are connected to generate observation views, which are divided into a frontal observation view and a lateral observation view. Since adjacent slice images are the same size and present adjacent ankle joint areas, the horizontal center portion of the connected regions preserved in the adjacent mask images is taken, with a width set to half the number of pixels converted from the slice gap (rounded up). The horizontal center portions of the connected regions in all slice images of the entire ROI are then merged together to generate the frontal observation view. Similarly, the vertical center portion of the connected regions preserved in the adjacent mask images is taken, with a width set to half the number of pixels converted from the slice gap (rounded up). The vertical center portions of the connected regions in all slice images of the entire ROI are then merged together to generate the lateral observation view.
[0057] The system outputs a forward and lateral view, which are binary images. The boundaries of the tibia, fibula, and foot bones are extracted. The operator observes the separation of the tibia, fibula, and femur. If they can be completely separated, the foot bone boundary line is picked, and the segmentation position of the tibia, fibula, and foot bones is accurately located based on this boundary line. Then, the corresponding pixels in the slice image are inferred from the boundary line to segment the foot bone portion, which is then removed. A binary image retaining only the tibia and fibula is generated as a mask image, and a masking operation is performed to achieve separation of the tibia, fibula, and foot bones. If they cannot be completely separated, the foot bone boundary line is manually drawn to locate the segmentation position of the tibia, fibula, and foot bones. Then, the corresponding pixels in the slice image are inferred from the boundary line to segment the foot bone portion, which is then removed. A binary image retaining only the tibia and fibula is generated as a mask image, and a masking operation is performed to achieve separation of the tibia, fibula, and foot bones.
[0058] S224, Separation of the femur from the tibia and fibula: An 8-directional search algorithm was applied to search for connected regions in the region of interest (ROI) of the knee joint. Since the femur and tibia / fibula are located on either side of the ROI image, with the middle portion being the background, and the upper and lower parts of the ROI have relatively simple components (the uppermost part contains only large connected regions of the femur, and the lowermost part contains only large connected regions of the tibia / fibula), a search strategy was adopted that begins from the top and bottom towards the middle, and then from the middle towards both sides. Small connected regions formed by factors such as metal objects on clothing and image noise were removed.
[0059] During the simultaneous top-down and bottom-up intermediate search process, the binary image may contain 1 to 4 connected regions. Based on prior knowledge of the anatomical spatial distribution of the tibia, fibula, and femur in the full-sequence slices, the femur is typically stably located in the upper part of the image and symmetrically distributed on both sides, the fibula is located in the outermost region of the lower part of the image, and the tibia is consistently located on the medial side of the fibula. Based on this strict spatial structure constraint, the algorithm performs an automated filtering operation: when two large connected regions matching the expected anatomical location are successfully detected in the upper left and right regions of the image, and four large connected regions are detected in the lower left and right regions of the image, the algorithm determines that these regions correspond to the lower end of the femur and the upper end of the tibia and fibula, respectively. At this point, the system filters based on the area of the connected regions and their spatial distribution characteristics, retaining the largest target connected regions, i.e., the two in the upper part and the four in the lower part, and removing the remaining small connected regions and noise based on the dynamically calculated area threshold. The area threshold is adaptively determined by the statistical characteristics of the area of all connected regions in the current slice. The calculation formula is: the area of the connected region pixel must be greater than or equal to the mean of the area of all connected regions in the current slice plus one to two times the standard deviation. The weighting coefficient is set according to the prior knowledge of the typical size of different anatomical parts, so as to generate a high-quality intermediate mask image.
[0060] As the search progresses towards the intermediate level, if the number of connected components identified on both sides of the upper image is significantly more or less than two, it indicates that the algorithm has approached the physiological connection between the femur and tibia / fibula. Similarly, if the number of connected components on both sides of the lower image deviates from the expected value by four, it indicates that the algorithm has approached the connection area between the tibia / fibula and femur. In this critical situation, the system automatically triggers a reconstruction mechanism, accurately reconstructing the secondary region of interest (Sec-DOI) between the femur and tibia / fibula based on the aforementioned positional offset information. Within this Sec-DOI, the algorithm employs an advanced connected component cleanup strategy based on morphological reconstruction, using the original binary mask and a labeled image generated based on spatial prior knowledge as input, and selecting adaptive structuring elements to perform the reconstruction operation. This process intelligently identifies and removes pseudo-connected components, imaging noise, and irrelevant tissue interference, ultimately outputting a highly cleaned mask image, providing a reliable and high-quality data foundation for subsequent accurate and automatic separation of the femur, tibia, and fibula.
[0061] To ensure the quality of femoral and tibia / fibula separation, adjacent binary and slice images of the region of interest (ROI) are connected to generate observation views, which are divided into a frontal view and a lateral view. Since adjacent slice images are the same size and present adjacent knee joint areas, the lateral center portion of the connected regions preserved in adjacent mask images is taken, with a width set to half the number of pixels converted from the slice gap (rounded up). The lateral center portions of the connected regions in all slice images of the entire ROI are then merged together to generate the frontal view. Similarly, the longitudinal center portion of the connected regions preserved in adjacent mask images is taken, with a width set to half the number of pixels converted from the slice gap (rounded up). The longitudinal center portions of the connected regions in all slice images of the entire ROI are then merged together to generate the lateral view.
[0062] The system outputs frontal and lateral observation views, which are binary images used to clearly present the boundary features of the femur and tibia / fibula. The operator uses these views to assess the separation status. If complete segmentation is determined, the system automatically performs extraction: first, it picks the femoral boundary line and precisely locates the segmentation position of the femur and tibia / fibula based on this boundary line; then, it inverts the three-dimensional boundary to a two-dimensional slice sequence using a spatial mapping model, which is derived from the transformation matrix established during reconstruction. The inverse transform is implemented, and the calculation formula is as follows: This allows for the precise calculation of the corresponding pixel regions in the original DICOM image; subsequently, the femur is segmented, generating a binary mask image containing only the femur, and automatic femur extraction is achieved through mask operations. Similarly, the system picks the tibia and fibula boundary lines, accurately locates the segmentation position based on their contours, uses the same inversion and mapping mechanism to locate to two-dimensional pixel coordinates, segments the tibia and fibula, generates a corresponding binary mask image, and completes the extraction of the tibia and fibula through mask operations.
[0063] If the assessment reveals that the femur and tibia / fibula are not completely separated, the system switches to a manual-assisted segmentation mode: the operator manually draws the boundary line between the femur and tibia / fibula. The system uses a B-spline-based curve fitting algorithm to smooth and optimize the manually drawn trajectory, improving boundary accuracy. Subsequently, the same spatial mapping model is applied. The optimized boundary lines are then applied back to the relevant 2D slices to precisely locate the segmentation positions. Next, the system extracts the femur and tibia / fibula portions separately, and sequentially generates binary mask images retaining only the femur and only the tibia / fibula. Finally, precise extraction of the femur and tibia / fibula is achieved through mask operations.
[0064] S225, Separation of the tibia and fibula: Separating the tibia and fibula is relatively simple, as the gap in the middle is relatively large and can be easily segmented using a threshold in a binary image. The main difficulty lies in the upper and lower ends. These two areas are located in the secondary regions of interest for separating the femur and tibia / fibula, respectively. Similar operations can be performed on top of the previous separations to further separate the tibia and fibula.
[0065] After initial segmentation based on the observation view separating the femur and tibia / fibula, the operator assesses the separation of the proximal ends of the tibia and fibula. If the automatic segmentation is successful and complete separation is achieved, the system automatically executes a precise extraction process. The system automatically picks up the boundary lines of the tibia and fibula and maps these boundary lines back to the original slice image based on a predefined anatomical spatial relationship model. Assuming the coordinates of a point on the boundary line in the world coordinate system, the system inversely applies the transformation matrix from reconstruction, which records the rigid body transformation from voxel coordinates to world coordinates, and calculates its corresponding voxel coordinates in the original DICOM sequence. This step ensures precise positioning from the 3D observation view to the 2D slice pixels.
[0066] Based on the mapped pixel set, the system generates precise binary mask images containing only the tibia or fibula. Mask generation is not a simple pixel filling process; instead, it employs a morphological constraint filling algorithm based on geodesic distance to ensure segmentation accuracy at complex boundaries. Its core expression uses an initial seed region composed of mapped points, image gradient constraints, and a distance threshold as input, and generates the final mask through geodesic dilation. Subsequently, the generated mask is used to perform a masking operation on the original image, automatically extracting the tibia and fibula respectively.
[0067] If automatic segmentation fails to completely separate the bones and adhesions remain, a semi-supervised interactive mode is activated. The operator manually draws the boundary curve between the tibia and fibula in the observation view. The system uses a B-spline-based interactive curve fitting algorithm to optimize the manually drawn coarse trajectory into a smooth, precise segmentation boundary line, reducing human error. Similarly, based on a coordinate mapping model, the system back-calculates the optimized 2D or 3D boundary line to all relevant 2D slice images, accurately locating the segmentation position.
[0068] Using the pixels obtained through reverse engineering as seed points, an improved adaptive region growing algorithm is employed for final segmentation. This algorithm's growth criteria not only rely on grayscale values but also incorporate local texture features and spatial constraints. The growth criteria are: the grayscale difference between the current pixel and the seed point is less than a threshold, the texture feature distance is less than a threshold, and the spatial constraints are satisfied. This method effectively avoids over-growing in adherent regions or areas with uneven grayscale, ensuring accurate separation of the tibia and fibula. Finally, the system generates high-precision binary masks for the tibia and fibula respectively, completing the extraction operation.
[0069] S226. Finally, output the binary voxel sequence Mtarget of the target bone to achieve the removal of the pelvic and foot bones and decoupling at the joints. The target bone includes the femur, tibia and fibula.
[0070] Existing literature only covers cranial bone bed removal algorithms, but these algorithms are not applicable to lower limb bone bed removal. First, the cranial bone has a unique connected domain, while the lower limb bones have at least two connected domains, so using a region growing algorithm will result in missed bone extractions. Second, the bone contours are not necessarily the longest; the contours of the fibula and tibia are much shorter than the bed, so contour extraction algorithms cannot meet the requirements.
[0071] The hierarchical DOI separation algorithm (SDC-SS) considering spatial distribution proposed in step S2 of this invention can quickly and accurately separate the femur, tibia, and fibula, and completely remove the hip and foot bones. (See attached...) Figure 4 As shown, the separated bone models have complete structures and clear boundaries. Quantitative comparative experiments show that the segmentation Dice coefficient of this invention exceeds 0.95 on multiple clinical datasets, which is about 15%-20% higher than traditional threshold segmentation, region growing and edge detection methods. At the same time, the processing time is reduced by about 30%, making it particularly suitable for complex cases with severe joint adhesions and deformities.
[0072] Example 3: Combined with Appendix Figure 1 Appendix Figure 2 Appendix Figure 3 Appendix Figure 4 and attached Figure 5 In addition to the content of the above embodiments, the hole boundary positioning method is implemented through the following steps: S31: Input an initial triangular mesh with holes, first search for the edges of the holes; S32: Parallel traverse all triangular faces of the initial triangular mesh, starting from the first triangular face and matching faces according to common edges until the last triangular face, find all adjacent faces, record the adjacency relationship between triangular faces, generate a triangular face information set Fs, and construct an edge set Es from the three undirected edges of each triangular face. S33: Traverse all vertices v of the initial triangular mesh of the lower limb bone 3D model, summarize the associated edges and faces, generate a vertex information set Vs, and use the three sets of structures (Fs,Es,Vs) to completely describe the mesh topology, providing a data foundation for the subsequent fast and accurate tracking and closure of hole boundaries; S34: Select a common edge AC from the edge set Es, and the adjacent triangular faces △ABC and △ACD on both sides of the common edge. (x1,y1,z1) and (x3,y3,z3) are the coordinates of points A and C on the common edge AC, respectively; (x2,y2,z2) are the coordinates of the third vertex B of the adjacent triangular face △ABC, and (x4,y4,z4) are the coordinates of the third vertex D of the adjacent triangular face △ACD. Project points B and D onto line AC according to formula (S4-1) to obtain the foot of the perpendicular P. B With P D Then, construct the orthogonal vectors n1 and n2 according to formula (S4-2), and calculate the dihedral angle θ of adjacent triangular faces △ABC and △ACD using formula (S4-3). If the value of the dihedral angle θ is less than the threshold of 15°, then the common side AC is included in the hole boundary set. (S4-1) Among them, (x B ,y B ,z B ) is P B The coordinates, (x D ,y D ,z D ) is P D The coordinates; (S4-2) (S4-3) S35: Based on the triangular faces associated with the vertex, continue searching for adjacent hole boundary lines until the boundary lines close to complete the location of a hole boundary.
[0073] 5. The automatic 3D modeling and solid separation method for leg bones as described in claim 4, characterized in that the local replacement method is implemented through the following steps: S41: After locating the hole boundary using the hole boundary positioning method, the two endpoints of a common edge on the boundary uniquely determine the adjacent triangular faces △ABC and △ACD on both sides. Based on the coordinate correspondence between the 2D image and the 3D model points during modeling, the vertices of these two triangular faces are projected back onto the image I. original This yields the corresponding Region of Interest (ROI). S42: Re-binarize the ROI with a calculation threshold smaller than 110, T local The threshold calculation model for (x,y) is: T local (x,y)=μ(x,y)+t×σ(x,y), then perform morphological expansion and contraction operations, connect the breakpoints to eliminate burrs; Where μ(x,y) and σ(x,y) are the mean and standard deviation of gray levels within a 15×15 pixel window centered at (x,y) in the ROI, respectively, and t is an empirically obtained adjustment coefficient in the range of 0.2–0.6. The largest connected component in the processed image is extracted, and an optimized binary mask is generated as the local mask M using a skeleton thinning algorithm. ROI If the local mask M ROI If the number of connected components is greater than 1, it indicates that the original erroneous connection has been corrected; otherwise, iterate the threshold with a step size of 5, repeating step S42 until effective separation is achieved. S43: Using the final local mask M ROI A masking operation is performed on the ROI in the image to obtain a corrected local image of bone tissue. Using voxel sub-blocks of local bone tissue images as input, a new set of triangular patches is locally reconstructed using the moving cube algorithm. Topological or geometric consistency constraints are applied to the boundaries of the new patches and the original model: normal consistency, boundary vertex correspondence, edge length and face angle threshold checks, and seamless embedding and overlap, as well as degenerate face removal, to achieve accurate hole repair and topological closure.
[0074] In step S43, the masking operation refers to comparing the pixels (or voxels) in the image at the ROI with the binary local mask M. ROI Multiply ∈{0,1} to let M at ROI ROI Pixels with a value of 1 retain their original grayscale value, M ROI Pixels with a value of 0 are set to zero.
[0075] Domestic and international experts and scholars have proposed various image segmentation methods. These include: threshold segmentation based on grayscale differences, which transforms the segmentation problem into a pixel classification problem; region growing algorithms, which segment similar regions by setting conditions; edge extraction algorithms to extract contour lines; segmentation based on spatial geometric features such as shape and cross-sectional area; and segmentation based on statistical shape analysis of image atlases. These image segmentation algorithms are suitable for separating different organs or organs of the same type with large gaps, and are easy to extract bones. However, due to individual differences, uneven bone density, and bone compression at joints, it is difficult to choose a universal threshold or shape for segmentation. Previously, no segmentation algorithm could solve this problem. The algorithm proposed in this patent can separate the femur, tibia, and fibula in one step. By fusing spatial distribution features and creating hierarchical regions of interest, it improves the search speed and separation accuracy.
[0076] In step S3 of this invention, holes in the three-dimensional model of the lower limb bones can be automatically and in batches detected and repaired. (See attached image) Figure 5As shown, the repaired model exhibits good surface continuity and high detail retention. Performance comparisons show that the hole repair in step S3 achieves better integrity and visual plausibility than methods such as symmetry-based mirror repair and single-layer triangular mesh hole repair, improving repair efficiency by approximately 50%. It is particularly suitable for complex hole structures caused by osteoporosis, noise interference, etc.
[0077] Currently, there are four existing methods for repairing holes in 3D models: mirror repair based on the principle of symmetry, various single-layer triangular mesh hole-repairing algorithms based on the half-side principle, manual intervention to repair holes one by one, and matching similar surfaces using a template library. However, none of these four methods are suitable for repairing holes in lower limb bone 3D models because the lower limb bone 3D models are not symmetrical, especially when deformities exist, making symmetrical hole repair impossible. The lower limb bone 3D model consists of two layers of triangular meshes, and due to image noise, osteoporosis, etc., errors in the connection of the inner and outer triangular meshes can occur, forming irregular holes. Single-layer triangular mesh hole-repairing methods cannot be used. Furthermore, the lower limb bone 3D model is large, with many triangular faces and numerous small holes, making manual intervention for each hole impossible. Step S3 of this invention proposes to quickly and accurately search for the boundaries of holes using the topological relationships between points, lines, and surfaces. The hole boundaries are determined by calculating the included angle between two surfaces, and the original incorrect connections are corrected by adjusting the threshold and re-segmenting, achieving precise hole repair.
[0078] This invention proposes a fully automated modeling scheme for lower limb bones: robust bed removal is achieved using an improved aT-Mask algorithm; a spatially distributed hierarchical DOI separation algorithm (SDC-HDOI) enables high-precision and rapid separation of the femur, tibia, and fibula, with the hip and foot bones removed; and high-quality 3D reconstruction and topological closure are completed using MarchingCubes and MI hole repair. This process, through anatomical priors and local statistical constraints, solves key problems such as interference from metal beds, joint adhesions, and over / undersegmentation and hole repair difficulties caused by double-layered bone shells. It exhibits good versatility, scalability, and engineering applicability without relying on specific vendor equipment or individual morphology. Compared with existing methods, this scheme achieves significant improvements in accuracy, robustness, and efficiency (e.g., higher bed removal accuracy, segmentation die, and reconstruction completeness on representative data), and is applicable to various scenarios such as preoperative clinical planning, personalized implant design, and educational visualization.
[0079] While the invention has been described above with reference to various embodiments, it should be understood that many changes and modifications can be made without departing from the scope of the invention. That is, the methods, systems, and devices discussed above are examples. Various configurations can be appropriately omitted, substituted, or added to various processes or components. For example, in alternative configurations, methods can be performed in a different order than described, and / or various components can be added, omitted, and / or combined. Moreover, features described with respect to certain configurations can be combined in various other configurations, such as different aspects and elements of the configuration can be combined in a similar manner. Furthermore, the elements therein can be updated as the technology develops; many elements are examples and do not limit the scope of this disclosure or the claims. It should also be understood that after reading the description of this invention, those skilled in the art can make various alterations or modifications to the invention, and these equivalent changes and modifications also fall within the scope defined by the claims of this invention.
Claims
1. A method for automatic three-dimensional modeling and solid separation of leg bones based on DICOM images, characterized in that, The DICOM image-based automatic three-dimensional modeling and entity separation method of leg bones comprises the following steps: S1, the DICOM image of the lower limb CT is taken as an object, the scanning bed body is automatically removed under the premise of retaining the continuous and clear boundary of the bone tissue, and the final precise bed body removed image I is output cleaned ; S2, taking the refined bed-removed body image as the object, performing step-by-step search and screening based on a lower limb bone entity separation algorithm SDC-HDOI considering spatial distribution of hierarchical DOIs, completing separation of the hip bone and the femur, separation of the tibia and fibula and the foot bone, separation of the femur and the tibia and fibula, and separation of the tibia and the fibula, and removing the pelvis and the foot bone which are non-target bones, disconnecting the hip, knee and ankle joints, and outputting a binary voxel sequence M of the target bone target ; S3, output the target bone binary voxel sequence M of step S22 target For input, eight points are taken from each of the adjacent four points of the adjacent two layers of slices to form a cubic element. The intersection points of the isosurface and the edges of the cubic element are calculated at the set isovalue threshold, and the intersection points are connected into triangular facets according to the lookup table rules, so as to extract the isosurface to generate an initial triangular mesh. Subsequently, Laplace smoothing is performed on the initial triangular mesh, and regularization processing, automatic hole detection and filling are performed to complete topological closure, and finally an OBJ format three-dimensional model of lower limb bones is exported; The automatic hole detection and filling in step S3 is achieved by a hole boundary positioning method and a local replacement method.
2. The method of automatic three-dimensional modeling and solid separation of leg bones as claimed in claim 1, wherein, Step S1 is achieved by the following steps: S11: convert the gray value of the image into CT value, then adjust the window level / window width of the image to 1600 / 1000, let the part of the image CT value less than 0 be background, after adjusting the window level / window width, the pixel whose gray value is greater than 0, set the pixel value to the maximum value, such as formula (S-1), generate aT mask image, apply the mask image to I original , through the mask operation, remove most of the bed body, so that the bed body remains a small discontinuous connected domain, obtain a processing image, ,(S-1) Wherein, the image is a single slice image in a DICOM image sequence, and the image is denoted as I original , GrayValue is the gray value after the window level / window width is 1600 / 1000; CTValue is the image CT value; B(i,j) is the gray value of the image at position (i,j). S12: A 3x3 pixel filter window is selected to perform a Median filter operation on the processed image to complete image denoising, and the image gray value is converted to a suitable nonlinear space by formula (S-2) to enhance the contrast of the middle gray area, making the transition area between the bone and the surrounding tissue clearer, and obtaining an enhanced processed image: (S-2) Wherein, -20 is the brightness offset, C(i,j) is the gray value of the enhanced image; The Gamma correction coefficient is 2.2; S13: on the enhanced processing image, a method of combining adaptive threshold based on local gray scale statistics and directional morphological sequence purification is adopted, and binary mask image M is generated by cooperating with connected domain screening and small hole inhibition final , and the image is subjected to fine bed body and boundary smoothing processing according to the binary mask image, and the fine bed body image I is output cleaned .
3. The method of automatic three-dimensional modeling and solid separation of leg bones as claimed in claim 2, wherein, Step S2 is achieved by the following steps: S21: The DICOM image sequence after the bed-removing process in step S1 is denoted as {Is}, where z is the slice index, and the bed-removed image with the slice index s is denoted as Is s For each slice Is s Perform morphological dilation and binarization with a threshold value Generate a preliminary bone mask B s (x, y), and then, according to the proportion of the center / periphery and the total foreground pixels, remove the slices before the spine feature area and after the bone-free blank area along the layer sequence from head to foot, to obtain the cropped bed-removed image sequence {I's}. S22: with {I's} and B s (x, y) as the object, the total number of {I's} slices N total The primary region of interest Pri-DOI slice index range of the hip joint, knee joint, and ankle joint is automatically determined according to a preset ratio to define a processing region, and when the number, position, and anatomical prior of the connected domain do not match, a secondary region of interest Sec-DOI is established for local fine-tuning, a hierarchical DOI separation strategy considering spatial distribution is used within the Pri-DOI and Sec-DOI to perform connected domain search and number, area, and position screening, and when necessary, interactive boundary mapping and mask operation are supplemented, the separation of the hip bone-femur, tibia-fibula foot bone, femur-tibia-fibula, and tibia-fibula is sequentially completed, the pelvis and foot bone are removed, and decoupling at the hip, knee, and ankle joints is achieved, and finally the target bone binary voxel sequence M is output targe .
4. The method of automatic three-dimensional modeling and solid separation of leg bones as claimed in claim 3, wherein, The hole boundary positioning method is achieved by the following steps: S31: Input the initial triangular mesh with holes, first search the edge of the hole; S32: Parallelly traverse all triangular faces of the initial triangular mesh, start from the first triangular face and match the faces according to the common edge, until the last triangular face, find all adjacent faces, record the adjacent relationship between the triangular faces, generate triangular face information set Fs, and construct edge set Es from the three undirected edges of each triangular face; S33: Traverse all vertices v of the initial triangular mesh of the three-dimensional model of lower limb bones, summarize the associated edges and faces, generate vertex information set Vs, and use (Fs, Es, Vs) three sets of structures to completely describe the grid topology, which provides a data basis for fast and accurate tracking and closure of the hole boundary in the future; S34: Select the common edge AC from the edge set Es, the adjacent triangular faces △ABC and △ACD on both sides of the common edge, (x1, y1, z1) and (x3, y3, z3) are the coordinates of points A and C on the common edge AC; (x2, y2, z2) is the coordinate of the third vertex B of the adjacent triangular face △ABC, and (x4, y4, z4) is the coordinate of the third vertex D of the adjacent triangular face △ACD, Projecting the points B and D to the line AC according to formula (S4-1) to obtain the foot P B With P D , construct the edge normal vectors n1 and n2 according to formula (S4-2), and calculate the dihedral angle θ of the adjacent triangular faces ABC and ACD according to formula (S4-3), if the value of the dihedral angle θ is less than the threshold value 15°, the common edge AC is included in the hole boundary set, , (S4-1) wherein (x B ,y B ,z B ) are the coordinates of P B , and (x D ,y D ,z D ) are the coordinates of P D . ,(S4-2) ;(S4-3) S35: According to the triangular face associated with the vertex, continue to search for the adjacent hole boundary line until the boundary line is closed to complete the positioning of a hole boundary.
5. The method of automatic three-dimensional modeling and solid separation of leg bones as claimed in claim 4, wherein, The local replacement method is achieved by the following steps: S41: After locating the hole boundary by the hole boundary locating method, the two adjacent triangular faces ABC and ACD on the two sides of the two end points of a common edge of the boundary are uniquely determined, and the two triangular face vertices are back projected to the image I according to the coordinate correspondence between the 2D image and the 3D model points before modeling, to obtain the corresponding region of interest ROI; original , S42: rebinarization with a smaller calculation threshold than 110, T local (x,y) threshold calculation model: T local (x,y) = μ(x,y) + t x σ(x,y), and then morphological dilation and shrinkage operations, connecting broken points to eliminate burrs; Wherein, μ(x,y), σ(x,y) are respectively: the gray mean value and the gray standard deviation in the ROI with (x,y) as the center and a window of 15x15 pixels, and t is an empirical control coefficient in the range of 0.2-0.6; The maximum connected domain in the processed image is extracted, and a skeleton thinning algorithm is applied to generate an optimized binary mask as the local mask M ROI If the number of connected domains in the local mask M ROI is greater than 1, it indicates that the original erroneous connection has been corrected; otherwise, the threshold is iteratively reduced by a step of 5, and step S42 is repeated until effective separation is achieved; S43: using the finally obtained local mask M ROI Masking operation is performed on the ROI in the image to obtain a corrected local image of bone tissue A new set of triangular facets is locally reconstructed by using the moving cube algorithm with the voxel sub-block of the local image of bone tissue as input. Topological or geometric consistency constraints are performed on the new facets and the original model boundary, including normal consistency, boundary vertex correspondence, edge length and facet angle threshold checking, seamless embedding and overlap, and degenerate facet rejection, to achieve accurate hole repair and topological closure.
Citation Information
Patent Citations
Leg-bone lower limb force line automatic detection method and device
CN110613469A
An automatic detection method and device for leg bone and lower limb force line
CN110613469B
Planning method and apparatus for intelligent navigation system of tibial osteotomy
CN114723897B
A fully automatic measurement method, system, terminal and medium for knee varus and valgus
CN119919406B