A flexible tool calibration method and device based on a CT image, an electronic device, and a storage medium
By identifying and compensating for the deformation of flexible tools in CT images, the problem of tool recognition failure due to deformation in existing technologies has been solved, achieving high-precision and robust tool positioning, and improving the smoothness and safety of surgical operations.
Patent Information
- Application Number
- CN202610207197.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-12
- Publication Date
- 2026-05-29
AI Technical Summary
Existing tool recognition and registration algorithms cannot effectively handle topological changes caused by the elastic deformation of flexible tools under stress, leading to matching errors and tool recognition failures, which affect the smoothness and safety of surgical procedures.
By obtaining the sub-voxel level center coordinates of the marked spheres in CT images, a point set matching algorithm is used to identify rigid tools with fixed topology and flexible tools with variable topology. The actual center coordinate set of the flexible tool is constructed for rigid registration calculation, deformation compensation parameters are solved, and the identification results and calibration data of deformation compensation parameters are output.
It achieves high-precision identification and deformation compensation of flexible tools, provides a more reliable positioning basis for navigation systems, reduces sensitivity to tool deformation, and improves the robustness and accuracy of surgical operations.
Smart Images

Figure CN122115516A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a flexible tool calibration method, apparatus, electronic device, and storage medium based on CT images. Background Technology
[0002] In the field of medical image processing and spatial positioning technology, the automatic and accurate identification of positioning markers (often called marker spheres) from computed tomography (CT) images is a key technology. This technology aims to solve the problem of high-precision mapping between the image coordinate system and the physical coordinate system, and is the foundation for realizing multimodal data fusion and spatial registration.
[0003] Existing tool recognition and registration algorithms (such as conventional Iterative Closest Point (ICP) registration) are typically based on the "absolute rigidity assumption." These methods rely on the prior knowledge that the spacing between marker spheres is fixed, meaning the relative distance between them must remain absolutely constant under all circumstances (e.g., the error must be less than 3mm). This strict premise makes them ineffective in handling minor topological changes caused by physical deformation of semi-flexible tools or positioning errors in actual CT imaging and segmentation. However, in real-world applications, flexible tools such as pose tracking undergo elastic deformation under stress, resulting in deviations between the spatial configuration of the marker spheres and the standard rigid model exceeding a strict threshold (e.g., a deviation of 6mm). These topological deviations caused by deformation are judged as matching errors or feature mismatches, directly leading to tool recognition failure or loss of tracking in the navigation interface, forcing users to interrupt operations for recalibration. This severely impacts the smoothness and safety of operations, and the clinical need for high-precision tracking. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a flexible tool calibration method, device, electronic device, and storage medium based on CT images to improve recognition accuracy.
[0005] In a first aspect, embodiments of the present invention provide a flexible tool calibration method based on CT images, the method comprising: Obtain the subvoxel-level center coordinates of each marked sphere in the CT image; Based on the pre-stored tool topology model, a point set matching algorithm is used to identify the first type of tool with a fixed topology and the second type of tool with a variable topology from the sub-voxel level sphere center coordinates. Construct the actual sphere center coordinate set of the second type of tool, perform rigid registration calculation between the actual sphere center coordinate set and the pre-stored standard model coordinate set, and solve for the deformation compensation parameters used to characterize the physical deformation of the second type of tool; The output includes the identification results of the first type of tool and the second type of tool, as well as the calibration data of the deformation compensation parameters of the second type of tool.
[0006] In conjunction with the first aspect, based on a pre-stored tool topology model, the steps of identifying a first class of tools with a fixed topology and a second class of tools with a variable topology from sub-voxel-level sphere center coordinates using a point set matching algorithm include: Based on the pre-stored tool topology model, the first tolerance threshold is used as a geometric constraint to search for and lock the first type of tool in the sphere center coordinates; After removing the coordinates of the first type of tool identified from the sphere center coordinates, a second tolerance threshold greater than the first tolerance threshold is used as a geometric constraint to search for and identify the second type of tool.
[0007] In conjunction with the first aspect, the steps for outputting calibration data containing the recognition results of the first type of tool and the second type of tool, as well as the deformation compensation parameters of the second type of tool, include: Using deformation compensation parameters, update the transformation relationship of the second type of tool from the tool coordinate system to the image coordinate system in the spatial positioning system; Based on the updated transformation relationship and the pre-stored standard end position of the second type of tool, the corrected end position of the second type of tool in the image coordinate system is calculated to achieve positioning compensation.
[0008] In conjunction with the first aspect, the method also includes: If the matching error obtained when matching the set of sphere center coordinates with the tool topology model is greater than the first error threshold and less than the second error threshold, the first level of processing is triggered. The first level of processing includes outputting a warning message and entering a waiting confirmation state. If the number of identified sphere center coordinates is less than the number of marked spheres required by the corresponding tool in the tool's topology model, a second-level processing is triggered. The second-level processing includes enabling the interactive completion interface, performing local relocalization in the CT image data based on the received user-specified region information, and performing local fitting to generate supplementary sphere center coordinates. If the matching error is greater than or equal to the second error threshold, or if the matching cannot be completed, the third-level processing is triggered. The third-level processing includes suspending execution and outputting an error flag.
[0009] In conjunction with the first aspect, the steps for obtaining the sub-voxel-level center coordinates of each marked sphere in the CT image include: Based on CT image data, a 3D candidate point cloud corresponding to the marker sphere and interference items is generated through contour extraction and coordinate mapping. Density-based entity separation is performed on the 3D candidate point cloud to separate the candidate point clusters corresponding to each physical marker sphere; For each candidate point cluster, perform robust spherical fitting based on random sampling consistency to select the optimal set of interior points; Based on the selected optimal set of interior points, the sub-voxel level center coordinates of each marked sphere are calculated using the least squares method.
[0010] In conjunction with the first aspect, the steps for generating a 3D candidate point cloud corresponding to the marker sphere and artifact interference based on CT image data include: Traverse two-dimensional slices of the CT image along three mutually orthogonal preset directions; For each slice, the foreground region and its corresponding two-dimensional contour points in the slice are extracted based on density threshold segmentation; Based on the index of the slice where the two-dimensional contour points are located and the physical coordinate mapping relationship, the two-dimensional contour points are mapped to a unified three-dimensional physical coordinate system and fused to form a three-dimensional candidate point cloud.
[0011] In conjunction with the first aspect, the step of performing robust spherical fitting based on random sampling consistency on the candidate point cluster includes: Iteratively select a subset of candidate point clusters to construct a temporary spherical model; Calculate the geometric distance from the remaining points within the candidate point cluster to the temporary spherical model; Based on a preset sub-voxel level interior point threshold, interior points belonging to the real sphere are selected, and outlier interference points are removed. The subvoxel level in-point threshold ranges from 0.1 mm to 0.7 mm.
[0012] Secondly, this application provides a flexible tool calibration device based on CT images, the device comprising: The acquisition module is used to obtain the sub-voxel level center coordinates of each marked sphere in the CT image; The identification module is used to identify, based on a pre-stored tool topology model, the first type of tool with a fixed topology and the second type of tool with a variable topology from the sub-voxel level sphere center coordinates using a point set matching algorithm. The registration module is used to construct the actual sphere center coordinate set of the second type of tool, perform rigid registration calculations between the actual sphere center coordinate set and the pre-stored standard model coordinate set, and solve for the deformation compensation parameters used to characterize the physical deformation of the second type of tool. The output module is used to output the recognition results of the first type of tool and the second type of tool, as well as the calibration data of the deformation compensation parameters of the second type of tool.
[0013] Thirdly, this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor runs the computer program to cause the electronic device to perform the methods described above.
[0014] Fourthly, this application provides a storage medium storing computer program instructions, which are read and executed by a processor to perform the above-described method.
[0015] The embodiments of the present invention bring the following beneficial effects: This application provides a method, device, electronic device, and storage medium for calibrating flexible tools based on CT images. The method includes: obtaining the sub-voxel-level center coordinates of each marked sphere in the CT image; based on a pre-stored tool topology model, using a point set matching algorithm to identify a first type of tool with a fixed topology and a second type of tool with a variable topology from the sub-voxel-level center coordinates; constructing an actual center coordinate set of the second type of tool, performing rigid registration calculation between the actual center coordinate set and the pre-stored standard model coordinate set, and calculating the deformation compensation parameters used to characterize the physical deformation of the second type of tool; and outputting calibration data containing the identification results of the first type of tool and the second type of tool, as well as the deformation compensation parameters of the second type of tool.
[0016] This application provides a precise data foundation for the entire process by obtaining the sub-voxel-level center coordinates of each marked sphere. Furthermore, based on a pre-stored tool topology model, a point set matching algorithm is used to distinguish and identify rigid tools with fixed topology (first type of tools) and semi-flexible tools with variable topology (second type of tools), reducing the dependence of traditional identification techniques on the absolute rigidity of the tools. Crucially, for the identified second type of tools, by performing rigid registration calculations between their actual sphere center coordinate sets and standard model coordinate sets, the compensation parameters used to characterize their current physical deformation can be directly calculated. This allows the method to not only stably identify flexible tools that may undergo minor deformations during surgery, but also to actively quantify and compensate for their deformation errors. The final output calibration data includes both tool identification results and deformation compensation parameters, thus providing a more reliable and high-precision positioning and registration foundation for navigation systems that is more adaptable to real-world application scenarios.
[0017] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.
[0018] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0019] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0020] Figure 1 A flowchart illustrating a flexible tool calibration method based on CT images provided in an embodiment of the present invention; Figure 2 A schematic diagram of a flexible tool calibration device based on CT images provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the electronic device structure provided in an embodiment of the present invention.
[0021] Figure label: 10 - Extraction module, 20 - Recognition module, 30 - Registration module, 40 - Output module; 130 - Processor, 131 - Memory, 132 - Bus, 133 - Communication interface. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0023] To facilitate understanding of this embodiment, the technical terms used in this application will be briefly introduced below.
[0024] A marker sphere is a spherical positioning marker attached to medical instruments or the patient's body surface. Due to its material properties, it exhibits a significant high-density feature in CT images and serves as a physical reference point for image recognition and spatial registration.
[0025] In this embodiment, rigid tools with a fixed topology (i.e., negligible structural deformation) are defined as the first type of tool (e.g., a tracer reference frame). Their identification uses a first tolerance threshold (strict tolerance), which is set based on the CT limit resolution and processing error to ensure the absolute accuracy of their use as a spatial reference. Flexible tools with a variable topology (i.e., exhibiting slight elastic deformation under force) are defined as the second type of tool (e.g., a body surface motion tracking device). Their identification uses a second tolerance threshold (relaxed tolerance), which is greater than the first tolerance threshold and is set according to the range of physical deformation of the tool under expected working conditions.
[0026] After introducing the technical terms used in this application, the application scenarios and design concepts of the embodiments of this application will be briefly described below.
[0027] Existing tool recognition algorithms (such as ICP) are based on the rigid assumption that the spacing between marker balls remains absolutely constant, which cannot adapt to the deformation caused by forces on semi-flexible tools. When the actual deformation exceeds the preset tolerance, the system will determine that the matching has failed, resulting in tracking loss and forcing intraoperative recalibration, which affects the smoothness and safety of the operation.
[0028] Based on this, embodiments of this application provide a flexible tool calibration method, apparatus, electronic device, and storage medium based on CT images.
[0029] Example 1 This application provides a flexible tool calibration method based on CT images, combined with... Figure 1 As shown, the method includes: S110, obtain the subvoxel-level center coordinates of each marked sphere in the CT image.
[0030] S120, based on a pre-stored tool topology model, uses a point set matching algorithm to identify a first class of tools with a fixed topology and a second class of tools with a variable topology from sub-voxel level sphere center coordinates.
[0031] S130, construct the actual sphere center coordinate set of the second type of tool, perform rigid registration calculation between the actual sphere center coordinate set and the pre-stored standard model coordinate set, and solve for the deformation compensation parameters used to characterize the physical deformation of the second type of tool; S140, outputting the identification results of the first type of tool and the second type of tool, as well as the calibration data of the deformation compensation parameters of the second type of tool.
[0032] This application uses different tolerance strategies to identify rigid reference tools with fixed topology (Class I tools) and semi-flexible manipulation tools with variable topology (Class II tools), thereby effectively distinguishing and handling instruments with different rigidities in clinical scenarios. Furthermore, by performing secondary calibration on the identified Class II tools (dynamic manipulation tools) based on rigid registration (such as SVD), deformation compensation parameters are calculated, thereby actively compensating for the physical deformation errors of semi-flexible tools caused by force or gravity. Finally, the output calibration data has high accuracy and strong robustness, providing a reliable, accurate, and deformation-adaptive coordinate system registration basis for subsequent surgical navigation, reducing the problems of sensitivity to metal artifacts, inability to handle tool deformation, and insufficient recognition accuracy and robustness.
[0033] In step S110 of this embodiment, the sub-voxel-level center coordinates of each marked sphere are obtained in advance through a specific, highly robust image processing method. The data objects processed by this method and their accuracy characteristics provide high-quality input for subsequent hierarchical recognition (S120) and deformation compensation calculation (S130), so that in steps S120-S140, a more robust and intelligent surgical tool calibration can be achieved by introducing a hierarchical tolerance recognition and deformation compensation mechanism for dynamic and static tools. It is understood that, as an implementable approach, robust fitting of the sphere center localization can be achieved using the Random Sample Consensus (RANSAC) algorithm or other interference-resistant estimation algorithms (such as variants of the Hough transform, M-estimators, etc.) to determine the sphere center coordinates from the candidate point cluster. As long as it can eliminate interference points and obtain sub-voxel-level accurate sphere center coordinates, and is combined with the hierarchical tolerance recognition strategy based on the tool topology model proposed in steps S110-S140 of this embodiment, it is also within the scope of protection of this application.
[0034] In conjunction with the first aspect, step S120 includes: S121, based on the pre-stored tool topology model, uses the first tolerance threshold as a geometric constraint to search for and lock the first type of tool in the sphere center coordinates.
[0035] This step operates based on a pre-stored tool topology model, which contains precise design data for Class I tools (static tools), such as reference frames, particularly the theoretical distances between their marker spheres. A first tolerance threshold is set based on the rigidity requirements of the Class I tools (static tools) in the pre-stored tool topology model. This threshold setting comprehensively considers the slice resolution of CT images (typically 0.6mm-2.5mm), edge localization errors caused by image segmentation, and tool manufacturing tolerances. As an example, the first tolerance threshold can be set from 1.0mm to 4.0mm (e.g., 3.0mm). This threshold aims to ensure that the rigid tool serving as a spatial reference can be locked in the CT image with high confidence.
[0036] Within the set of sphere center coordinates obtained from S110, which comprises all sub-voxel-level sphere center coordinates, a subset is selected where the deviations between the measured distances between the sphere centers and the theoretical distances of the static tools in the topological model are all less than this strict first tolerance threshold. Only when a set of coordinates meets this rigid constraint is it determined and "locked" as a Class I tool (i.e., a static tool). Thus, a spatial reference frame with a constant position during scanning and surgery is established with the highest confidence and accuracy, providing a stable origin for all subsequent coordinate transformations.
[0037] S122, after removing the coordinates of the first type of tool identified from the sphere center coordinates, a second tolerance threshold greater than the first tolerance threshold is used as a geometric constraint to search for and identify the second type of tool.
[0038] After locking the coordinates of the static tool in S121, these coordinates are removed from the total set of sphere center coordinates, and identification continues only from the remaining coordinates. For the second type of tool (dynamic tool, such as a semi-flexible puncture needle), identification uses a second tolerance threshold, which is greater than the first tolerance threshold. The second tolerance threshold is set based on the range of physical elastic deformation of the second type of tool (dynamic tool) under expected clinical stress (such as bending or torsion), which is determined through prior physical experiments. The second tolerance threshold is greater than the first tolerance threshold to accommodate possible deformation of the tool. As an example, the second tolerance threshold can be set to 4.0 mm to 10.0 mm (e.g., 6.0 mm). Setting a threshold within this range effectively accommodates millimeter-level changes in the spacing between the marker spheres that may occur when the tool is bent under stress, preventing missed detections or misjudgments due to stringent rigidity matching conditions. In this process, it allows the algorithm to correctly identify the tool based on its approximate topology even when the tool is not ideally rigid, avoiding matching failures due to stringent rigidity matching conditions. This step enables an initial adaptive distinction of the physical state of the tool.
[0039] The identification in step S120 is based on a point set matching algorithm. This algorithm aims to find a subset of the detected sphere center coordinates that geometrically matches the pre-stored tool topology model. Specific implementation methods include, but are not limited to: a maximum clique search algorithm based on geometric constraints (such as distance tolerance), an algorithm that directly registers the point set to the model (such as the iterative nearest point algorithm and its variants), or a matching algorithm based on features such as geometric hashing. The maximum clique search algorithm is preferred, supplemented by a step-by-step tolerance strategy to adapt to the rigid requirements of different types of tools.
[0040] The input to step S130 is the actual sphere center coordinate set (P) of the second type of tool in the CT image, and the standard model coordinate set (Q) obtained from the standard model (specifically, the CAD model). The optimal spatial transformation between the two point sets is calculated using a rigid point set registration algorithm (optimal singular value decomposition (SVD)). The SVD calculation steps include: 1) calculating the centroids of P and Q; 2) constructing the covariance matrix H of the confidence-free coordinates; 3) decomposing... And solve for the rotation matrix. The translation vector T. The final transformation matrix [R|T] is the deformation compensation parameter, which accurately describes the rigid body transformation of the second type of tool from Q to P. This is not only identification, but also the completion of parametric modeling of the deformation. Understandably, the output deformation compensation parameter can be directly used by the navigation system to correct the theoretical position of the tool's tip (such as a needle tip), thereby achieving accurate "what you see is what you get" visualization on the display.
[0041] In conjunction with the first aspect, step S140 includes: S141, using deformation compensation parameters, update the transformation relationship of the second type of tool from the tool coordinate system to the image coordinate system in the spatial positioning system.
[0042] S142, based on the updated transformation relationship and the pre-stored standard end position of the second type of tool, calculate the corrected end position of the second type of tool in the image coordinate system to achieve positioning compensation.
[0043] Finally, step S140 transforms the results of all the aforementioned complex calculations and identifications into a structured, standardized, machine-readable high-level calibration data package. The identification results for the first and second types of tools are not merely labels for tool types (e.g., "reference frame A," "puncture needle B"), but rather a structured list. For each identified tool type, the result should at least include: Tool unique identifier: used to correspond to pre-stored models and navigation system configurations; Tool type attribute: Specify whether it is "Category 1" (rigid / static) or "Category 2" (deformable / dynamic).
[0044] The spatial pose of a tool is typically represented by a transformation matrix Ttool_to_world, which describes a rigid transformation from the tool's own coordinate system (the origin of which is usually defined on the tool or a marker sphere) to the step-unified world coordinate system (a three-dimensional physical coordinate system). This matrix is calculated from the coordinates of the centers of all the marker spheres identified by the tool (e.g., the origin and axis of the tool's coordinate system are determined by the least squares method, which is based on a three-dimensional point cloud and can overcome the limitations of voxel discretization to achieve theoretically continuous spatial positioning).
[0045] Detailed coordinates of each marker sphere: List the precise sub-voxel level center coordinates (x, y, z) of each marker sphere in the world coordinate system on this tool, as verification and backup data for pose calculation.
[0046] The deformation compensation parameters for the second type of tool are output for semi-flexible tools. For each tool identified as a second type, in addition to the basic information mentioned above, its deformation compensation parameters are output. This parameter is the rigid transformation matrix [R|T] calculated in step S133 using registration algorithms such as SVD. The physical meaning of this matrix is: it describes the optimal spatial transformation of the tool from a pre-stored standard, undeformed geometric model to the deformed state actually detected in the current CT image.
[0047] This step typically encapsulates all the aforementioned data into a structured data object or file (such as JSON, XML, or a specific binary format). This object not only tells the downstream system "what tool was found" (the recognition result), but also provides "where the tool is and what its orientation is" (spatial pose). Furthermore, for deformable tools, it offers a precise mathematical description of "how far it deviates from its ideal state and how to compensate" (deformation parameters). This allows the downstream system to directly utilize this data for high-precision spatial mapping without any complex reverse derivation.
[0048] Specifically, in software implementation, this step typically encapsulates all the aforementioned data into a structured data object or file (such as JSON, XML format, or a specific binary format). In algorithmic logic, after completing step S130, the task in step S140 is: Data assembly: Create a data structure for each identified tool instance, and fill in the identifier, type, and list of sphere center coordinates.
[0049] Pose calculation: Based on the sphere center coordinate set of the tool, calculate its transformation matrix T_tool_to_world from the tool coordinate system to the world coordinate system.
[0050] Parameter association: For the second type of tool, the [R|T] matrix calculated in step S133 is filled into its data structure.
[0051] Serialization output: Serializes the collection containing all tool data structures into a predefined format and outputs it via function return value, writing to a file, or sending a message.
[0052] This enables plug-and-play functionality for downstream systems: upon receiving this calibration data packet, the navigation system can immediately: By using the pose of the first type of tool (static reference frame), a stable and accurate world coordinate system benchmark is established.
[0053] By using the pose of the second type of tool (dynamic instrument), its real-time position and orientation in space can be determined.
[0054] It is worth noting that step S142 utilizes the deformation compensation parameter [R|T] of the second type of tool to correct the theoretical position of its end point (such as the tip of a blade or needle) in real time. The correction formula is typically as follows: P_corrected_tip_world = T_tool_to_world×[R|T]×P_tip_model Here, P_tip_model represents the coordinates of the end effector in the tool's standard model. This ensures that the position of the instrument's end effector displayed in the navigation image is highly consistent with its actual physical position, effectively resolving navigation errors caused by instrument bending.
[0055] Understandably, the final output calibration data is provided to spatial positioning systems such as optical navigation systems to perform image-to-patient registration, thereby establishing a high-precision mapping relationship between the medical image coordinate system and the patient's physical coordinate system, providing a basis for surgical navigation.
[0056] In conjunction with the first aspect, the method also includes: S210, if the matching error obtained when matching the set of sphere center coordinates with the tool topology model is greater than the first error threshold and less than the second error threshold, then the first level of processing is triggered. The first level of processing includes outputting warning information and entering a waiting confirmation state.
[0057] S220, if the number of identified sphere center coordinates is less than the number of marked spheres required by the corresponding tool in the tool topology model, then the second-level processing is triggered. The second-level processing includes enabling the interactive completion interface to supplement the localization in the CT image data based on the received user input information, and performing local fitting to generate supplementary sphere center coordinates.
[0058] S230, if the matching error is greater than or equal to the second error threshold, or if the matching cannot be completed, the third-level processing is triggered. The third-level processing includes suspending execution and outputting an error flag.
[0059] This embodiment incorporates a hierarchical anomaly handling mechanism. In the automated processing flow of steps S110-S150, multiple monitoring points are set up. Based on the detected anomaly type (quantitative error, missing data, severe failure) and its severity, a matching, progressively escalating response strategy is triggered. This avoids the rigid situation of traditional methods that can only either succeed or fail completely when encountering problems, significantly improving practicality, robustness, and human-machine collaboration efficiency in complex real-world scenarios.
[0060] The core metric monitored in step S210 is the matching error, which is the quantization deviation (e.g., the root mean square error (RMSE) after point set registration) generated when matching the identified set of sphere center coordinates with the pre-stored tool topology model in step S130. The first and second error thresholds constitute a warning interval. The principle behind this mechanism is that in real-world applications, many scenarios (such as slight movement or image noise) can cause the matching error to be slightly higher than the ideal value, but still within an acceptable range. This does not necessarily indicate recognition failure, and completely ignoring or arbitrarily stopping the process is unreasonable.
[0061] The matching error is calculated in real time after the matching is performed. If the error value is greater than the first threshold (indicating that it has exceeded the perfect accuracy range) but less than the second threshold (indicating that it has not yet reached the level of catastrophic failure), this level of processing is triggered, and a warning message is output (such as "Matching accuracy is slightly lower than the standard, please confirm" displayed on the software interface), and the process enters a waiting confirmation state, pausing the subsequent automatic process. At this time, the operator (such as a doctor or technician) can view the specific error data and images, determine whether it is caused by acceptable objective factors, and manually select "Accept and continue" or "Reject and check". This achieves flexible accuracy control, which gives human-machine collaborative decision-making capabilities, ensuring the efficiency of the automated process while introducing necessary human supervision to prevent frequent interruptions to the workflow due to small, acceptable deviations, thus improving the smoothness of the overall process.
[0062] Understandably, the first and second error thresholds can be set based on historical data or clinically acceptable error ranges.
[0063] The problem addressed in step S220 is the insufficient number of identified marker balls. This could be due to severe occlusion, extreme artifacts, or foreign object interference causing a marker ball to be completely missed during the automatic identification process (S110-S120).
[0064] This processing level is triggered when the number of identified sphere centers is less than the preset number for a given tool model. At this point, an interactive completion interface is enabled, typically highlighting the approximate area of the missing sphere in the graphical interface and providing a prompt to the user. The user clicks on the corresponding CT slice view using a mouse or other device (specifying a seed point), providing input information such as "the target is roughly here." Upon receiving this coordinate, the system re-executes a highly sensitive local point cloud extraction and fitting algorithm (e.g., lowering the threshold, small-range RANSAC) within a small local 3D neighborhood, thereby generating and supplementing the coordinates of the missed sphere centers. This achieves selective manual intervention completion, solving extreme cases that fully automated algorithms might struggle to handle with extremely low interaction costs (a single user click), combining human flexibility with the precise computational power of machines. This avoids the inefficient consequence of the entire tool failing due to the missed detection of a few marked spheres, requiring rescanning or completely manual calibration, significantly improving the method's fault tolerance and success rate.
[0065] Step S230 addresses fundamental failure, which has two triggering conditions: First, if the matching error is greater than or equal to the second error threshold, it indicates that the error has exceeded the acceptable or explainable range. Secondly, it is impossible to complete the matching at all (e.g., no matching tool combination can be found).
[0066] The principle is that when the error is so severe that it may output completely erroneous and misleading calibration data, it is unsafe and meaningless to continue execution. It must be stopped decisively, and a clear fault diagnosis entry point should be provided.
[0067] Specifically, when any of the above conditions are met, all subsequent steps in the current identification process should be immediately terminated. Simultaneously, an error flag should be output. This should not be a simple error pop-up, but rather contain structured error information, such as: Error type: Static reference frame matching failed; Possible causes: Reference frame not in view, incorrect model selection, or extremely poor image quality. This provides operators with direct guidance for quick troubleshooting (such as checking equipment placement, reselecting tool models, and assessing image quality). It achieves fault safety and traceability, ensuring that the system does not output unreliable results when serious errors occur, avoiding the risks of using erroneous data for subsequent navigation. Clear error flags also greatly simplify the debugging and problem-solving process, improving system safety and maintainability.
[0068] Example 2 Compared with Embodiment 1, the difference in this application is that step S110 includes: S111, based on CT image data, generates a 3D candidate point cloud corresponding to the marker sphere and interference terms through contour extraction and coordinate mapping.
[0069] S112 performs density-based entity separation on the 3D candidate point cloud, separating the candidate point clusters corresponding to each physical marker sphere.
[0070] S113, For each candidate point cluster, perform an interference-resistant spherical fitting based on random sampling consistency to select the optimal set of interior points.
[0071] S114, based on the selected optimal set of interior points, calculate the sub-voxel level center coordinates of each marked sphere.
[0072] This application first extracts the contour points of CT image data and maps them into a three-dimensional candidate point cloud. Then, it performs density-based entity separation to separate candidate point clusters corresponding to each physical marker sphere, effectively separating neighboring marker spheres and scattered noise. Next, it performs anti-interference spherical fitting based on random sampling consistency on each point cluster to select the optimal set of interior points, directly ensuring the acquisition of sub-voxel-level sphere center coordinates and achieving positioning accuracy beyond the voxel size from the data source.
[0073] In conjunction with the first aspect, step S111 includes: S1111, traverses two-dimensional slices of the CT image along three mutually orthogonal preset directions.
[0074] Among them, the three preset directions that are orthogonal to each other refer to the transverse plane (axial transverse plane, Axial), coronal plane (Coronal), and sagittal plane (Sagittal) in the medical imaging standard. These three directions are perpendicular to each other in pairs, constituting the basic anatomical perspectives for observing three-dimensional objects.
[0075] First, read the CT data (usually stored in the form of a three-dimensional voxel array [i, j, k] in DICOM format, with each direction corresponding to a different index dimension), and generate and access the corresponding two-dimensional slice image sequences along the k direction (transverse plane), j direction (coronal plane), and i direction (sagittal plane) respectively; subsequently, systematically and sequentially access all the slices in each direction in the CT dataset.
[0076] Traditional marker ball recognition methods mostly analyze based on slices in a single direction (usually the transverse plane). However, when the marker ball is blocked by bones, instruments, or its own structure, only a残缺的弧形或完全缺失 can be presented on the slices in this direction, resulting in recognition failure.
[0077] In this application, a three-dimensional observation network is constructed through traversal in three orthogonal directions. For example, a marker ball partially blocked in the transverse plane is very likely to have its complete circular cross-section clearly visible in the coronal and sagittal planes. In terms of implementation, after parsing the three-dimensional array from the DICOM data, the two-dimensional image matrices are cyclically extracted along the k-axis (transverse), j-axis (coronal), and i-axis (sagittal) respectively, so as to obtain the projection contour information of each marker ball on three perpendicular planes, forming multi-perspective observation redundancy and providing complete data guarantee for subsequent processing.
[0078] S1112, for each slice, based on density threshold segmentation, extract the foreground region in the slice and its corresponding two-dimensional contour points.
[0079] Density threshold segmentation directly targets the physical characteristics of CT: different materials have different attenuation degrees for X-rays, which are quantified in Hounsfield units (HU). The density threshold is set based on the CT Hounsfield unit (HU) range of the marker ball, usually HU > -400, to distinguish the X-ray imaging marker from other objects or tissues.
[0080] The X-ray imaging marker (i.e., the marker ball) has a high density, and its CT value (HU) is usually greater than -400 (i.e., significantly higher than the CT value of air). The marker ball is composed of a high-density material that can be recognized by X-rays and a reflective surface that can be recognized by the optical navigation system, or contains a high-density imaging core in the center. Therefore, by setting a reasonable lower limit of the HU threshold (such as HUmin = -400), or a double-threshold interval (such as -400 < HU < 3500), the highlighted pixel region where the marker ball is located can be quickly and accurately separated from the background to obtain the binary foreground region. It should be noted that the "残缺的弧形或完全缺失" in the translation of is a placeholder for the original text which may need to be further refined according to the specific context. And the "二值化的前景区域" in the translation of is a more accurate expression based on the relevant knowledge of image processing in this field.
[0081] In this way, the fundamental differences in physical properties between the target and the background are utilized to achieve pixel-level initial screening.
[0082] In practical applications, for each slice obtained in S111, its HU value is compared pixel-by-pixel with a preset threshold to generate a binary mask. Subsequently, edge detection algorithms (such as the Canny operator) or contour tracking algorithms are used to extract two-dimensional contour points, find the boundary pixels of these foreground regions, and record their integer coordinates (u, v) in the coordinate system of the slice image. Thus, the amount of data is significantly compressed (from voxels of the entire region to edge points), while retaining the most critical shape features (such as curvature and continuity), efficiently filtering out a small number of high-value candidate feature points from a massive number of voxels.
[0083] It is understandable that, regarding contour extraction and point cloud generation, although the aforementioned embodiments employed a density threshold-based segmentation method, those skilled in the art should understand that using other image segmentation techniques (such as edge detection operators like Canny, or semantic segmentation networks based on deep learning) to extract the contours of the marked spheres and map them into three-dimensional candidate point clouds, as long as they serve the core objective of "generating candidate point clouds for subsequent clustering and fitting," falls within the scope of the present invention.
[0084] S1113, based on the index of the slice where the two-dimensional contour points are located and the physical coordinate mapping relationship, the two-dimensional contour points are mapped to a unified three-dimensional physical coordinate system and fused to form a three-dimensional candidate point cloud.
[0085] Physical coordinate mapping is a standard component of medical imaging, stored in the DICOM file header, and mainly includes: Image Position (Patient) refers to the coordinates (x0, y0, z0) of the origin of the slice in the patient coordinate system; Pixel Spacing refers to the physical dimensions (Δx, Δy) of a pixel in the row and column directions, typically in millimeters; Slice Thickness / Spacing refers to the slice thickness or interlayer spacing Δz.
[0086] Step S1113 utilizes the inherent spatial coding information from CT imaging. For a contour point (u, v) extracted from a slice with direction dir and index idx, the corresponding three-dimensional coordinates (x, y, z) in physical space are deduced. Thus, each two-dimensional pixel is assigned a true millimeter-scale spatial location. Specifically, these mapping parameters are parsed and cached during CT data reading. Subsequently, the coordinate transformation calculation described above is performed on each contour point extracted in S112, and the three-dimensional points (x, y, z) calculated in all three directions are aggregated into a unified data structure (such as an Nx3 array) to form a three-dimensional candidate point cloud. This accurately maps tens of thousands of two-dimensional contour points from hundreds of slices in different directions to their true three-dimensional space. For the same physical marker sphere, contour points from transverse, coronal, and sagittal positions will fall on different latitude circles on its surface. The multi-directional point clouds intersect and complement each other, ultimately forming a sparse point cloud shell on the sphere's surface with a more uniform spatial distribution and more complete coverage.
[0087] Since step S111 generates a global candidate surface point cloud set (i.e., a 3D candidate point cloud) through multi-view contour extraction and mapping, this point cloud set is randomly distributed in 3D space. It contains not only valid surface points from each marker sphere but also interference points caused by metal artifacts, tissue noise, or structural adhesions (such as guide wires or bases). Then, step S112 uses a density-based spatial clustering algorithm to group spatially densely clustered point clouds belonging to the same physical entity, thereby separating the discrete point set into candidate point clusters corresponding one-to-one with individual physical marker spheres. Specifically: In this embodiment, the DBSCAN (Density-Based Spatial Clustering of Applications with Noise) algorithm or similar density-based clustering methods are preferably used. The advantage of this algorithm is its ability to discover clusters of arbitrary shapes and effectively identify and separate noise points. It is particularly suitable for processing point cloud distributions whose shapes are not necessarily perfectly regular due to CT imaging and thresholding. The algorithm's principle is based on a spatial fact: points mapped from the same physical marker sphere will naturally form local high-density clusters in three-dimensional space; while points generated by noise, artifacts, or distant irrelevant structures are sparsely distributed. Specifically, the algorithm operates based on two parameters: the neighborhood radius (ε) and the minimum number of points (MinPts). It searches for neighbors within an ε-radius around each point; if the number of neighbors reaches MinPts, it is considered a core point, and all density-connected points are then expanded into the same cluster. The neighborhood radius ε is not a fixed value, but is adaptively calculated based on the known physical diameter of the marker sphere or the resolution (voxel spacing) of the CT image. This ensures that point groups belonging to the same sphere can be accurately captured in CT data of different qualities, for example, set to 1.5 times the radius of the marker sphere. The minimum number of points, MinPts, is estimated based on the projected area of the marker sphere in the image. The effect of this step is to separate the originally disordered and fused global point cloud into several independent candidate point clusters, each of which is strongly correlated with a potential marker sphere, while directly filtering out discrete noise points.
[0088] Subsequently, step S113 performs an interference-resistant spherical fitting based on random sampling consistency on each candidate point cluster to select the optimal set of interior points.
[0089] In conjunction with the first aspect, step S113 includes: S1131, iteratively select a subset from the candidate point cluster to construct a temporary spherical model.
[0090] S1132, calculate the geometric distance from the remaining points within the candidate point cluster to the temporary spherical model.
[0091] S1133, based on the preset sub-voxel level interior point threshold, filters out interior points belonging to the real sphere and removes outlier interference points.
[0092] The subvoxel level in-point threshold ranges from 0.1 mm to 0.7 mm.
[0093] For each candidate point cluster separated in step S112, before proceeding to iterative fitting, its Oriented Bounding Box (OBB) can be calculated, and its dimensions in the three principal directions can be obtained. If the aspect ratio (ratio of the longest side to the shortest side) of a point cluster is significantly greater than a preset threshold (e.g., 3:1), the cluster is determined to be more likely to correspond to strip artifacts (such as CT metallic stripes) or linear adhesion structures rather than spherical objects, and is thus directly eliminated. This step, as a pre-filter, can eliminate a large number of obviously invalid candidates in advance, significantly improving the processing efficiency and overall robustness of subsequent core fitting steps.
[0094] For each candidate point cluster that passes the pre-screening, the Random Sample Consensus (RANSAC) algorithm will be used for robust surface fitting. The core idea of this algorithm is to find the optimal consensus model composed of true data (interior points) from data containing noise and outliers (outside points) through repeated random hypothesis testing and validation. Specifically: Step S1131: In each iteration, multiple points are randomly selected from the current candidate point cluster, sufficient to uniquely determine a geometric model. For spherical fitting, mathematically, multiple (specifically at least four) non-coplanar points are required. Specifically, the algorithm randomly selects multiple points from the point cluster, then uses the three-dimensional coordinates of these points to solve the spherical equation, calculating a temporary initial spherical model containing a temporary center (Ctemp) and a temporary radius (Rtemp). Based on the randomness of selection, it avoids dependence on any prior region, ensuring that in subsequent iterations, there is an opportunity to explore any possible spherical assumptions constituted by real interior points.
[0095] Step S1132: After obtaining a temporary spherical model, calculate the geometric distance from all remaining points in the candidate point cluster to the sphere.
[0096] Specifically, for any point Pi, its distance di = |dist(Pi, Ctemp) - Rtemp|, which is the absolute difference between the Euclidean distance from the point to the center of the sphere and the temporary radius; Since real spherical points should be densely distributed within a narrow band near the theoretical sphere (defined by the interior point threshold), while artifacts, adhesions, and other interfering points fall outside this region, in step S1222, the calculated distance di is compared with a preset interior point threshold (specifically, a sub-voxel level interior point threshold): If di is less than the threshold, point Pi is considered to be consistent with the temporary spherical model and is classified as an interior point (i.e., a point belonging to the surface of the real sphere); otherwise, it is classified as an exterior point (i.e., an outlier). This step is the key to the RANSAC algorithm in eliminating interference. It can effectively remove outliers in each point cluster caused by metal artifacts (such as radial stripes) and structural adhesions (such as bases, fasteners, or adjacent tissues connected to the sphere), even if these interference points are spatially connected to the real spherical points.
[0097] Steps S1131 to S1133 are executed iteratively hundreds to thousands of times. Each iteration produces a temporary model and its corresponding set of interior points. The stopping condition for the iteration is usually preset to one or a combination of the following two: 1) Reach the maximum number of iterations (e.g., 1000 times) to prevent infinite loops; 2) The proportion of interior points to the total number of points in the cluster of the model found in the current iteration has exceeded a very high pre-set confidence threshold (such as 95%), indicating that a sufficiently good model has been found.
[0098] When the stopping condition is met, the set with the largest number of interior points from all the interior point sets generated in all iterations is selected as the optimal interior point set. This step, through a large number of random assumptions and verifications, ultimately selects the model that obtains the broadest consensus (the most interior point support). The interior point set corresponding to this model is the purest spherical point estimate obtained after eliminating interference from the current point cluster.
[0099] To achieve sub-voxel-level positioning accuracy, the sub-voxel-level interior point threshold must be set significantly smaller than the voxel size of the CT image to ensure that the accuracy of the final sphere center coordinates exceeds the limitations of voxel discretization. Based on the typical voxel size range of medical CT images (typically 0.3 mm to 1.0 mm), the interior point threshold is typically set between 0.1 mm and 0.7 mm. In a preferred embodiment, the threshold can be adaptively set according to the resolution of the specific CT data, for example, a value of 0.1 to 0.8 times the voxel size of the current CT image.
[0100] Understandably, the core principle of the RANSAC (Ranked Consensus and Interaction) algorithm for robust fitting is to distinguish between inliers and outliers. It does not assume all data points are valid; instead, it uses repeated random sampling to find the model that achieves the greatest internal consensus, effectively eliminating outliers in each cluster caused by metallic artifacts (such as radial stripes) and structural adhesions (such as bases, fasteners, or adjacent tissues connected to the sphere). Even if these interfering points are spatially connected to the true spherical points and have passed through clustering, RANSAC can identify and exclude them using its robust strategy of finding the largest consensus set, thus selecting a high-confidence, true set of surface points (inliers) for each sphere.
[0101] Finally, step S114 uses the least squares method to calculate the sub-voxel level center coordinates of each marked sphere based on the selected optimal set of interior points.
[0102] After obtaining a pure set of interior points, deterministic optimization is performed using the least squares method. The principle is to find a set of spherical parameters (sphere center (cx, cy, cz) and radius R) such that the sum of the squared distances from all interior points to the sphere is minimized. This is a mathematical problem with a deterministic optimal solution. In implementation, the interior point set is constructed as an overdetermined system of equations and transformed into a linear least squares problem through linearization, typically solved using numerically stable methods such as singular value decomposition (SVD). First, sub-voxel-level positioning accuracy is achieved. Because the calculation is based on a large number of precise 3D interior points and global optimal estimation, the accuracy of the obtained sphere center coordinates can significantly exceed the voxel size of the original CT image, which is crucial for applications requiring sub-millimeter accuracy, such as medical navigation. Second, it outputs a stable and reliable set of sphere center coordinates, which serves as a direct and accurate input for subsequent steps S120-S140 (tool recognition and deformation calibration) for high-level semantic analysis and spatial calculations, providing a high-precision data source. In a second aspect, embodiments of this application provide an automatic marker sphere recognition device in CT images, combined with... Figure 2 As shown, the device includes: an extraction module 10, an identification module 20, a registration module 30, and an output module 40.
[0103] The extraction module 10 is used to obtain the subvoxel-level center coordinates of each marked sphere in the CT image.
[0104] The identification module 20 is used to identify, based on a pre-stored tool topology model, a first class of tools with a fixed topology and a second class of tools with a variable topology from sub-voxel level sphere center coordinates.
[0105] The registration module 30 is used to construct the actual sphere center coordinate set of the second type of tool, and to perform rigid registration calculation between the actual sphere center coordinate set and the pre-stored standard model coordinate set to calculate the deformation compensation parameters used to characterize the physical deformation of the second type of tool.
[0106] The output module 40 outputs the identification results of the first type of tool and the second type of tool, as well as the calibration data of the deformation compensation parameters of the second type of tool.
[0107] Thirdly, embodiments of this application provide an electronic device, combined with Figure 3 As shown, the electronic device includes a memory 131 and a processor 130. The memory 131 stores a computer program, and the processor 130 runs the computer program to make the electronic device perform the above-described method.
[0108] Furthermore, combined Figure 3The electronic device shown also includes a bus 132 and a communication interface 133, with the processor 130, the communication interface 133 and the memory 131 connected via the bus 132.
[0109] The memory 131 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 133 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc. The bus 132 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 3 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0110] Processor 130 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 130 or by instructions in software form. Processor 130 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 131, and processor 130 reads the information in memory 131 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.
[0111] Fourthly, embodiments of this application provide a readable storage medium storing computer program instructions, which are read and executed by a processor to perform the above-described method.
[0112] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0113] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.
[0114] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0115] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0116] Finally, it should be noted that the above embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A flexible tool calibration method based on CT images, characterized in that, The method includes: Obtain the subvoxel-level center coordinates of each marked sphere in the CT image; Based on the pre-stored tool topology model, a point set matching algorithm is used to identify a first type of tool with a fixed topology and a second type of tool with a variable topology from the sub-voxel level sphere center coordinates. Construct the actual sphere center coordinate set of the second type of tool, perform rigid registration calculation between the actual sphere center coordinate set and the pre-stored standard model coordinate set, and calculate the deformation compensation parameters used to characterize the physical deformation of the second type of tool; The output includes the identification results of the first type of tool and the second type of tool, as well as the calibration data of the deformation compensation parameters of the second type of tool.
2. The method according to claim 1, characterized in that, The steps of identifying a first class of tools with a fixed topology and a second class of tools with a variable topology from the sub-voxel-level sphere center coordinates based on a pre-stored tool topology model include: Based on the pre-stored tool topology model, the first type of tool is searched and locked in the sphere center coordinates using the first tolerance threshold as a geometric constraint. After removing the coordinates of the first type of tool that has been identified from the sphere center coordinates, a second tolerance threshold greater than the first tolerance threshold is used as a geometric constraint to search for and identify the second type of tool.
3. The method according to claim 1, characterized in that, The step of outputting the identification results of the first type of tool and the second type of tool, as well as the calibration data of the deformation compensation parameters of the second type of tool, includes: Using the deformation compensation parameters, update the transformation relationship of the second type of tool from the tool coordinate system to the image coordinate system in the spatial positioning system; Based on the updated transformation relationship and the pre-stored standard end position of the second type of tool, the corrected end position of the second type of tool in the image coordinate system is calculated to achieve positioning compensation.
4. The method according to claim 1, characterized in that, The method further includes: If the matching error obtained when matching the set of sphere center coordinates with the tool topology model is greater than the first error threshold and less than the second error threshold, then the first level of processing is triggered. The first level of processing includes outputting warning information and entering a waiting confirmation state. If the number of identified sphere center coordinates is less than the number of marked spheres required by the corresponding tool in the tool topology model, a second-level process is triggered. The second-level process includes enabling the interactive completion interface, performing local relocalization in the CT image data based on the received user-specified region information, and performing local fitting to generate supplementary sphere center coordinates. If the matching error is greater than or equal to the second error threshold, or if the matching cannot be completed, a third-level process is triggered, which includes suspending execution and outputting an error flag.
5. The method according to claim 1, characterized in that, The steps for obtaining the sub-voxel-level center coordinates of each marked sphere in a CT image include: Based on CT image data, a 3D candidate point cloud corresponding to the marker sphere and interference items is generated through contour extraction and coordinate mapping. Density-based entity separation is performed on the three-dimensional candidate point cloud to separate candidate point clusters corresponding to each physical marker sphere; For each candidate point cluster, an interference-resistant spherical fitting based on random sampling consistency is performed on the candidate point cluster to select the optimal set of interior points; Based on the selected optimal set of interior points, the sub-voxel level center coordinates of each marked sphere are calculated using the least squares method.
6. The method according to claim 5, characterized in that, The steps for generating a 3D candidate point cloud corresponding to the marker sphere and artifact interference based on CT image data include: Traverse two-dimensional slices of the CT image along three mutually orthogonal preset directions; For each slice, the foreground region and its corresponding two-dimensional contour points in the slice are extracted based on density threshold segmentation; Based on the index of the slice where the two-dimensional contour points are located and the physical coordinate mapping relationship, the two-dimensional contour points are mapped to a unified three-dimensional physical coordinate system and fused to form the three-dimensional candidate point cloud.
7. The method according to claim 5, characterized in that, The step of performing robust spherical fitting based on random sampling consistency on the candidate point cluster includes: A subset is iteratively and randomly selected from the candidate point cluster to construct a temporary spherical model; Calculate the geometric distance from the remaining points within the candidate point cluster to the temporary spherical model; Based on a preset sub-voxel level interior point threshold, interior points belonging to the real sphere are selected, and outlier interference points are removed. The subvoxel-level in-point threshold ranges from 0.1 mm to 0.7 mm.
8. A flexible tool calibration device based on CT images, characterized in that, The device includes: The acquisition module is used to obtain the sub-voxel level center coordinates of each marked sphere in the CT image; The identification module is used to identify, based on a pre-stored tool topology model, a point set matching algorithm from the sub-voxel level sphere center coordinates, a first type of tool with a fixed topology and a second type of tool with a variable topology. The registration module is used to construct the actual sphere center coordinate set of the second type of tool, perform rigid registration calculation between the actual sphere center coordinate set and the pre-stored standard model coordinate set, and calculate the deformation compensation parameters used to characterize the physical deformation of the second type of tool. The output module is used to output calibration data containing the identification results of the first type of tool and the second type of tool, as well as the deformation compensation parameters of the second type of tool.
9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program and the processor running the computer program to cause the electronic device to perform the method of any one of claims 1 to 7.
10. A storage medium, characterized in that, The storage medium stores computer program instructions, which, when read and executed by a processor, perform the method described in any one of claims 1 to 7.
