A space conversion method, device, electronic equipment and medium
By introducing the target normal vector into the nearest point search algorithm and considering the relationship between points and planes, the problem that traditional algorithms are prone to falling into local optimal solutions is solved and the accuracy of space transformation is improved.
Patent Information
- Application Number
- CN202410733825.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-06-07
AI Technical Summary
The traditional nearest point search algorithm easily falls into a local optimal solution during spatial transformation, resulting in low transformation accuracy.
By introducing the target normal vector, the spatial transformation relationship is determined based on the nearest point search algorithm, and the relative relationship between points and planes is considered to avoid only considering the distance from point to point.
It improves the accuracy of spatial transformation, avoids the problem of local optimal solutions, and ensures the accuracy of the transformation relationship.
Smart Images

Figure CN118333848B
Abstract
Description
Technical Field
[0001] The present application belongs to the field of image data processing, and specifically relates to a space conversion method, device, electronic equipment and medium. Background Art
[0002] In many industries that require manual operations, in order to achieve operational accuracy, it is necessary to use another space (mostly virtual space) to navigate the operation in the actual space, which requires coordinate conversion between the two spaces to align the corresponding points between the two spaces. For example, when doctors perform surgery, they sometimes need to use a surgical navigation system, which can realize the conversion between patient space and image space.
[0003] At present, the Iterative Closest Point (ICP) algorithm is often used in spatial transformation. However, the traditional closest point search algorithm only considers the point-to-point distance between two point clouds to find the transformation relationship, which can easily cause the solution to fall into a local optimal solution, thus failing to guarantee the conversion accuracy. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a spatial conversion method, device, electronic device and medium, which can avoid falling into a local optimal solution when using a nearest point search algorithm for spatial conversion to ensure conversion accuracy.
[0005] In a first aspect, an embodiment of the present application provides a conversion method, including:
[0006] Obtain multiple marker points to be converted in the first space;
[0007] Converting the plurality of to-be-converted marking points to the second space according to a spatial conversion relationship between the first space and the second space;
[0008] The spatial conversion relationship is obtained by the following steps:
[0009] Acquire a plurality of first marking points in the first space, wherein the plurality of first marking points represent characteristics of an object to be converted;
[0010] Acquire a plurality of second marking points in the second space corresponding to the plurality of first marking points, wherein the feature of the object to be converted represented by each of the second marking points is the same as the feature of the object to be converted represented by the corresponding first marking point;
[0011] Determine a target normal vector corresponding to each of the second marking points, wherein the target normal vector is perpendicular to a plane where a feature of the object to be converted represented by the second marking point is located;
[0012] Using the plurality of target normal vectors, based on a nearest point search algorithm, a conversion relationship between the plurality of first marking points and the plurality of second marking points is determined, and the conversion relationship is used as the spatial conversion relationship.
[0013] In a second aspect, an embodiment of the present application provides a space conversion device, the device comprising:
[0014] A to-be-marked point acquisition module, used to acquire a plurality of to-be-converted marked points in the first space;
[0015] A conversion module, configured to convert the plurality of to-be-converted marking points into the second space according to a spatial conversion relationship between the first space and the second space;
[0016] The space conversion relationship acquisition module is used to obtain the space conversion relationship through the following steps:
[0017] A first marking point acquisition unit, configured to acquire a plurality of first marking points in the first space, wherein the plurality of first marking points represent characteristics of an object to be converted;
[0018] A second marking point acquisition unit, configured to acquire a plurality of second marking points in the second space corresponding to the plurality of first marking points, wherein a feature of an object to be converted represented by each of the second marking points is the same as a feature of an object to be converted represented by a corresponding first marking point;
[0019] A target normal vector determining unit, used to determine a target normal vector corresponding to each of the second marking points, wherein the target normal vector is perpendicular to a plane where a feature of the object to be converted represented by the second marking point is located;
[0020] A spatial transformation relationship determination unit is used to use multiple target normal vectors, based on a nearest point search algorithm, to determine the transformation relationship between multiple first marking points and multiple second marking points, and use the transformation relationship as the spatial transformation relationship.
[0021] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the spatial conversion method described in the first aspect of the embodiment of the present application are implemented.
[0022] In a fourth aspect, an embodiment of the present application provides a machine-readable storage medium, on which instructions are stored. When the instructions are executed by a processor, the processor implements the space conversion method described in the first aspect of the embodiment of the present application.
[0023] In an embodiment of the present application, a plurality of to-be-converted marking points in a first space are converted to a second space through a spatial conversion relationship between the first space and the second space, and the spatial conversion relationship is determined by a plurality of first marking points in the first space and a plurality of second marking points in the second space. A plurality of first marking points correspond to a plurality of second marking points one by one, and when the aforementioned spatial conversion relationship is determined using a plurality of first marking points and a plurality of second marking points based on a nearest point search algorithm, a target normal vector is introduced, and the target normal vector is perpendicular to the plane where the features of the object to be converted represented by the second marking point are located. In this way, in the process of finding the aforementioned spatial conversion relationship using the nearest point search algorithm, only the point-to-point distance between the two point clouds is no longer considered to find the spatial conversion relationship. The plane where the features of the object to be converted represented by the second marking point are located is introduced into the nearest point search algorithm through the target normal vector, so that the nearest point search algorithm incorporates the evaluation of the relative relationship between the point and the plane in the process of iterative optimization, so as to avoid the problem of being easily trapped in a local optimal solution caused by the traditional nearest point search algorithm which only considers the point-to-point distance between the two point clouds. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 is a schematic diagram of a flow chart of a space conversion method provided in an embodiment of the present application;
[0025] Figure 2 It is a flowchart of the step of determining the spatial conversion relationship in the spatial conversion method provided in an embodiment of the present application;
[0026] Figure 3 is a schematic diagram of the structure of a space conversion device provided in an embodiment of the present application;
[0027] Figure 4 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0029] The terms "first", "second", etc. in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more.
[0030] In the following, in combination with the accompanying drawings, a space conversion method, device, electronic device and medium provided by the embodiments of the present application are described in detail through specific embodiments and their application scenarios.
[0031] See also Figure 1 , is a flow chart of a space conversion method provided in an embodiment of the present application. In a first aspect, an embodiment of the present application provides a space conversion method, comprising the following steps S010-S020, and steps S100-S400:
[0032] Step S010: Acquire a plurality of to-be-converted marking points in the first space.
[0033] When the processor performs space conversion, it actually converts between two coordinate systems through the space conversion relationship between the two spaces.
[0034] Specifically, in the surgical navigation system in the clinical medical field, the surgical navigation system needs to realize the conversion between the patient space and the image space (that is, the patient space is used as the first space and the image space is used as the second space) to achieve the coordinate unification of each point between the patient space and the image space, that is, to project each point in the patient space in the image space to ensure the accuracy of the surgical navigation process. When the processor converts between the patient space and the image space, it first needs to obtain the marker points to be converted in the patient space for the subsequent space conversion process.
[0035] Step S020: converting the plurality of to-be-converted marking points into the second space according to the space conversion relationship between the first space and the second space.
[0036] After acquiring multiple marker points to be converted in the first space, the processor uses the spatial conversion relationship between the first space and the second space to perform coordinate conversion on the multiple marker points to be converted so that the multiple points to be converted are projected into the second space, that is, the specific coordinates of the features represented by the multiple marker points to be converted in the second space are obtained.
[0037] Specifically, in the conversion between the patient space and the image space, the multiple points to be converted can be any points in the patient space that represent any features, and these represented features need to obtain coordinate representation in the image space. The processor uses the spatial conversion relationship between the patient space and the image space to convert the multiple points to be converted into the image space, so that the features represented by the multiple points to be converted can have corresponding coordinates in the image space.
[0038] It can be seen that the key to completing the above-mentioned spatial conversion steps S010 to S020 lies in the spatial conversion relationship between the first space and the second space. Specifically, in the surgical navigation system, the acquisition of the spatial conversion relationship between the patient space and the image space is called spatial registration.
[0039] See also Figure 2 , Figure 2 : is a flow chart of the steps of determining the spatial conversion relationship in the spatial conversion method provided in an embodiment of the present application. The spatial conversion relationship is obtained through steps S100 to S400 as described below:
[0040] Step S100: Acquire a plurality of first marking points in a first space, wherein the plurality of first marking points represent features of an object to be converted.
[0041] In the process of determining the spatial conversion relationship between the first space and the second space, it is first necessary to obtain multiple first marking points of the first space for determining the spatial conversion relationship, each of which represents the characteristics of the object to be converted in the first space.
[0042] Specifically, in the patient space, the first marking point is determined according to the area where the surgical navigation system needs to perform surgical navigation, that is, the area where the object to be converted is located. The processor can use certain anatomical physiological features or certain pathological features of the patient, such as feature points of the nose tip, tragus, eye corners or tumor area, as multiple first marking points, each of which represents the geometric features of the corresponding object to be converted.
[0043] Step S200: Acquire a plurality of second marking points corresponding to the plurality of first marking points in the second space, wherein the feature of the object to be converted represented by each second marking point is the same as the feature of the object to be converted represented by the corresponding first marking point.
[0044] Determination of the spatial conversion relationship also requires multiple second marking points in the second space, and the multiple second marking points correspond one-to-one to the multiple first marking points, that is, the characteristics of the object to be converted represented by each second marking point are the same as the characteristics of the object to be converted represented by the corresponding first marking point.
[0045] Specifically, in the patient space, for example, if the number of the multiple first marking points is 3, which respectively represent the three features of the tip of the nose, the tragus, and the corner of the eye, then when determining the second marking point, it is also necessary to select points in the image space that represent the three features of the tip of the nose, the tragus, and the corner of the eye as the three second marking points corresponding to the three first marking points.
[0046] Step S300: determining a target normal vector corresponding to each second marking point, wherein the target normal vector is perpendicular to a plane where the feature of the object to be converted represented by the second marking point is located.
[0047] Compared with the traditional spatial transformation method using the nearest point search algorithm for point cloud matching, the spatial transformation method provided in the embodiment of the present application introduces a plane where the features of the object to be converted represented by the second marking point are located (that is, the transformation plane between the first marking point and the corresponding second marking point), so that the nearest point search algorithm can incorporate the evaluation of the relative relationship between the point and the plane in the process of iterative optimization of the transformation relationship. The plane where the features of the object to be converted represented by the second marking point are located is introduced through a normal vector perpendicular to the plane where the features of the object to be converted represented by the second marking point are located. The processor determines this normal vector as the target normal vector, so it is necessary to determine the target normal vector of each second marking point for subsequent nearest point search algorithm.
[0048] Specifically, if the image space is a two-dimensional (planar) model of the patient space, that is, the coordinates of the points in the image space are always 0 in a certain direction, then all the second marking points are in the same plane, and the target normal vectors of all the second marking points can select the same vector, which is perpendicular to the plane.
[0049] If the image space is a three-dimensional (stereoscopic) model of the patient space, all the second marker points are not necessarily in the same plane. It is necessary to determine the plane in which the features on the object to be converted (nose tip, tragus, eye corner, etc.) represented by each second marker point are located, and determine a normal vector perpendicular to the plane as the target normal vector of the second marker point.
[0050] Step S400: using multiple target normal vectors, based on the nearest point search algorithm, determine the conversion relationship between the multiple first marking points and the multiple second marking points, and use the conversion relationship between the multiple first marking points and the multiple second marking points as the above-mentioned spatial conversion relationship.
[0051] After all target normal vectors are determined, that is, all target normal vectors are combined and utilized to determine the conversion relationship between multiple first marking points and multiple second marking points, that is, the two point clouds, based on the nearest point search algorithm, and the conversion relationship between the determined multiple first marking points and the multiple second marking points is used as the spatial conversion relationship between the above-mentioned first space and the second space, so as to be used for the conversion of the points to be converted in the first space.
[0052] Through the above steps S010-S020, and steps S100-S400, a plurality of marker points to be converted in the first space are converted to the second space through the spatial conversion relationship between the first space and the second space, and the spatial conversion relationship is determined by a plurality of first marker points in the first space and a plurality of second marker points in the second space. The plurality of first marker points correspond to the plurality of second marker points one by one. When the spatial conversion relationship is determined by the plurality of first marker points and the plurality of second marker points based on the nearest point search algorithm, a target normal vector is introduced, and the target normal vector is perpendicular to the plane where the features of the object to be converted represented by the second marker point are located. In this way, in the process of finding the above spatial conversion relationship using the nearest point search algorithm, only the point-to-point distance between the two point clouds is no longer considered to find the spatial conversion relationship. The plane where the features of the object to be converted represented by the second marker point are located is introduced into the nearest point search algorithm through the target normal vector, so that the nearest point search algorithm includes the evaluation of the relative relationship between the point and the plane in the process of iteratively optimizing the spatial conversion relationship, so as to avoid the problem of being easily trapped in the local optimal solution caused by the traditional nearest point search algorithm that only considers the point-to-point distance between the two point clouds.
[0053] In some embodiments, the transformation relationship includes a rotation matrix and a translation matrix, and the transformation relationship between the plurality of first marking points and the plurality of second marking points is determined based on a nearest point search algorithm using a plurality of target normal vectors, including:
[0054] Determining a cross product of each first marker point and the corresponding target normal vector;
[0055] Determine an error vector of each first marking point according to the plurality of target normal vectors, wherein the error vector is a vertical distance between the first marking point and a plane where the corresponding second marking point is located;
[0056] determining a rotation matrix based on a plurality of cross products, a plurality of target normal vectors, and a plurality of error vectors;
[0057] Based on the nearest point search algorithm, the translation matrix is obtained by iterative calculation using the rotation matrix, the pre-translation matrix, multiple cross products, multiple error vectors and multiple target normal vectors.
[0058] The transformation relationship between multiple first marking points and multiple second marking points can be composed of a rotation matrix and a translation matrix. The rotation matrix is used to rotate the point cloud composed of multiple first marking points, and the translation matrix is used to translate the point cloud composed of multiple first marking points, so that the point cloud composed of multiple first marking points can be aligned with the point cloud composed of multiple second marking points, thereby realizing the transformation between the first space and the second space.
[0059] Specifically, the rotation matrix can be obtained by constructing a linear relationship solution, that is, the subsequent closest point search algorithm is only used to find the translation matrix to reduce the optimization difficulty in the iterative optimization process using the closest point search algorithm.
[0060] Constructing the linear relationship for solving the rotation matrix requires the cross product between each first marker point and the corresponding target normal vector (that is, the target normal vector corresponding to the second marker point corresponding to the first marker point). Therefore, the processor first determines the cross product between each first marker point and the corresponding target normal vector. This cross product actually represents the distance between the first marker point and the corresponding target normal vector.
[0061] Constructing the linear relationship for solving the rotation matrix also requires determining the error vector of each first marking point. The error vector is the vertical distance between the plane where the features of the object to be converted represented by the first marking point and the corresponding second marking point are located. Specifically, if the coordinates of the first marking point are (a, b, c) and the coordinates of the corresponding second marking point are (d, e, f), the error vector of the first coordinate point is the dot product between (ad, be, cf) and the target normal vector corresponding to the first marking point.
[0062] After all cross products and all error vectors are determined, the linear relationship for solving the rotation matrix can be constructed using all cross products, all error vectors and all target normal vectors to solve the rotation matrix.
[0063] After the rotation matrix is determined, based on the nearest point search algorithm, iterative calculations are performed using the determined rotation matrix, all cross products and all error vectors. During the iteration, the translation matrix determination process is continuously optimized to obtain the translation matrix. At this point, the transformation relationship between multiple first marking points and multiple second marking points is determined, and the transformation relationship is the spatial transformation relationship between the first space and the second space.
[0064] In some implementations, based on a closest point search algorithm, a rotation matrix, multiple cross products, multiple error vectors, and multiple target normal vectors are used for iterative calculation to obtain a translation matrix, including:
[0065] Transforming a plurality of first marking points using a rotation matrix and a pre-translation matrix;
[0066] Determine the conversion errors between the converted first marker points and the converted second marker points according to the multiple cross products, the multiple error vectors, the rotation matrix and the pre-translation matrix;
[0067] Iteratively update the pre-translation matrix according to the conversion error, and repeat the above steps until the conversion error or the number of iterations meets the iteration termination condition;
[0068] The pre-translation matrix after the iteration is terminated is used as the translation matrix.
[0069] The determination of the translation matrix in the conversion relationship is completed based on multiple iterations. In the case where the iteration termination condition is not met, in each iteration process, the rotation process of multiple first marking points is performed using the determined rotation matrix, and the translation process of multiple first marking points is performed using the pre-translation matrix. After one rotation process and translation process are completed, the conversion error between the converted multiple first marking points and the multiple second marking points is determined, and the conversion error is used as the reference standard for iterative update of the pre-translation matrix. The pre-translation matrix is iteratively updated and used as the pre-translation matrix in the next iteration process until the conversion error or the number of iterations meets the iteration termination condition, and the pre-translation matrix after the iteration is terminated is used as the translation matrix. At this point, the conversion relationship is determined.
[0070] Specifically, in one iteration process, the processor first rotates and translates multiple first marker points using the rotation matrix and pre-translation, and then determines the conversion errors between the converted multiple first marker points and the multiple second marker points based on all the above-mentioned cross products, all error vectors, rotation matrices and all target normal vectors to judge the conversion effect.
[0071] After the conversion error is determined, the processor iteratively updates the pre-translation matrix according to the conversion error. The processor can use a numerical optimization method (such as gradient descent, least squares method, etc.) to iteratively update the pre-translation matrix according to the conversion error, and use the iteratively updated pre-translation matrix as the pre-translation matrix in the next iteration process. It can be understood by those skilled in the art that the initial pre-translation matrix in the first iteration process can be set to (0,0,0), and the technician can also estimate the initial translation matrix based on the geometric features of the point cloud composed of multiple first marker points or known transformation information, or determine it based on experience or prior knowledge.
[0072] When the conversion error or the number of iterations meets the iteration termination condition, the iteration process is terminated, and the processor uses the pre-translation matrix after the iteration termination as the optimized translation matrix, and the conversion relationship between the multiple first marking points and the multiple second marking points is determined to be completed.
[0073] In some implementations, the iteration termination condition is that the conversion error does not increase compared to the conversion error in the previous iteration process, or the number of iterations has reached a preset number of iterations.
[0074] In some implementations, the conversion error is expressed as:
[0075] (1)
[0076] in, is the conversion error, is the encoding of the first marking point and the second marking point after conversion, is the number of the first marker points after conversion, is the first marker point after conversion, is the second marking point, is the target normal vector, is the rotation matrix, is the translation matrix, is the error vector, is the cross product.
[0077] The conversion error can be determined by the above formula (1). It can be seen from the above formula (1) that the conversion error involves the cross product and the error vector, that is, it involves the distance between each first marker point and the corresponding target normal vector, and the vertical distance between the plane where the feature of the object to be converted represented by each first marker point and the corresponding second marker point is located, so that the nearest point search algorithm incorporates the evaluation of the relative relationship between the point and the plane in the process of iteratively optimizing the pre-translation matrix.
[0078] In some implementations, determining a rotation matrix based on a plurality of cross products, a plurality of target normal vectors, and a plurality of error vectors includes:
[0079] Construct a relationship matrix using multiple cross products and multiple target normal vectors;
[0080] constructing a relation vector using multiple cross products, multiple target normal vectors, and multiple error vectors;
[0081] Determine the rotation matrix based on the relationship matrix and the relationship vector.
[0082] In the embodiment of the present application, the iterative optimization process is only used to perform iterative optimization of the pre-translation matrix, and the rotation matrix in the transformation relationship is obtained by constructing a linear relationship.
[0083] In the process of constructing the linear relationship and solving the rotation matrix, the processor first uses all cross products and all target normal vectors to construct a relationship matrix, which reflects the vertical distance between each first marker point and the corresponding target normal vector and the information of each target normal vector.
[0084] The processor then uses all cross products, all target normal vectors and all error vectors to construct a relationship vector, which reflects the vertical distance between each first marker point and the plane where the corresponding second marker point is located, the vertical distance between each first marker point and the corresponding target normal vector, and each target normal vector.
[0085] Finally, the processor uses the determined relationship matrix and relationship vector to build a linear relationship with the rotation matrix to solve the rotation matrix, as shown in the following formula:
[0086] (2)
[0087] in, is the rotation matrix, is the relationship matrix, is the relationship vector.
[0088] Specifically, when solving the rotation matrix, in order to facilitate the solution, the rotation matrix can be Approximately an identity matrix , this approximate rotation matrix can be applied when solving and using the rotation matrix ,Right now:
[0089] (3)
[0090] (4)
[0091] in, is the rotation matrix, is the approximate rotation matrix, , , for The unknown parameters that need to be solved through the above linear relationship.
[0092] In some implementations, the relationship matrix is expressed as:
[0093] (5)
[0094] The expression formula of the relationship vector is:
[0095] (6)
[0096] in, is the relationship matrix, is the relationship vector, is the code of the first marking point and the second marking point, is the number of the first marking points, is the first marking point, is the second marking point, is the target normal vector, is the cross product, is the error vector.
[0097] The relationship vector and the relationship matrix can be constructed according to the above formula (5) and formula (6). It can be seen from the above formula (5) and formula (6) that the relationship matrix reflects the vertical distance between each first marker point and the corresponding target normal vector (reflected by the cross product of each first marker point and the corresponding target normal vector) and each target normal vector, and the relationship vector reflects the vertical distance between each first marker point and the plane where the corresponding second marker point is located (reflected by the error vector of each first marker point), the vertical distance between each first marker point and the corresponding target normal vector (reflected by the cross product of each first marker point and the corresponding target normal vector) and each target normal vector.
[0098] In this way, the relationship matrix and relationship vector are used to construct a linear relationship for solving the rotation matrix, the rotation matrix is solved, and the solved rotation matrix is applied to the subsequent iterative process of solving the translation matrix. That is, during the iterative process, only the pre-translation matrix needs to be iteratively updated, and the rotation matrix does not need to be iteratively updated, which reduces the numerical optimization tasks in the iterative process and makes the iterative process easier to complete.
[0099] In some implementations, obtaining a plurality of second marking points corresponding to the plurality of first marking points in the second space includes:
[0100] Preprocessing the image in the first space by using a region growing segmentation algorithm;
[0101] Performing model conversion using the preprocessed image to form a model image corresponding to the first space as the second space;
[0102] According to the plurality of first marking points, a plurality of corresponding marking points are selected in the second space as a plurality of second marking points.
[0103] In the process of acquiring the second marking points corresponding to the first marking points in the second space, the processor firstly pre-processes the image of the first space by using the region growing segmentation algorithm to segment the image of the first space, and performs model conversion by using the segmented image of the first space to obtain a model image corresponding to the object to be converted in the first space. The model image is used as the second space where the marking points of the first space need to be projected.
[0104] Because the region growing segmentation algorithm is used for image segmentation before model conversion, the processor can more accurately determine the boundaries of the region of interest in the image. When performing model conversion, it ensures that only the relevant regional structure of the object to be converted is included in the model image, avoiding interference from irrelevant areas. At the same time, using the region growing segmentation algorithm for image segmentation also optimizes the use of processor computing resources - by reducing the amount of image data analyzed and processed, the processor computing burden is reduced.
[0105] The processor then selects a plurality of second marking points corresponding to the plurality of first marking points in the determined second space, that is, selects a plurality of points whose features of the objects to be converted are the same as the features of the objects to be converted represented by the corresponding first marking points as the plurality of second marking points.
[0106] Specifically, the processor first acquires an image of the patient space, such as a Computed Tomography (CT) image, a Nuclear Magnetic Resonance Imaging (NMRI) image, etc., and then segments the above image using a region growing segmentation algorithm.
[0107] Using 3D reconstruction technology, the segmented image is converted into a 3D virtual model, which corresponds to the object to be converted in the patient space as the second space, i.e., the image space. For example, if the object to be converted in the patient space is a human brain, the 3D virtual model is a 3D virtual brain model.
[0108] The processor then selects a plurality of second marking points corresponding to the plurality of first marking points in the determined completed 3D virtual model, that is, selects a plurality of points whose features of the objects to be converted are the same as the features of the objects to be converted represented by the corresponding first marking points as the plurality of second marking points.
[0109] See also Figure 3 , is a schematic diagram of the structure of a space conversion device provided in an embodiment of the present application. In a second aspect, an embodiment of the present application provides a space conversion device 1000, and the device 1000 includes:
[0110] The to-be-marked point acquisition module 1100 is used to acquire a plurality of to-be-converted marked points in the first space;
[0111] A conversion module 1200, configured to convert a plurality of to-be-converted marking points into the second space according to a space conversion relationship between the first space and the second space;
[0112] The space conversion relationship acquisition module 1300 is used to obtain the space conversion relationship through the following steps:
[0113] A first marking point acquisition unit 1310 is used to acquire a plurality of first marking points in a first space, wherein the plurality of first marking points represent features of an object to be converted;
[0114] A second marking point acquisition unit 1320 is used to acquire a plurality of second marking points corresponding to the plurality of first marking points in the second space, wherein the feature of the object to be converted represented by each second marking point is the same as the feature of the object to be converted represented by the corresponding first marking point;
[0115] A target normal vector determining unit 1330 is used to determine a target normal vector corresponding to each second marking point, wherein the target normal vector is perpendicular to a plane where a feature of the object to be converted represented by the second marking point is located;
[0116] The spatial transformation relationship determining unit 1340 is used to determine the transformation relationship between the plurality of first marking points and the plurality of second marking points based on the nearest point search algorithm using the plurality of target normal vectors, and use the transformation relationship as the spatial transformation relationship.
[0117] The space conversion device 1000 provided in the second aspect of the embodiment of the present application can implement each process implemented by the above-mentioned method embodiment and achieve the same beneficial effects. To avoid repetition, it will not be described here.
[0118] See also Figure 4 , is a structural diagram of an electronic device provided in an embodiment of the present application. The third aspect of the embodiment of the present application provides an electronic device 2000, including a processor 2001 and a memory 2002, the memory 2002 stores machine executable instructions that can be executed by the processor 2001, and the processor 2001 can execute the machine executable instructions to implement the above-mentioned space conversion method.
[0119] A fourth aspect of an embodiment of the present application provides a machine-readable storage medium, on which instructions are stored. When the instructions are executed by a processor, the processor implements the above-mentioned space conversion method.
[0120] In one embodiment of the present application, a computer program product is further provided, including a computer program, and when the computer program is executed by a processor, the space conversion method according to the above embodiment is implemented.
[0121] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0122] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0123] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0124] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0125] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0126] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0127] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
[0128] In addition, various embodiments of the present invention may be arbitrarily combined, and as long as they do not violate the concept of the present invention, they should also be regarded as the contents disclosed by the present invention.
Claims
1. A space conversion method, characterized in that: The method comprises: Obtain multiple marker points to be converted in the first space; Converting the plurality of to-be-converted marking points to the second space according to a spatial conversion relationship between the first space and the second space; The spatial conversion relationship is obtained by the following steps: Acquire a plurality of first marking points in the first space, wherein the plurality of first marking points represent characteristics of an object to be converted; Acquire a plurality of second marking points in the second space corresponding to the plurality of first marking points, wherein the feature of the object to be converted represented by each of the second marking points is the same as the feature of the object to be converted represented by the corresponding first marking point; Determine a target normal vector corresponding to each of the second marking points, wherein the target normal vector is perpendicular to a plane where a feature of the object to be converted represented by the second marking point is located; Using the plurality of target normal vectors, based on a nearest point search algorithm, determining a conversion relationship between the plurality of first marking points and the plurality of second marking points, and using the conversion relationship as the spatial conversion relationship; The conversion relationship includes a rotation matrix and a translation matrix, and the method of using the plurality of target normal vectors to determine the conversion relationship between the plurality of first marking points and the plurality of second marking points based on a nearest point search algorithm includes: Determine the rotation matrix according to the relationship matrix and the relationship vector; The expression formula of the relationship matrix is: ; The expression formula of the relationship vector is: ; in, is the relationship matrix, is the relationship vector, is the code of the first marking point and the second marking point, is the number of the first marking points, is the first marking point, is the second marking point, is the target normal vector; Based on the closest point search algorithm, the rotation matrix and the plurality of target normal vectors are used to perform iterative calculation to obtain the translation matrix; The method of performing iterative calculation based on the closest point search algorithm using the rotation matrix and a plurality of the target normal vectors to obtain the translation matrix includes: Transforming the first marking points using the rotation matrix and the pre-translation matrix; Determining a conversion error between the converted plurality of first marking points and the converted plurality of second marking points; The expression formula of the conversion error is: ; in, is the conversion error, is the converted encoding of the first marking point and the second marking point, is the number of the first marking points after conversion, is the first marker point after conversion, is the second marking point, is the target normal vector, is the rotation matrix, is the pre-translation matrix; The pre-translation matrix is iteratively updated according to the conversion error, and the above steps are repeated until the conversion error or the number of iterations meets an iteration termination condition, and the pre-translation matrix after the iteration termination is used as the translation matrix.
2. The method according to claim 1, characterized in that: The acquiring a plurality of second marking points corresponding to the plurality of first marking points in the second space includes: Preprocessing the image of the first space by using a region growing segmentation algorithm; Performing model conversion using the preprocessed image to form a model image corresponding to the first space as the second space; According to the first marking points, corresponding marking points are selected in the second space as the second marking points.
3. A space conversion device, characterized in that: The device comprises: A to-be-marked point acquisition module, used to acquire a plurality of to-be-converted marked points in the first space; A conversion module, configured to convert the plurality of to-be-converted marking points into the second space according to a spatial conversion relationship between the first space and the second space; The space conversion relationship acquisition module is used to obtain the space conversion relationship through the following steps: A first marking point acquisition unit, configured to acquire a plurality of first marking points in the first space, wherein the plurality of first marking points represent characteristics of an object to be converted; A second marking point acquisition unit, configured to acquire a plurality of second marking points in the second space corresponding to the plurality of first marking points, wherein a feature of an object to be converted represented by each of the second marking points is the same as a feature of an object to be converted represented by a corresponding first marking point; A target normal vector determining unit, used to determine a target normal vector corresponding to each of the second marking points, wherein the target normal vector is perpendicular to a plane where a feature of the object to be converted represented by the second marking point is located; A spatial conversion relationship determining unit, configured to determine a conversion relationship between a plurality of the first marking points and a plurality of the second marking points based on a nearest point search algorithm using the plurality of the target normal vectors, and use the conversion relationship as the spatial conversion relationship; The conversion relationship includes a rotation matrix and a translation matrix, and the method of using the plurality of target normal vectors to determine the conversion relationship between the plurality of first marking points and the plurality of second marking points based on a nearest point search algorithm includes: Determine the rotation matrix according to the relationship matrix and the relationship vector; The expression formula of the relationship matrix is: ; The expression formula of the relationship vector is: ; in, is the relationship matrix, is the relationship vector, is the code of the first marking point and the second marking point, is the number of the first marking points, is the first marking point, is the second marking point, is the target normal vector; Based on the closest point search algorithm, the rotation matrix and the plurality of target normal vectors are used to perform iterative calculation to obtain the translation matrix; The method of performing iterative calculation based on the closest point search algorithm using the rotation matrix and a plurality of the target normal vectors to obtain the translation matrix includes: Transforming the first marking points using the rotation matrix and the pre-translation matrix; Determining a conversion error between the converted plurality of first marking points and the converted plurality of second marking points; The expression formula of the conversion error is: ; in, is the conversion error, is the converted encoding of the first marking point and the second marking point, is the number of the first marking points after conversion, is the first marker point after conversion, is the second marking point, is the target normal vector, is the rotation matrix, is the pre-translation matrix; The pre-translation matrix is iteratively updated according to the conversion error, and the above steps are repeated until the conversion error or the number of iterations meets an iteration termination condition, and the pre-translation matrix after the iteration termination is used as the translation matrix.
4. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the space conversion method as described in any one of claims 1 to 2 are implemented.
5. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores instructions, which, when executed by a processor, enable the processor to implement the space conversion method according to any one of claims 1-2.
