A coordinate registration method, device and electronic equipment of medical images

By obtaining the voxel coordinates of the four positioning points of the displayed image in the voxel coordinate system, and using linear scanning and differential calculation, the problems of large computational load and long time consumption in the existing technology are solved, thereby improving the real-time performance and accuracy of medical image display and meeting user needs.

CN119941810BActive Publication Date: 2026-07-03SHENYANG NEUSOFT INTELLIGENT MEDICAL TECH RES INST +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENYANG NEUSOFT INTELLIGENT MEDICAL TECH RES INST
Filing Date
2025-01-03
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing medical image coordinate registration techniques are computationally intensive and time-consuming in real-time medical imaging, resulting in the inability to meet user needs for real-time display and the inability to accurately obtain the voxel coordinates of the displayed image pixels in the voxel coordinate system.

Method used

By obtaining the voxel coordinates of the four positioning points of the displayed image in the voxel coordinate system, the first, second, and third directions are determined. The voxel coordinates of the pixel points are obtained by using linear scanning and differential calculation, which reduces the traversal of the entire voxel cube and complex matrix multiplication operations.

Benefits of technology

This reduces computational workload and time, improves the real-time display and coordinate registration accuracy of medical images on the display interface, meets user needs, and enhances user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119941810B_ABST
    Figure CN119941810B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a medical image coordinate registration method and device and electronic equipment. The method is to obtain four positioning points of a display image and voxel coordinates of the four positioning points in a voxel coordinate system. The coordinate axis direction with the fastest change rate of the voxel coordinates among the four positioning points is taken as a first direction, the coordinate axis direction with the slowest change rate of the voxel coordinates is taken as a third direction, and the coordinate axis direction with the second fastest change rate of the voxel coordinates is taken as a second direction. Straight line scanning is performed in the first direction and the second direction, and differential calculation is performed in the third direction to obtain voxel coordinates of a pixel point in the display image in a voxel cube. Embodiments of the present application only need to determine the four positioning points to obtain the coordinates of the pixel point of the display image in the voxel coordinate system, implement coordinate registration, and do not need to traverse the voxels of the entire voxel cube for coordinate conversion, thereby helping to reduce the calculation workload and reduce the calculation time consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer vision, and more particularly to a method, apparatus, and electronic device for coordinate registration of medical images. Background Technology

[0002] Multi-planar Reconstruction (MPR) technology is a medical imaging technique that converts multi-layer medical image data into two-dimensional medical images at arbitrary angles. Multi-layer medical image data refers to a series of continuous two-dimensional image slices with different depths acquired by medical imaging equipment, such as computed tomography (CT). Currently, most medical imaging MPR technologies are real-time medical imaging techniques. Real-time medical imaging technology stacks multi-layer medical image data into voxel cubes, uses a graphics processing unit (GPU) ray casting algorithm to render the voxel cubes in real time, converting them into two-dimensional medical images of camera planes at different angles, and then displays these two-dimensional medical images on a display interface in real time. In other words, real-time medical imaging technology can acquire two-dimensional medical images at arbitrary angles by adjusting the camera's position, orientation, and focus.

[0003] Coordinate registration of medical images refers to converting the pixels of a two-dimensional medical image (display image) displayed on a screen into voxels in a voxel coordinate system. The display image can be a two-dimensional medical image at any angle. Through coordinate registration, the precise voxel coordinates of the display image's pixels in the voxel coordinate system can be obtained, facilitating accurate annotation of the display image and helping users identify medical images. For real-time medical imaging technology, since the resolution of the display interface may differ from the resolution of the two-dimensional medical image (camera image) on the camera plane, the resolution of the camera image needs to be scaled to match the resolution of the display interface in order to display the camera image on the screen. However, when real-time medical imaging technology uses GPU ray casting algorithms for real-time rendering, it only needs to apply the obtained color values ​​to the display interface; it cannot obtain the voxel coordinates of the display image's pixels in the voxel coordinate system, meaning coordinate registration of the medical image is not possible.

[0004] Currently, coordinate registration of medical images can be performed using coordinate transformation. The specific method involves obtaining the first rotation matrix and first offset vector between the voxel coordinate system and the world coordinate system, as well as the first coordinate transformation formula between the voxel coordinate system and the world coordinate system. Using the first coordinate transformation formula, the voxel coordinates of each voxel in the voxel cube can be converted to world coordinates in the world coordinate system. Then, according to the second coordinate transformation formula between the world coordinate system and the camera coordinate system, the world coordinates corresponding to each voxel in the voxel cube are converted to camera coordinates in the camera coordinate system. Next, based on the camera coordinates, the voxels to be displayed on the camera plane are determined, and the camera image is acquired. Finally, the camera image is scaled to obtain the display image shown on the display interface. However, when labeling target pixels in the display image, the above coordinate transformation needs to be performed on each voxel in the voxel cube, resulting in a large computational load and long computation time. This makes the real-time display performance of the image unacceptable to users. Summary of the Invention

[0005] This application provides a method, apparatus, and electronic device for coordinate registration of medical images, which reduces the computational load and time required for coordinate registration of medical images and improves the real-time performance of the displayed images on the display interface.

[0006] In a first aspect, embodiments of this application provide a coordinate registration method for medical images, the method comprising:

[0007] Obtain four positioning points of the displayed image and the voxel coordinates of the four positioning points in the voxel coordinate system; the displayed image is a rectangular image of the camera image displayed on the display interface, the camera image is the projection of a target voxel cube composed of multiple layers of medical images stacked on the current camera plane, and the four positioning points are the four vertices of the displayed image.

[0008] Based on the voxel coordinates of the four positioning points, a first direction, a second direction, and a third direction are determined; the first direction is the direction of the coordinate axis where the voxel coordinate change rate of the four positioning points is a first rate of change, the second direction is the direction of the coordinate axis where the voxel coordinate change rate of the four positioning points is a second rate of change, and the third direction is the direction of the coordinate axis where the voxel coordinate change rate of the four positioning points is a third rate of change, wherein the first rate of change is greater than or equal to the second rate of change, and the second rate of change is greater than or equal to the third rate of change;

[0009] By performing a straight-line scan in the first and second directions, the coordinate values ​​of the pixels in the displayed image on the first coordinate axis and the coordinate values ​​on the second coordinate axis are obtained; the coordinate values ​​of the first coordinate axis are the coordinate values ​​of the coordinate axis corresponding to the first direction, and the coordinate values ​​of the second coordinate axis are the coordinate values ​​of the coordinate axis corresponding to the second direction; by performing a difference calculation in the third direction, the coordinate values ​​of the pixels in the displayed image on the third coordinate axis are obtained, and the coordinate values ​​of the third coordinate axis are the coordinate values ​​of the coordinate axis corresponding to the third direction;

[0010] By combining the coordinate values ​​of the coordinate axis corresponding to the first direction, the coordinate values ​​of the coordinate axis corresponding to the second direction, and the coordinate values ​​of the coordinate axis of the third direction, the voxel coordinates of at least one pixel in the displayed image in the target voxel cube are obtained.

[0011] For example, the four positioning points include a first positioning point, a second positioning point, a third positioning point, and a fourth positioning point, wherein the first positioning point and the second positioning point are adjacent vertices, the first positioning point and the fourth positioning point are adjacent vertices, and the first positioning point and the third positioning point are diagonal vertices;

[0012] By performing a linear scan in the first and second directions, the coordinate values ​​of pixels in the displayed image on the first coordinate axis and the coordinate values ​​on the second coordinate axis are obtained, including:

[0013] Determine the direction of the scanning line; the direction of the line includes either the first positioning point pointing to the second positioning point, or the first positioning point pointing to the fourth positioning point;

[0014] Based on the straight line direction and the preset scanning step size, a straight line scan is performed in the first direction and the second direction to determine the coordinate values ​​of the pixels of the displayed image in the first coordinate axis and the coordinate values ​​in the second coordinate axis at each step; the straight line scan starts from the first positioning point and ends at the fourth positioning point.

[0015] For example, the linear scanning in the first direction and the second direction includes:

[0016] Linear scanning is performed in the first and second directions based on the Bresenham algorithm.

[0017] For example, determining the coordinate values ​​of the pixels of the displayed image in each step on the first coordinate axis and the coordinate values ​​on the second coordinate axis includes:

[0018] Determine the perpendicular vectors of the two positioning points that are perpendicular to the direction of the line;

[0019] The vertical vector is reduced to a unit vector, and the length of the unit vector is 1.

[0020] The starting point of the scanning line in step n is obtained as the sum of the coordinate vector corresponding to the first positioning point and n × the unit vector;

[0021] Based on the scanning starting point and the direction of the straight line, determine the coordinate values ​​of the pixels of the displayed image in the first coordinate axis and the coordinate values ​​in the second coordinate axis in the nth step; where n is an integer greater than or equal to 1.

[0022] For example, determining the linear direction of the scanning line includes:

[0023] Obtain the first vector from the second positioning point to the first positioning point, and the second vector from the fourth positioning point to the first positioning point;

[0024] If the length of the first vector is greater than the length of the second vector, the direction of the scanning line is determined to be from the first positioning point to the fourth positioning point;

[0025] If the length of the first vector is less than or equal to the length of the second vector, the direction of the scanning line is determined to be from the first positioning point to the second positioning point.

[0026] For example, obtaining the coordinate values ​​of pixels in the displayed image on the third coordinate axis by performing differential calculation in the third direction includes:

[0027] Obtain the first coordinate difference between the first pixel and the second pixel on the first coordinate axis, and obtain the second coordinate difference between the first pixel and the second pixel on the second coordinate axis; the first pixel and the second pixel are adjacent pixels in the displayed image, and the coordinate value of the first pixel on the third coordinate axis is known;

[0028] Obtain the target parameter value, wherein the target parameter value is the sum of the product of the first coordinate difference and the first component of the unit normal vector of the current camera plane, and the product of the second coordinate difference and the second component of the unit normal vector of the current camera plane;

[0029] Based on the constraint equation between the first pixel and the second pixel, the coordinate value of the second pixel on the third coordinate axis is determined; the constraint equation is that the absolute value of the sum of the target change and the target parameter value is less than a first preset value, and the target change is the product of the difference equation between the first pixel and the second pixel on the third coordinate axis and the third component of the unit normal vector of the current camera plane.

[0030] For example, acquiring the four positioning points of the displayed image and the voxel coordinates of the four positioning points in the voxel coordinate system includes:

[0031] Obtain multiple intersection points between the target voxel cube and the current camera plane, as well as the coordinate values ​​of the intersection points;

[0032] Based on the intersection coordinates of the plurality of intersection points, the four positioning points of the displayed image and the voxel coordinates of the four positioning points in the voxel coordinate system are determined; the four positioning points are the four vertices of the circumscribed polygon formed by the plurality of intersection points, and the vertices of the polygon are the plurality of intersection points.

[0033] For example, obtaining multiple intersection points of the target voxel cube and the current camera plane, as well as the coordinate values ​​of the intersection points, includes:

[0034] Obtain the 8 vertices of the target voxel cube and the voxel coordinates of the 8 vertices in the voxel coordinate system;

[0035] Based on the voxel coordinates of the eight vertices and the transformation between the voxel coordinate system and the world coordinate system, determine the world coordinates of the eight vertices in the world coordinate system.

[0036] Determine the equation of the line between every two vertices in the eight vertices;

[0037] Based on the equation of the straight line between each pair of vertices and the equation of the plane of the current camera plane, determine the multiple intersection points of the target voxel cube and the current camera plane, as well as the coordinate values ​​of the intersection points. The coordinate values ​​of the intersection points are the world coordinate values ​​of the intersection points in the world coordinate system.

[0038] For example, after obtaining the intersection coordinates of multiple intersection points, the method further includes:

[0039] Based on the world coordinates of the eight vertices, determine the intersection point on the target voxel cube among the plurality of intersection points;

[0040] The step of determining the four positioning points of the displayed image and the voxel coordinates of the four positioning points in the voxel coordinate system based on the intersection coordinate values ​​of the plurality of intersection points includes:

[0041] Based on the intersection coordinates of the intersection points on the target voxel cube, the four positioning points of the display image are determined, as well as the voxel coordinates of the four positioning points in the voxel coordinate system. The four vertices are the four vertices of the circumscribed rectangle of the polygon formed by the intersection points on the target voxel cube.

[0042] For example, the four positioning points include a first positioning point, a second positioning point, a third positioning point, and a fourth positioning point, wherein the first positioning point and the second positioning point are adjacent vertices, the first positioning point and the fourth positioning point are adjacent vertices, and the first positioning point and the third positioning point are diagonal vertices;

[0043] The step of determining the first direction, the second direction, and the third direction based on the voxel coordinates of the four positioning points includes:

[0044] Determine the positioning vector between the third positioning point and the first positioning point;

[0045] The coordinate axis direction corresponding to the component with the largest absolute value of the positioning vector is determined as the first direction, the coordinate axis direction corresponding to the component with the smallest absolute value of the positioning vector is determined as the third direction, and the coordinate axis direction corresponding to the remaining components in the positioning vector is determined as the second direction.

[0046] Secondly, embodiments of this application provide a coordinate registration device for medical images, the device comprising:

[0047] The positioning point acquisition unit is used to acquire four positioning points of the display image and the voxel coordinates of the four positioning points in the voxel coordinate system; the display image is a rectangular image of the camera image displayed on the display interface, the camera image is the projection of a target voxel cube composed of multiple layers of medical images stacked on the current camera plane, and the four positioning points are the four vertices of the display image.

[0048] The direction determination unit is used to determine a first direction, a second direction, and a third direction based on the voxel coordinates of the four positioning points; the first direction is the direction of the coordinate axis where the voxel coordinate change rate of the four positioning points is a first rate of change, the second direction is the direction of the coordinate axis where the voxel coordinate change rate of the four positioning points is a second rate of change, and the third direction is the direction of the coordinate axis where the voxel coordinate change rate of the four positioning points is a third rate of change, wherein the first rate of change is greater than or equal to the second rate of change, and the second rate of change is greater than or equal to the third rate of change;

[0049] The coordinate value acquisition unit is used to acquire the coordinate values ​​of a pixel in the display image on a first coordinate axis and a second coordinate axis by performing a straight-line scan in the first direction and the second direction; the coordinate value of the first coordinate axis is the coordinate value of the coordinate axis corresponding to the first direction, and the coordinate value of the second coordinate axis is the coordinate value of the coordinate axis corresponding to the second direction; and to acquire the coordinate value of a pixel in the display image on a third coordinate axis by performing a difference calculation in the third direction, wherein the coordinate value of the third coordinate axis is the coordinate value of the coordinate axis corresponding to the third direction.

[0050] The registration unit is used to combine the coordinate values ​​of the coordinate axis corresponding to the first direction, the coordinate values ​​of the coordinate axis corresponding to the second direction, and the coordinate values ​​of the coordinate axis of the third direction to obtain the voxel coordinates of at least one pixel in the display image in the target voxel cube.

[0051] Thirdly, embodiments of this application provide an electronic device, which includes a memory and a processor;

[0052] The memory is coupled to the processor;

[0053] The memory stores program instructions that, when executed by the processor, cause the electronic device to perform the method as described in any of the first aspects.

[0054] Beneficial effects:

[0055] This application provides a coordinate registration device and electronic device for medical images. When executing the method, firstly, four positioning points of the displayed image and their voxel coordinates in a voxel coordinate system are acquired. The direction of the coordinate axis with the fastest rate of change of voxel coordinates among the four positioning points is designated as the first direction, the direction of the coordinate axis with the slowest rate of change of voxel coordinates among the four positioning points is designated as the third direction, and the direction of the coordinate axis with the second slowest rate of change of voxel coordinates among the four positioning points is designated as the second direction. A linear scan is performed in the first and second directions to acquire the coordinate values ​​of the pixels on the coordinate axis corresponding to the first direction and the coordinate values ​​on the coordinate axis corresponding to the second direction. Differential calculation is performed in the third direction to obtain the coordinate values ​​of the pixels on the coordinate axis corresponding to the third direction. Combining these three coordinate values ​​yields the voxel coordinates of multiple pixels in the displayed image within a voxel cube. Therefore, this embodiment only needs to determine four positioning points, and then obtain the coordinates of the pixels of the displayed image in the voxel coordinate system through linear scanning or differential calculation to achieve coordinate registration. It does not require traversing all voxels of the entire voxel cube for coordinate transformation, nor does it require complex matrix multiplication and / or vector multiplication. Therefore, it helps to reduce the amount of computation and reduce the computation time, thereby helping to improve the real-time display of medical images on the display interface, so that the real-time display of medical images on the display interface meets the user's needs and improves the user experience.

[0056] Furthermore, for the coordinate values ​​of blocks with compared coordinate change rates, a straight-line scanning method is used, ensuring that the scanning lines are closely adjacent, further avoiding empty voxels between the scanning lines. Therefore, this embodiment further solves the technical problem of low coordinate registration accuracy caused by the presence of empty voxels. Additionally, since the coordinate change rate in the third direction is relatively slow, duplicate voxel points may exist. This embodiment uses differential calculation between different pixels to infer the voxel coordinates of one pixel from the voxel coordinates of another pixel, thereby avoiding the influence of duplicate voxel points on coordinate registration and further improving coordinate registration accuracy. Attached Figure Description

[0057] Figure 1 This is a schematic image of a voxel cube provided in an embodiment of this application;

[0058] Figure 2 A flowchart illustrating a coordinate registration method for medical images provided in an embodiment of this application;

[0059] Figure 3 A schematic diagram of a display image of a target voxel cube provided in an embodiment of this application;

[0060] Figure 4A A schematic diagram of a linear scan provided for an embodiment of this application;

[0061] Figure 4B A schematic diagram illustrating the presence of overlapping coordinates in a third direction, as provided in this application;

[0062] Figure 5 A flowchart illustrating a coordinate registration method for medical images provided in an embodiment of this application;

[0063] Figure 6 A schematic diagram of an intersection point set provided for an embodiment of this application;

[0064] Figure 7 This is a schematic diagram illustrating an embodiment of acquiring a display image.

[0065] Figure 8 This is a schematic diagram of the structure of a coordinate registration device for medical images provided in an embodiment of this application. Detailed Implementation

[0066] As mentioned above, coordinate registration in medical imaging refers to converting the pixels of a two-dimensional medical image, derived from multi-layer medical image data, into voxels within the same voxel coordinate system. The displayed image refers to the two-dimensional medical image shown on a display interface. For example, in real-time medical imaging technology, the image displayed on the display interface that projects multi-layer medical image data onto the current camera plane is called the displayed image. For ease of description, the two-dimensional medical image projected from multi-layer medical image data onto the current camera plane will be referred to as the camera image below.

[0067] In practical use, the resolution of the display interface may differ from the resolution of the camera image. For example, the display interface resolution might be 1920×1080, while the camera image resolution might be 1280×720. If the camera image resolution is higher than the display interface resolution, the camera interface will not be able to display all the details of the camera image. In this case, to ensure the display interface displays the entire camera image, the camera image needs to be scaled or cropped to fit the display interface. If the camera image resolution is lower than the display interface resolution, the camera image displayed on the display interface will be blurry. In this case, interpolation or pixel enlargement is needed to fill the extra space. Adjusting the camera image resolution to obtain an image that fits the display interface is the displayed image.

[0068] However, the pixels of the displayed image do not match the pixels of the camera image. In addition, real-time medical imaging technology uses GPU ray casting algorithm for real-time rendering, which only needs to color the obtained color values ​​on the display interface, without involving the position of the pixel corresponding to the color value in the voxel coordinate system or world coordinate system. This makes it impossible to obtain the relationship between the pixels of the displayed image and the color value, that is, it is impossible to obtain the voxel coordinates of the pixels of the displayed image in the voxel coordinate system.

[0069] Currently, relevant solutions employ coordinate transformation for medical image coordinate registration. Specifically, this involves obtaining the first rotation matrix and first offset vector between the voxel coordinate system and the world coordinate system, as well as the first coordinate transformation formula between the voxel coordinate system and the world coordinate system. Using this first transformation formula, the voxel coordinates of each voxel in the voxel cube are converted to world coordinates in the world coordinate system. Then, according to the second coordinate transformation formula between the world coordinate system and the camera coordinate system, the world coordinates corresponding to each voxel in the voxel cube are converted to camera coordinates in the camera coordinate system. Next, based on the camera coordinates, the voxels to be displayed on the camera plane are determined, and the camera image is acquired. Finally, the camera image is scaled to obtain the display image shown on the display interface. However, when labeling target pixels in the display image, the above coordinate transformation is required for each voxel in the voxel cube, resulting in a large computational load and long processing time. This makes the real-time display performance of the image unacceptable to users. In addition, the inventors also discovered that when processing images of voxel cubes of size 512*512*134, the computation time required to obtain a certain layer is more than 3000ms, which greatly affects the real-time display of the image.

[0070] In view of the above problems, this application provides a coordinate registration method for medical images. First, four positioning points of the displayed image and their voxel coordinates in a voxel coordinate system are obtained. The direction of the coordinate axis with the fastest rate of change of voxel coordinates among the four positioning points is designated as the first direction; the direction of the coordinate axis with the slowest rate of change of voxel coordinates among the four positioning points is designated as the third direction; and the direction of the coordinate axis with the second slowest rate of change of voxel coordinates among the four positioning points is designated as the second direction. A linear scan is performed in the first and second directions to obtain the coordinate values ​​of the pixels on the coordinate axis corresponding to the first direction and the coordinate values ​​on the coordinate axis corresponding to the second direction. Differential calculation is performed in the third direction to obtain the coordinate values ​​of the pixels on the coordinate axis corresponding to the third direction. Combining these three coordinate values ​​yields the voxel coordinates of multiple pixels in the displayed image within a voxel cube. Therefore, this embodiment only needs to determine four positioning points, and then obtain the coordinates of the pixels of the displayed image in the voxel coordinate system through linear scanning or differential calculation to achieve coordinate registration. It does not require traversing all voxels of the entire voxel cube for coordinate transformation, nor does it require complex matrix multiplication and / or vector multiplication. Therefore, it helps to reduce the amount of computation and reduce the computation time. Furthermore, it improves the real-time display of medical images on the display interface, so that the real-time display of medical images on the display interface meets the user's needs and improves the user experience.

[0071] To enable those skilled in the art to better understand the coordinate registration method for medical images provided in the embodiments of this application, the technical terms involved in the embodiments of this application will be introduced first.

[0072] A voxel cube is a three-dimensional spatial structure composed of multiple voxels. A voxel, also known as a volume element, is the smallest unit of image data in three-dimensional space. In this embodiment, the voxel cube is a cube structure formed by stacking multiple layers of medical image data. The camera image is the image obtained by projecting the voxel cube onto the current camera plane.

[0073] Voxel coordinate system: A three-dimensional Cartesian coordinate system that describes the position of a voxel in three-dimensional space. In the embodiments of this application, the voxel coordinate system has the center of the voxel as the origin, and the directions of the three mutually perpendicular sides of the voxel are used as the three coordinate axes of the voxel coordinate system. For ease of description, the three coordinate axes of the voxel coordinate system are referred to as the X1 axis, Y1 axis, and Z1 axis, respectively. In the embodiments of this application, the voxel coordinate system is used to describe three-dimensional medical images.

[0074] World coordinate system: Also known as the cosmic coordinate system or global coordinate system. Used to describe the position of a point in the displayed world. Before the establishment of a user coordinate system, the coordinates of all points on the screen captured by the camera are determined by the origin of the world coordinate system. The three mutually perpendicular coordinate axes of the world coordinate system are defined as the X2 axis, Y2 axis, and Z2 axis. The X2 axis is the horizontal axis of the real world, the Z2 axis is the vertical axis of the real world, and the Y2 axis is the horizontal axis perpendicular to the X2 axis.

[0075] Camera coordinate system: A three-dimensional rectangular coordinate system established with the camera's focal center (i.e., intersection point) as the origin and the camera's optical axis as the Z3 axis. The X3 and Y3 axes of the camera coordinate system are parallel to the x and y axes of the image.

[0076] Appendix Figure 1 This is a schematic diagram of a voxel cube provided in an embodiment of this application. The voxel cube also illustrates a voxel coordinate system and a camera coordinate system. In this embodiment, the Z1 axis of the voxel coordinate system is in the same direction as the Y3 axis of the camera coordinate system, the Y1 axis of the voxel coordinate system is in the same direction as the X3 axis of the camera coordinate system, and the X1 axis of the voxel coordinate system is in the same direction as the Z3 axis of the camera coordinate system.

[0077] The following describes different embodiments to illustrate the specific implementation methods of the embodiments of this application.

[0078] In this embodiment of the application, the entity executing the coordinate registration method is an electronic device with medical image processing capabilities. This electronic device can be a server or a terminal device with processing capabilities, such as a laptop computer.

[0079] Example 1

[0080] Appendix Figure 2 A flowchart illustrating a coordinate registration method for medical images provided in this application embodiment. The method includes the following steps:

[0081] S210: Obtain the four positioning points of the displayed image and the voxel coordinates of the four positioning points in the voxel coordinate system.

[0082] The displayed image is a two-dimensional medical image of the target voxel cube on the current camera plane, displayed on the display interface. The target voxel cube is a cube formed by stacking multiple layers of image data to be processed. The multiple layers of medical image data refer to two-dimensional image slices acquired by medical imaging equipment at different depths and directions within the user's body, such as two-dimensional image slices acquired in the transverse, coronal, and sagittal planes. The electronic device stacks multiple layers of medical image data into a target voxel cube, which can reconstruct the three-dimensional structure inside the user's body.

[0083] In this embodiment, the displayed image is a rectangular region image, and the four vertices of the rectangle are the four positioning points. Specifically, in this embodiment, the four positioning points include a first positioning point, a second positioning point, a third positioning point, and a fourth positioning point, wherein the first positioning point is an adjacent vertex to the second and fourth positioning points, and the first positioning point and the third positioning point are diagonal vertices. (Exemplary description, see attached) Figure 3 This application provides a schematic diagram of a display image of a target voxel cube. The display image is a rectangular area composed of vertices TL, TR, BR, and BL. TL is the first positioning point, TR is the second positioning point, BR is the third positioning point, and BL is the fourth positioning point.

[0084] The voxel coordinates of the four positioning points in the voxel coordinate system can be obtained in the following way: The electronic device obtains the world coordinates of the four positioning points in the world coordinate system. The electronic device uses the first coordinate transformation formula between the world coordinate system and the voxel coordinate system to obtain the voxel coordinates of the four positioning points. Specifically, the first coordinate transformation formula is as follows: In this embodiment, the electronic device can first obtain the first offset vector T and the first rotation matrix R of the voxel coordinate system and the world coordinate system to obtain the coordinate transformation formula:

[0085] (X2, Y2, Z2)=(X1, Y1, Z1)*R+T (1)

[0086] Where (X2, Y2, Z2) are the coordinates in the world coordinate system, which includes the X2, Y2, and Z2 axes. (X1, Y1, Z1) are the coordinates in the voxel coordinate system. R is a 3×3 rotation matrix. To ensure that the volume of the target voxel cube remains unchanged during rotation, the determinant of R is 1. T is a three-dimensional vector.

[0087] The electronic device takes the world coordinates of the four positioning points and inputs them into the coordinate transformation formula (1) above. The voxel coordinates of the four positioning points can be obtained by calculation.

[0088] In addition, the voxel coordinates of the four positioning points can also be obtained in other ways in the embodiments of this application, such as using the automatic tracking function of the display device where the display interface is located to track the coordinates of the four positioning points in the display image. The embodiments of this application are not specifically limited.

[0089] S220: Determine the first direction, the second direction, and the third direction based on the voxel coordinates of the four positioning points.

[0090] In this embodiment, the first direction is the coordinate axis direction where the voxel coordinate change rate of the four positioning points is a first rate of change; the second direction is the coordinate axis direction where the voxel coordinate change rate of the four positioning points is a second rate of change; and the third direction is the coordinate axis direction where the voxel coordinate change rate of the four positioning points is a third rate of change. The first rate of change is greater than or equal to the second rate of change, and the second rate of change is greater than or equal to the third rate of change. For example, if the voxel coordinate change rate of the four positioning points in the X1 axis direction is Dx, the voxel coordinate change rate in the Y1 axis direction is Dy, and the voxel coordinate change rate in the Z1 axis direction is Dz, and if Dz > Dy > Dx, then the first rate of change is Dz, the second rate of change is Dy, the third rate of change is Dz, the first direction is the Z1 axis direction, the second direction is the Y1 axis direction, and the third direction is the X1 axis direction.

[0091] Specifically, the rate of change of voxel coordinates of the four positioning points along the X1 axis refers to the difference between the maximum and minimum coordinate values ​​of the four positioning points along the X1 axis. The rate of change of voxel coordinates of the four positioning points along the Y1 axis refers to the difference between the maximum and minimum coordinate values ​​of the four positioning points along the Y1 axis. The rate of change of voxel coordinates of the four positioning points along the Z1 axis refers to the difference between the maximum and minimum coordinate values ​​of the four positioning points along the Z1 axis. For example, regarding... Figure 3 As shown, if the voxel coordinates of the four positioning points are TL(i1, j1, z1), TR(i2, j2, z2), BR(i3, j3, z3), and BL(i4, j4, z4), respectively, where the maximum coordinate value in the X1 axis direction is i3 and the minimum coordinate value is i1, the maximum coordinate value in the Y1 axis direction is j3 and the minimum coordinate value is j1, and the maximum coordinate value in the Z1 axis direction is z3 and the minimum coordinate value is z1, then Dx = i3 - i1, Dy = j3 - j1, and Dz = z3 - z1.

[0092] In one example, the electronic device can calculate the rate of change of coordinates between every two positioning points in the three axes of the voxel coordinate system based on the voxel coordinates of the four positioning points. For example, the rate of change of coordinates between TL and RT in the three axes is (|i2-i1|, |j2-j1|, |z2-z1|). The rate of change of coordinates between TL and BR in the three axes is (|i4-i1|, |j4-j1|, |z4-z1|). The rate of change of coordinates between RT and BR in the three axes is (|i2-i3|, |j2-j3|, |z2-z3|). The rate of change of coordinates between BT and BR in the three axes is (|i4-i3|, |j4-j3|, |z4-z3|). The electronic device then obtains the maximum rate of change of coordinates Dx in the X1 axis direction, the maximum rate of change of coordinates Dy in the Y1 axis direction, and the maximum rate of change of coordinates Dz in the Z1 axis direction. The electronic device uses the largest value among Dx, Dy, and Dz as the first rate of change, the coordinate axis direction corresponding to the first rate of change as the first direction, the smallest value as the second rate of change, the coordinate axis direction corresponding to the second rate of change as the third direction, and the intermediate value as the second rate of change, the coordinate axis direction corresponding to the second rate of change as the second direction. For example, if Dx > Dy > Dz, then the first direction is the X1 coordinate axis direction, the second direction is the Y1 coordinate axis direction, and the third direction is the Z1 coordinate axis direction.

[0093] In another example, the electronic device calculates the rate of change of TL and BR along the three coordinate axes (|i3-i1|, |j3-j1|, |z3-z1|), where the maximum rate of change is Dx = |i3-i1| along the X1 coordinate axis, Dy = |j3-j1| along the Y1 coordinate axis, and Dz = |z3-z1| along the Z1 coordinate axis. The electronic device uses the largest value among Dx, Dy, and Dz as the first rate of change, the coordinate axis direction corresponding to the first rate of change as the first direction, the smallest value as the second rate of change, the coordinate axis direction corresponding to the second rate of change as the third direction, and the intermediate value as the second rate of change, the coordinate axis direction corresponding to the second rate of change as the second direction. For example, if Dx > Dy > Dz, then the first direction is the X1 coordinate axis, the second direction is the Y1 coordinate axis, and the third direction is the Z1 coordinate axis.

[0094] Furthermore, identical situations may exist among Dx, Dy, and Dz. In one case, the two maximum coordinate change rates with higher rates of change are the same. The electronic device uses either the direction of the coordinate axis corresponding to the two maximum coordinate change rates with higher rates of change as the first direction and the direction of the other coordinate axis as the second direction. For example, if Dx = Dy > Dz, the first direction can be either the X1 coordinate axis direction or the Y1 coordinate axis direction.

[0095] In another scenario, if the two maximum coordinate axes with the lowest rates of change have the same rate of change, the electronic device will use the coordinate axis direction corresponding to the highest rate of change as the first direction, any one of the coordinate axes corresponding to the two lowest rates of change as the second direction, and the other as the third direction. For example, if Dx > Dy = Dz, then the first direction is the X1 coordinate axis direction, and the second direction can be either the Y1 or Z1 coordinate axis direction, depending on the specific requirements.

[0096] In another scenario, when the three maximum rates of change of coordinates are all the same, one coordinate axis is arbitrarily chosen as the first direction, another coordinate axis is arbitrarily chosen as the second direction, and the last coordinate axis is chosen as the third direction. For example, the first direction is the X1 coordinate axis direction, the second direction is the Y1 coordinate axis direction, and the third direction is the Z1 coordinate axis direction.

[0097] The purpose of determining the first direction, the second direction, and the third direction in this embodiment is to perform a straight-line scan on the first and second directions with the fastest voxel coordinate change rate to obtain the coordinate values ​​in the voxel coordinate system, and to perform differential calculation on the third direction with the slowest voxel coordinate change rate to obtain the coordinate values ​​in the voxel coordinate system.

[0098] S230: By performing a linear scan in the first and second directions, the coordinates of the pixels in the displayed image on the first coordinate axis and the coordinates on the second coordinate axis are obtained.

[0099] In this embodiment, the coordinate value of the first coordinate axis refers to the coordinate value of the coordinate axis corresponding to the first direction, the coordinate value of the second coordinate axis refers to the coordinate value of the coordinate axis corresponding to the second direction, and the coordinate value of the third coordinate axis refers to the coordinate value of the coordinate axis corresponding to the third direction. For example, the coordinate axis corresponding to the first direction is the Y1 coordinate axis, the coordinate axis corresponding to the second direction is the Z1 coordinate axis, and the coordinate axis corresponding to the third direction is the X1 coordinate axis. Then, the coordinate value a1 of the first coordinate axis is the value of the Y1 coordinate axis, the coordinate value b1 of the second coordinate axis is the value of the Z1 coordinate axis, and the coordinate value c1 of the third coordinate axis is the value of the X1 coordinate axis. Therefore, the coordinates of the pixel in the voxel coordinate system are (c1, a1, b1).

[0100] Electronic devices can acquire the coordinate values ​​of pixels on a first coordinate axis and a second coordinate axis by performing linear scanning in a first and a second direction. Specifically, the electronic device performs linear scanning of the displayed image along the linear direction of the scanning line, based on a scanning step size, and acquires the coordinate values ​​of each voxel on the displayed image located on the first and second coordinate axes along the scanning line. (Appendix) Figure 4AThis is a schematic diagram of a linear scanning method provided in an embodiment of this application. Specifically, it involves scanning line by line along a first direction and a second direction. Figure 4A Three linear scans were demonstrated.

[0101] It is understandable that linear scanning obtains the coordinates of pixels in the displayed image on the first coordinate axis and the second coordinate axis through translation. Translation involves addition and subtraction operations, which significantly reduces the computational workload of obtaining voxel coordinate values ​​and reduces computation time compared to calculating coordinate transformation formulas.

[0102] The scanning interval refers to the distance between scanning lines. In this embodiment, the scanning interval is a preset value, for example, a scanning interval of 1. The line direction refers to the direction in which the scanning line is located. In this embodiment, the line direction can be preset, for example, the line direction can be preset to be parallel as a first direction, or the line direction can be preset to be parallel to a second direction.

[0103] Furthermore, in order to ensure that as many pixels as possible of the displayed image are scanned and to obtain as many pixel coordinates as possible in the voxel coordinate system, in this embodiment of the application, the straight line direction can be the direction from the first positioning point to the second positioning point, or it can be the direction from the first positioning point to the fourth positioning point.

[0104] Furthermore, to avoid scanning points outside the displayed image, the electronic device starts scanning from the first positioning point and ends scanning at the fourth positioning point.

[0105] Furthermore, the electronic device can employ the Bresenham algorithm to perform straight-line scanning in the first and second directions. Leveraging the characteristics of the Bresenham algorithm, it ensures that the drawn lines are as close as possible to mathematically defined lines, thus guaranteeing the accuracy of the straight-line scanning and preventing the generation of any redundant points—that is, avoiding the repeated drawing of the same voxel—thereby improving drawing efficiency.

[0106] The embodiments of this application may also employ other methods for linear scanning, and the embodiments of this application are not specifically limited thereto.

[0107] In summary, because the first and second coordinate axis directions change rapidly, meaning that the scanning lines are closely adjacent, empty voxels between the scanning lines can be avoided, thus improving the accuracy of obtaining the first and second coordinate axis coordinate values ​​through straight line scanning.

[0108] S240: By performing differential calculations on the third coordinate axis, the coordinates of the pixels of the displayed image on the third coordinate axis are obtained.

[0109] The coordinates of the third coordinate axis refer to the values ​​of the coordinate axes corresponding to the third rate of change. For example, if the coordinate axis corresponding to the third rate of change is the X1 coordinate axis, then the coordinates of the third coordinate axis are the values ​​of the X1 coordinate axis.

[0110] Difference calculation refers to the operation of calculating the difference between two pixels. In this embodiment, any two pixels in the displayed image are obtained, specifically the first pixel k and the second pixel k+1, where the coordinates of k on the first, second, and third coordinate axes are (x, y, k) and (x, y, k) respectively. k y k , z k The coordinates of k+1 on the first, second, and third coordinate axes are (x... k+1 y k+1 , z k+1 ), where z k+1 The coordinates of the third coordinate axis to be solved are given. Embodiments of this application can obtain the coordinates of a pixel on the third coordinate axis in the following manner.

[0111] Step 1: Obtain the first coordinate difference between the first pixel and the second pixel on the first coordinate axis, and the second coordinate difference on the second coordinate axis.

[0112] That is, the first coordinate difference Δx = x k+1 -x k The difference between the second coordinates is Δy = y k+1 -y k .

[0113] Step 2: Obtain the target parameter value.

[0114] The target parameter value is the sum of the product of the first coordinate difference and the first component of the unit normal vector of the current camera plane, and the product of the second coordinate difference and the second component of the unit normal vector of the current camera plane. For example, the plane equation of the current camera plane is: Ax + By + Cz + D = 0. The unit normal vector is...<A,B,C> , The value of is 1. Therefore, the objective parameter value is: AΔx + BΔy.

[0115] Step 3: Determine the coordinates of the second pixel on the third coordinate axis according to the preset constraint equation.

[0116] The electronic device pre-sets a constraint equation, specifically, the absolute value of the sum of the target change and the target parameter value is less than a first preset value. The target change is the product of the difference equation between the first pixel and the second pixel on the third coordinate axis and the third component of the unit normal vector of the current camera plane. For example, in the example shown in step 2, the target change is CΔz, where Δz = z k+1 -z kThen the constraint equation is |AΔx+BΔy+CΔz|<m, where m is a preset value, such as 0.5, 0.6, etc.

[0117] Therefore, according to the constraint equations and z k The value of z can simplify complex calculations, thus helping to improve running speed and the acquisition of z. k+1 Efficiency.

[0118] The constraint equations are analyzed below, using m = 0.5 as an example:

[0119] The formula for the distance from point k to the current camera plane is known as follows:

[0120]

[0121] The formula for the distance from point k+1 to the current camera plane is:

[0122]

[0123] From the above formula, we can obtain the difference equation between point k+1 and point k:

[0124]

[0125] in<A,B,C> is the index coordinate normal vector of the plane.

[0126] Among them, the unit normal vector<A,B,C> The length is 1, that is The value is 1. Therefore, Δd = d k+1 -d k =|AΔx+BΔy+CΔz|. Since the length of the unit normal vector is 1, the point where the voxel Δd < 0.5 lies on the tangent plane, that is, |AΔx+BΔy+CΔz| < 0.5.

[0127] In other words, the embodiments of this application, through constraint equations, can ensure the acquisition of z while guaranteeing improved operating speed and acquisition efficiency. k+1 The accuracy is [not specified]. Furthermore, since the third coordinate axis has the slowest rate of change in voxel coordinates, there will be overlapping points along the third coordinate axis direction. Figure 4B This application provides a schematic diagram illustrating the presence of overlapping coordinates in a third-party direction. (Attached) Figure 4B The first direction is called the X direction, the second direction is called the Y direction, and the third direction is called the Z direction. When performing a linear scan in the XY direction, there will be duplicate coordinates in the Z direction. For example, the columns corresponding to "7", "5", and "2" include two points, and the coordinates of these two points are repeated in the third direction. By using differential calculation, the influence of duplicate coordinates can be effectively avoided, thus further improving the accuracy of coordinate registration in medical images.

[0128] It should be noted that in the embodiments of this application, steps S230 and S240 can be executed simultaneously, or S230 can be executed first and then S240, or S240 can be executed first and then S230. The embodiments of this application are not specifically limited.

[0129] S250: Combine the coordinates of all the first coordinate axis, the second coordinate axis, and the third coordinate axis to obtain the voxel coordinates of multiple pixels in the voxel cube of the displayed image.

[0130] For example, the coordinate values ​​of all the first coordinate axes and the coordinate values ​​of the second coordinate axis are obtained (X... (1) Y (1) ), (X (2) Y (2) ) and (X (3) Y (3) The coordinates of the third coordinate axis obtained are Z. (1) Z (2) and Z (3) By combining the correspondence between the first, second, and third coordinate axes and the coordinate axes in the voxel coordinate system, and combining all points—for example, if the first coordinate axis is the X1 coordinate axis in the voxel coordinate system, the second coordinate axis is the X2 coordinate axis in the voxel coordinate system, and the third coordinate axis is the Z1 coordinate axis in the voxel coordinate system—then the voxel coordinates of the multiple pixels of the displayed image in the voxel cube are (X... (1) Y (1) Z (1) ), (X (1) Y (1) Z (2) ), (X (1) Y (1) Z (3) ), (X (2) Y (2) Z (1) ), (X (2) Y (2) Z (2) ), (X (2) Y (2) Z (3) ), (X (3) Y (3) Z (1) ), (X (3) Y (1) Z (2) ), (X (3) Y (3) Z (3) ).

[0131] In summary, this embodiment first obtains four positioning points of the displayed image and their voxel coordinates in a voxel coordinate system. The direction of the coordinate axis with the fastest rate of change of voxel coordinates among the four positioning points is designated as the first direction; the direction of the coordinate axis with the slowest rate of change of voxel coordinates among the four positioning points is designated as the third direction; and the direction of the coordinate axis with the second slowest rate of change of voxel coordinates among the four positioning points is designated as the second direction. A straight-line scan is performed in the first and second directions to obtain the coordinate values ​​of the pixels on the coordinate axis corresponding to the first direction and the coordinate values ​​on the coordinate axis corresponding to the second direction. Differential calculation is performed in the third direction to obtain the coordinate values ​​of the pixels on the coordinate axis corresponding to the third direction. Combining these three coordinate values ​​yields the voxel coordinates of multiple pixels in the displayed image within the voxel cube. Therefore, this embodiment only needs to determine four positioning points, and then obtain the coordinates of the pixels of the displayed image in the voxel coordinate system through straight line scanning or differential calculation, thus achieving coordinate registration. It does not require traversing the entire voxel cube for coordinate transformation, nor does it require complex matrix multiplication and / or vector multiplication. This helps reduce computational workload and time, thereby improving the real-time display of medical images on the display interface and ensuring that the real-time display of medical images meets user needs, improving user experience. Furthermore, for the coordinate values ​​of blocks with relatively high coordinate change rates, a straight line scanning method is used, ensuring that the scanning lines are closely adjacent, further avoiding empty voxels between scanning lines. Thus, this embodiment further solves the technical problem of low coordinate registration accuracy caused by the presence of empty voxels. Additionally, for third-direction coordinate change rates that are relatively slow, there may be duplicate voxel points. This embodiment uses differential calculation between different pixels to infer the voxel coordinates of one pixel from the voxel coordinates of another pixel, thereby avoiding the influence of duplicate voxel points on coordinate registration and further improving coordinate registration accuracy.

[0132] Example 2

[0133] To further improve registration accuracy and efficiency, this application embodiment modifies the method for obtaining four positioning points and their voxel coordinates in Embodiment 1. Specifically, it obtains four positioning points and their voxel coordinates through the eight vertices of the target voxel cube.

[0134] Appendix Figure 5 A flowchart of a coordinate registration method for medical images provided in this application embodiment is included, the method comprising the following steps:

[0135] S510: Obtain the voxel coordinates of each vertex of the target voxel cube.

[0136] The target voxel cube comprises multiple voxels. A voxel is the smallest unit of three-dimensional spatial segmentation, also known as a voxel element. The number of voxels is related to the number of pixels in each two-dimensional image slice within the target voxel cube and the number of layers (i.e., images or frames) in the multi-layer medical imaging data. The number of pixels in each two-dimensional image slice is the height (number of rows) × width (number of columns) of the two-dimensional image slice. The number of layers in the multi-layer medical imaging data refers to the total number of two-dimensional image slices that make up the target voxel cube. For example, if the width of each two-dimensional image slice is w, the height is h, and the number of layers in the multi-layer medical imaging data is d, then the number of voxels in the target voxel cube is (w-1) × (h-1) × (d-1).

[0137] The target voxel cube consists of eight vertices, specifically A1, A2, ..., A8. These eight vertices define the boundaries of the target voxel cube. It can be understood that, based on the eight vertices of the target voxel cube, it is possible to determine which voxels do not belong to the target voxel cube and which do.

[0138] In this embodiment of the application, the electronic device can take any vertex of the target voxel cube as the origin of the voxel coordinate system, take the height direction of the two-dimensional image slice as the X1 axis direction of the voxel coordinate system, take the width direction of the two-dimensional image slice as the Y1 axis direction of the voxel coordinate system, and take the number of layers as the Z1 axis direction of the voxel coordinate system. For example, the origin of the voxel cube is A1(0, 0, 0), the direction from A1 to A2 is the X1 axis of the voxel coordinate system, the direction from A1 to A3 is the Y1 axis of the voxel coordinate system, and the direction from A1 to A5 is the Z1 axis of the voxel coordinate system. In the target voxel cube, the width of each two-dimensional image slice is w, the height is h, and the number of layers of multi-layer medical image data is d. The voxel cube is A1(0, 0, 0), A2(w-1, 0, 0), A3(0, h-1, 0), A4(w-1, h-1, 0), A5(0, 0, d-1), A6(w-1, 0, d-1), A7(0, h-1, d-1), and A8(w-1, h-1, d-1).

[0139] S520: Obtain the world coordinates of each vertex of the target voxel cube.

[0140] The world coordinates of each vertex refer to the coordinates of each vertex in the world coordinate system. Since cameras are typically defined in the world coordinate system—for example, the camera's position, orientation, and internal parameters (such as focal length and principal point) are all based on the world coordinate system—it is necessary to obtain the coordinates of the target voxel cube in the world coordinate system to obtain the projection of the target voxel cube onto the camera plane. In this embodiment, the electronic device obtains the world coordinates of each vertex of the target voxel cube. Therefore, the electronic device can determine the equations of the target voxel cube in the world coordinate system based on each vertex, and then use these equations to solve a system of equations for the camera plane to obtain the projection of the target voxel cube onto the camera plane.

[0141] Substitute the voxel coordinates of each vertex in the target voxel cube into the coordinate transformation formula (1) to obtain the world coordinates of each vertex.

[0142] Example Explanation: If the voxel coordinates of the vertices of the target voxel cube are A1(0, 0, 0), A2(w-1, 0, 0), A3(0, h-1, 0), A4(w-1, h-1, 0), A5(0, 0, d-1), A6(w-1, 0, d-1), A7(0, h-1, d-1), and A8(w-1, h-1, d-1), then rotating the voxel coordinate system 90° around the z-axis yields the world coordinate system.

[0143] That is, rotation matrix The offset vector is T = [0, 0, 0].

[0144] Substituting the rotation matrix R, the offset vector T, and the voxel coordinates of each vertex into the coordinate transformation formula (1), we can obtain the coordinates of each vertex in the world coordinate system, namely A1(0, 0, 0), A2(0, 1-w, 0), A3(h-1, 0, 0), A4(h-1, 1-w, 0), A5(0, 0, d-1), A6(0, 1-w, d-1), A7(h-1, 0, d-1) and A8(h-1, 1-w, d-1).

[0145] S530: Obtain the equations of the straight lines at the eight vertices of the target voxel cube in the world coordinate system.

[0146] The target voxel cube has 8 vertices forming 12 straight lines, which constitute the 12 border lines of the target voxel cube. In this embodiment, the equation of each of the 12 border lines follows the following parametric equation:

[0147]

[0148] Here, x0 indicates the coordinates of a known point on the line in the X2-axis direction. For example, for the line formed by A1 and A2, x0 can be either the coordinate of A1 in the X2-axis direction (0) or the coordinate of A2 in the X2-axis direction (0). For example, for the line formed by A1 and A3, x0 can be either the coordinate of A1 in the X2-axis direction (0) or the coordinate of A3 in the X2-axis direction (h-1).

[0149] y0 indicates the coordinates of a known point on the line along the Y2 axis. For example, for the line formed by A1 and A2, y0 can be either the coordinate of A1 in the Y2 axis (0) or the coordinate of A2 in the Y2 axis (1-w). Similarly, for the line formed by A1 and A3, x0 can be either the coordinate of A1 in the Y2 axis (0) or the coordinate of A3 in the Y2 axis (0).

[0150] z0 indicates the coordinates of a known point on the equation of a line in the Z2-axis direction. For example, for a line composed of A1 and A2, z0 can be the coordinates of A1 or A2 in the Z2-axis direction. Similarly, for a line composed of A1 and A3, x0 can be the coordinates of A1 or A3 in the Z2-axis direction.

[0151] <m,n,p> It is the direction vector of the line, that is, the difference between the two vertices of each side. For example, for the line formed by A1 and A2,<m,n,p> =<0, w-1, 0>. For example, for the straight line formed by A1 and A3,<m,n,p> =<h-1,0,0> .

[0152] Therefore, the electronic device can obtain the linear equations of the 12 border lines based on the world coordinates of the 8 vertices in the target voxel cube. This linear equation can be understood as a t-dependent function; the value of t determines the points on the linear equation. Therefore, determining the world coordinates of points on each border line hinges on determining the value of t in the linear equation corresponding to each border line.

[0153] S540: Calculate the coordinates of the intersection point between the target voxel cube and the current camera plane.

[0154] In this embodiment, to acquire a projected image of a target voxel cube on the current camera plane, the electronic device can first determine the intersection points between the target voxel cube and the current camera plane. The intersection points and their coordinates are determined by the position and orientation of the current camera plane. Specifically, depending on the position and orientation of the current camera plane, the number of intersection points between the target voxel cube and the current camera plane can be 4, 3, 5, or 6, etc.

[0155] Example Explanation: If the current camera plane is parallel to two opposite faces of the target voxel cube and intersects with the other faces, then the target voxel cube and the current camera plane have four intersection points. These four intersection points form a rectangle, which is the image displayed on the display interface. (Appendix) Figure 6 This is a schematic diagram of an intersection point set provided in an embodiment of this application. The camera plane 301 intersects with the target voxel cube 302 at four points: P0, P1, P2, and P3.

[0156] If the target voxel cube does not have a face parallel to the current camera plane, the number of intersection points between the target voxel cube and the current camera plane can be 5, 3, etc., and this application does not specifically limit the number. (Appendix) Figure 3 The current camera plane 301 and the target voxel cube 302 have five intersection points, namely P0, P1, P2, P3 and P4.

[0157] The intersection coordinates of the target voxel cube and the current camera plane refer to the world coordinates of the intersection point in the world coordinate system. The following section uses the equation of the current camera plane, Ax + By + Cz + D = 0, as an example to explain in detail how to obtain the intersection coordinates.

[0158] It should be noted that for Ax + By + Cz + D = 0, where,<A,B,C> This is the normal vector of the current camera plane, also known as the camera normal vector of the current camera. The camera normal vector is obtained through the camera intrinsic parameters and camera pose of the current camera. The camera intrinsic parameters describe the mapping relationship between the camera coordinate system and the image coordinate system, including focal length, principal point, and distortion coefficients. The camera pose describes the camera's position and orientation in the world coordinate system, expressed by a rotation matrix and a translation vector. Parameter D can be calculated based on the camera normal vector and the camera focus.

[0159] Since the intersection point of the current camera plane and the boundary line in the target voxel cube lies on the straight line containing the boundary line, and is within the range of the current camera plane, meaning the intersection point coordinates satisfy the equation of the straight line and the range of the current camera plane, the intersection point coordinates can be calculated by simultaneously solving the equation of the straight line and the equation of the current camera plane. Assuming the equation of the straight line is as shown in formula (2), by combining formula (2) and Ax+By+Cz+D=0, the value of t is obtained.

[0160]

[0161] Substituting the value of t into the equation will give you the coordinates of the intersection point.

[0162] In this embodiment, some intersection points may be inside the target voxel cube, while others may be outside. Intersection points outside the target voxel cube cannot be displayed on the interface. Therefore, to ensure accurate acquisition of the rectangular image area for display, the world coordinates of the eight vertices and the intersection point coordinates are used to determine whether the intersection point is inside the target voxel cube. Intersection points not inside the target voxel cube are discarded and not further processed.

[0163] S550: Based on the intersection coordinates, determine the four positioning points of the displayed image and the world coordinates of the four positioning points.

[0164] Since the projection of the target voxel cube onto the current camera plane, i.e., the camera projection image of the current camera, may be rectangular, triangular, pentagonal, or hexagonal, the electronic device needs to process the camera projection image to ensure it can be displayed correctly on the display interface. In this embodiment, the electronic device acquires the circumscribed rectangle of the camera projection image, which is the display image. The four locations of this circumscribed rectangle are the four positioning points of the target image. These four positioning points are the first positioning point, the second positioning point, the third positioning point, and the fourth positioning point. The first positioning point is adjacent to the second and fourth positioning points, and the second and third positioning points are adjacent to each other.

[0165] Exemplary description: as attached Figure 6 The set of intersection points shown represents the target image as a rectangle composed of P0, P1, P2, and P3, with four positioning points: P0 (first positioning point), P1 (second positioning point), P2 (third positioning point), and P3 (fourth positioning point). (For the attached...) Figure 3 As shown, the target image is a rectangle composed of TL, TR, BR, and BL. TL and TR are two adjacent vertices of the circumscribed rectangle, TL and BL are adjacent vertices of the circumscribed rectangle, TR and BR are adjacent vertices of the circumscribed rectangle, BR and BL are adjacent vertices of the circumscribed rectangle, and BR and TL are diagonal vertices of the circumscribed rectangle.

[0166] Exemplary illustration: Appendix Figure 7 This is a schematic diagram illustrating an embodiment of acquiring a display image according to an embodiment of this application. (See attached diagram.) Figure 7 As shown, the positive Yc axis of camera 701 is indicated by arrow 7001. The positive Zc axis of camera 701 is indicated by arrow 7002. When camera 701 illuminates the target voxel cube 302, a display image 702 can be acquired and displayed on the display interface. The target voxel cube 302 comprises multiple voxels, each voxel being a cube, with attached... Figure 7 Shaded squares are used to represent voxels located on camera plane 301. (See attached image) Figure 7 The target voxel cube is 7*7*7, meaning it has 8 rows, 8 columns, and 8 layers. The displayed image 702 includes four positioning points: TL (first positioning point), TR (second positioning point), BR (third positioning point), and BL (fourth positioning point).

[0167] In this embodiment of the application, the electronic device can obtain the world coordinates of four positioning points based on the intersection coordinates. For example, as shown in the attached... Figure 7 As shown, first, obtain the equation of the first line containing TL and TR. Then, determine the equation of the second line perpendicular to the first line and passing through P3. Combining the equations of the first and second lines, we can obtain the world coordinates of TR. Similarly, we can obtain the equation of the third line parallel to the first line and passing through P4. Combining the equations of the third and second lines, we can obtain the world coordinates of BR. Finally, we can obtain the equation of the fourth line perpendicular to the first line and passing through P0. Combining the equations of the fourth, first, and third lines, we can obtain the world coordinates of TL and BL.

[0168] S560: Determine the voxel coordinates of the four positioning points.

[0169] The voxel coordinates of the four positioning points refer to the voxel coordinates of the four positioning points in the voxel coordinate system. In the embodiments of this application, the registration of medical image coordinates refers to converting the medical image coordinates into voxels in the same voxel coordinate system for comparison, analysis, and fusion. Therefore, to understand the voxel corresponding to each pixel in the displayed image, the voxel coordinates of the four positioning points in the voxel coordinate system are first obtained. The four positioning points are the basis for converting the medical image coordinates into voxels in the voxel coordinate system.

[0170] In this embodiment, the electronic device obtains the voxel coordinates of the four positioning points in the voxel coordinate system based on the world coordinates of the four positioning points and the conversion formula (1) between the world coordinate system and the voxel coordinate system. It should be noted that...

[0171] The electronic device uses the conversion formula (1) between the world coordinate system and the voxel coordinate system to directly obtain the coordinate values ​​of the four positioning points in the voxel coordinate system. In this case, the electronic device adjusts the non-integer coordinate values ​​obtained by rounding down and uses the adjusted coordinate values ​​as the voxel coordinates of the four positioning points.

[0172] S570: Determine the first direction, the second direction, and the third direction.

[0173] S580: Perform a linear scan along the first and second coordinate axes to obtain the coordinates of the voxel points of the target voxel cube along the first and second coordinate axes.

[0174] In this embodiment, the scanning line direction can be the direction corresponding to either of two adjacent edges in the displayed image. For example, the scanning line direction can be the direction from the first positioning point to the second positioning point, or it can be the direction from the first positioning point to the fourth positioning point. This is an example illustration, specifically for the attached... Figure 3 The first positioning point TL, the second positioning point TR, the third positioning point BR, and the fourth positioning point BL shown can be in the direction of the scanning line, either TL pointing to TR or TL pointing to BL.

[0175] Furthermore, the scanning line direction can also be the direction corresponding to the longer of the two adjacent sides. Specifically, the electronic device can acquire a first vector pointing from the first positioning point to the second positioning point, and a second vector pointing from the first positioning point to the fourth positioning point, determine the vector lengths of the first and second vectors, and define the vector direction corresponding to the shorter vector as the scanning line direction. By considering the actual distance between the positioning points, the electronic device uses the longer distance as the scanning line direction, which allows the scanning line to cover more voxels, avoiding the presence of many empty voxels during straight-line scanning, thereby improving the registration accuracy.

[0176] In this embodiment, the scanning step size between scanning lines is 1. If the scanning line direction is from the first positioning point to the second positioning point, the number of scanning lines between the first positioning point and the fourth positioning point is positively correlated with the vector length of the first vector. If the scanning line direction is from the first positioning point to the fourth positioning point, the number of scanning lines between the first positioning point and the second positioning point is positively correlated with the vector length of the second vector. For example, the vector length is L, and rounding L to the nearest integer gives the number of scanning lines.

[0177] The coordinates of each voxel traversed by the scanning line in the first and second coordinate axes can be obtained as follows: The starting point of each scanning line is obtained; based on the scanning line direction, the coordinates of other voxels along the scanning line in the first coordinate axis and the coordinates in the second coordinate axis are obtained using the Bresenham algorithm. In this embodiment, the Bresenham algorithm ensures that the drawn lines are as close as possible to mathematically accurate lines, ensuring the precision of the line scan, and avoiding any redundant points (i.e., avoiding repeated drawing of the same voxel), thus improving drawing efficiency.

[0178] To determine the coordinates of the pixel corresponding to the nth scan line on the first and second coordinate axes, a perpendicular vector is determined between two positioning points perpendicular to the line direction. This perpendicular vector is then reduced to a unit vector, where the unit vector has a length of 1. The starting point of the nth scan line is the sum of the coordinate vector corresponding to the first positioning point and n × the unit vector. For example, if the scan line direction is from the first positioning point to the second positioning point, then the starting point of each scan line is located on the vector from the first positioning point to the fourth positioning point. Specifically, for the first scan, the starting point is the first positioning point; for the second scan, the starting point is the first positioning point coordinates + unit vector * 1; and for the nth scan, the starting point is the first positioning point coordinate vector + unit vector * n. Here, n is an integer greater than or equal to 1.

[0179] Due to the nature of progressive scanning, gaps between scan lines are unavoidable. However, in this embodiment, since the scan line direction is selected based on the actual distance between positioning points, these gaps are minimized. Furthermore, since the scan step size is 1, and the number of scan lines is determined by considering the vector length, the voxel points between scan lines are covered as uniformly as possible.

[0180] S590: Perform differential calculations in the direction of the third coordinate axis to determine the coordinates of the pixel on the third coordinate axis.

[0181] S5100: Combine the coordinates of all the first coordinate axis, the second coordinate axis, and the third coordinate axis to obtain the voxel coordinates of multiple pixels in the voxel cube of the displayed image.

[0182] In summary, this embodiment obtains the intersection points of the target voxel cube and the camera plane using the eight vertices of the target voxel cube, and then obtains the circumscribed rectangle formed by these intersection points. The four vertices of this circumscribed rectangle are the four positioning points. By utilizing the characteristic that the displayed image is the circumscribed rectangle of the camera image, the efficiency of obtaining the four positioning points is simplified and the accuracy of obtaining the four positioning points is improved, thereby further improving the registration efficiency of medical image coordinates. Linear scanning is used, and the scanning line direction is from the first positioning point to the second positioning point, or from the first positioning point to the fourth positioning point. This ensures that more pixels are scanned, thus contributing to further improving the registration accuracy of medical image coordinates.

[0183] In addition, this application also provides a coordinate registration device for medical images.

[0184] Appendix Figure 8 A schematic diagram of a coordinate registration device for medical images provided in an embodiment of this application. The device includes the following:

[0185] The positioning point acquisition unit 801 is used to acquire four positioning points of the display image and the voxel coordinates of the four positioning points in the voxel coordinate system; the display image is a rectangular image of the camera image displayed on the display interface, the camera image is the projection of a target voxel cube composed of multiple layers of medical images stacked on the current camera plane, and the four positioning points are the four vertices of the display image.

[0186] The direction determination unit 802 is used to determine a first direction, a second direction, and a third direction based on the voxel coordinates of the four positioning points; the first direction is the direction of the coordinate axis where the voxel coordinate change rate of the four positioning points is a first rate of change, the second direction is the direction of the coordinate axis where the voxel coordinate change rate of the four positioning points is a second rate of change, and the third direction is the direction of the coordinate axis where the voxel coordinate change rate of the four positioning points is a third rate of change, wherein the first rate of change is greater than or equal to the second rate of change, and the second rate of change is greater than or equal to the third rate of change;

[0187] The linear scanning unit 803 is used to obtain the coordinate values ​​of a pixel in the displayed image on a first coordinate axis and on a second coordinate axis by performing linear scanning in the first direction and the second direction; the coordinate values ​​of the first coordinate axis are the coordinate values ​​of the coordinate axis corresponding to the first direction, and the coordinate values ​​of the second coordinate axis are the coordinate values ​​of the coordinate axis corresponding to the second direction.

[0188] The differential calculation unit 804 is used to obtain the coordinate values ​​of the pixels in the display image on the third coordinate axis by performing differential calculation in the third direction, wherein the coordinate values ​​of the third coordinate axis are the coordinate values ​​of the coordinate axis corresponding to the third direction.

[0189] The registration unit 805 is used to combine the coordinate values ​​of the coordinate axis corresponding to the first direction, the coordinate values ​​of the coordinate axis corresponding to the second direction, and the coordinate values ​​of the coordinate axis of the third direction to obtain the voxel coordinates of at least one pixel in the display image in the target voxel cube.

[0190] For example, the four positioning points include a first positioning point, a second positioning point, a third positioning point, and a fourth positioning point. The first positioning point and the second positioning point are adjacent vertices, the first positioning point and the fourth positioning point are adjacent vertices, and the first positioning point and the third positioning point are diagonal vertices. The straight-line scanning unit 803 is specifically used for:

[0191] Determine the direction of the scanning line; the direction of the line includes either the first positioning point pointing to the second positioning point, or the first positioning point pointing to the fourth positioning point;

[0192] Based on the straight line direction and the preset scanning step size, a straight line scan is performed in the first direction and the second direction to determine the coordinate values ​​of the pixels of the displayed image in the first coordinate axis and the coordinate values ​​in the second coordinate axis at each step; the straight line scan starts from the first positioning point and ends at the fourth positioning point.

[0193] For example, a straight line scan is performed in the first and second directions based on the Bresenham algorithm.

[0194] In one example, the perpendicular vector between two positioning points perpendicular to the direction of the line is determined;

[0195] The vertical vector is reduced to a unit vector, and the length of the unit vector is 1.

[0196] The starting point of the scanning line in step n is obtained as the sum of the coordinate vector corresponding to the first positioning point and n × the unit vector;

[0197] Based on the scanning starting point and the direction of the straight line, determine the coordinate values ​​of the pixels of the displayed image in the first coordinate axis and the coordinate values ​​in the second coordinate axis in the nth step; where n is an integer greater than or equal to 1.

[0198] The determination of the linear direction of the scanning line includes:

[0199] Obtain a first vector from the second positioning point to the first positioning point, and a second vector from the fourth positioning point to the first positioning point; if the length of the first vector is greater than the length of the second vector, determine the direction of the scanning line as the first positioning point pointing to the fourth positioning point; if the length of the first vector is less than or equal to the length of the second vector, determine the direction of the scanning line as the first positioning point pointing to the second positioning point.

[0200] The difference calculation unit 804 is specifically used to: obtain the first coordinate difference between the first pixel and the second pixel on the first coordinate axis, and obtain the second coordinate difference between the first pixel and the second pixel on the second coordinate axis; the first pixel and the second pixel are adjacent pixels in the displayed image, and the coordinate value of the first pixel on the third coordinate axis is known;

[0201] Obtain the target parameter value, wherein the target parameter value is the sum of the product of the first coordinate difference and the first component of the unit normal vector of the current camera plane, and the product of the second coordinate difference and the second component of the unit normal vector of the current camera plane;

[0202] Based on the constraint equation between the first pixel and the second pixel, the coordinate value of the second pixel on the third coordinate axis is determined; the constraint equation is that the absolute value of the sum of the target change and the target parameter value is less than a first preset value, and the target change is the product of the difference equation between the first pixel and the second pixel on the third coordinate axis and the third component of the unit normal vector of the current camera plane.

[0203] In one example, the positioning point acquisition unit 801 is specifically used to: acquire multiple intersection points of the target voxel cube and the current camera plane, as well as the coordinate values ​​of the intersection points;

[0204] Based on the intersection coordinates of the plurality of intersection points, the four positioning points of the displayed image and the voxel coordinates of the four positioning points in the voxel coordinate system are determined; the four positioning points are the four vertices of the circumscribed polygon formed by the plurality of intersection points, and the vertices of the polygon are the plurality of intersection points.

[0205] Specifically, the process involves: acquiring the eight vertices of the target voxel cube and their voxel coordinates in the voxel coordinate system; determining the world coordinates of the eight vertices in the world coordinate system based on their voxel coordinates and the transformation between the voxel coordinate system and the world coordinate system; determining the equation of the straight line between every two vertices; and determining the multiple intersection points of the target voxel cube and the current camera plane, along with their intersection coordinates, based on the equation of the straight line between every two vertices and the plane equation of the current camera plane. The intersection coordinates are the world coordinates of the intersection points in the world coordinate system.

[0206] In another example, the intersection point on the target voxel cube among the plurality of intersection points is determined based on the world coordinates of the eight vertices; the step of determining the four positioning points of the display image and the voxel coordinates of the four positioning points in the voxel coordinate system based on the intersection coordinate values ​​of the plurality of intersection points includes: determining the four positioning points of the display image and the voxel coordinates of the four positioning points in the voxel coordinate system based on the intersection coordinate values ​​of the intersection points on the target voxel cube, wherein the four vertices are the four vertices of the circumscribed rectangle of the polygon formed by the intersection points on the target voxel cube.

[0207] In one example, the four positioning points include a first positioning point, a second positioning point, a third positioning point, and a fourth positioning point, wherein the first positioning point and the second positioning point are adjacent vertices, the first positioning point and the fourth positioning point are adjacent vertices, and the first positioning point and the third positioning point are diagonal vertices.

[0208] The direction determination unit 802 is specifically used to: determine the positioning vector between the third positioning point and the first positioning point; determine the coordinate axis direction corresponding to the component with the largest absolute value of the components of the positioning vector as the first direction, determine the coordinate axis direction corresponding to the component with the smallest absolute value of the components of the positioning vector as the third direction, and determine the coordinate axis direction corresponding to the remaining components in the positioning vector as the second direction.

[0209] The medical image coordinate registration device provided in this application only requires determining four positioning points. Then, through linear scanning or differential calculation, the coordinates of the pixels in the voxel coordinate system of the displayed image can be obtained, achieving coordinate registration. It does not require traversing the entire voxel cube for coordinate transformation, nor does it require complex matrix multiplication and / or vector multiplication. Therefore, it helps reduce computational workload and time consumption, thereby improving the real-time display of medical images on the display interface and ensuring that the real-time display of medical images meets user needs, thus improving user experience. Furthermore, for the coordinate values ​​of blocks with relatively high coordinate change rates, a linear scanning method is used, ensuring that the scanning lines are closely adjacent, further avoiding empty voxels between scanning lines. Thus, this application further solves the technical problem of low coordinate registration accuracy caused by the presence of empty voxels. Additionally, for third-direction coordinate change rates that are relatively slow, duplicate voxel points may exist. This application uses differential calculation between different pixels to infer the voxel coordinates of one pixel from the voxel coordinates of another pixel, thereby avoiding the influence of duplicate voxel points on coordinate registration and further improving coordinate registration accuracy.

[0210] This application further provides an electronic device comprising: a memory and a processor. The memory stores a computer program thereon. The processor executes the computer program in the memory to implement some or all of the steps in the coordinate registration method for medical images described in the foregoing embodiments.

[0211] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements some or all of the steps in the medical image coordinate registration method described in the foregoing embodiments.

[0212] It should be noted that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for the device and equipment embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments. The device and equipment embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components indicated as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the solution in this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

Claims

1. A method for coordinate registration of medical images, characterized in that, The method includes: Obtain four positioning points of the displayed image and the voxel coordinates of the four positioning points in the voxel coordinate system; the displayed image is a rectangular image of the camera image displayed on the display interface, the camera image is the projection of a target voxel cube composed of multiple layers of medical images stacked on the current camera plane, and the four positioning points are the four vertices of the displayed image. Based on the voxel coordinates of the four positioning points, a first direction, a second direction, and a third direction are determined; the first direction is the direction of the coordinate axis where the voxel coordinate change rate of the four positioning points is a first rate of change, the second direction is the direction of the coordinate axis where the voxel coordinate change rate of the four positioning points is a second rate of change, and the third direction is the direction of the coordinate axis where the voxel coordinate change rate of the four positioning points is a third rate of change, wherein the first rate of change is greater than or equal to the second rate of change, and the second rate of change is greater than or equal to the third rate of change; By performing a straight-line scan in the first and second directions, the coordinate values ​​of the pixels in the displayed image on the first coordinate axis and the coordinate values ​​on the second coordinate axis are obtained; the coordinate values ​​of the first coordinate axis are the coordinate values ​​of the coordinate axis corresponding to the first direction, and the coordinate values ​​of the second coordinate axis are the coordinate values ​​of the coordinate axis corresponding to the second direction; by performing a difference calculation in the third direction, the coordinate values ​​of the pixels in the displayed image on the third coordinate axis are obtained, and the coordinate values ​​of the third coordinate axis are the coordinate values ​​of the coordinate axis corresponding to the third direction; By combining the coordinate values ​​of the coordinate axis corresponding to the first direction, the coordinate values ​​of the coordinate axis corresponding to the second direction, and the coordinate values ​​of the coordinate axis of the third direction, the voxel coordinates of at least one pixel in the display image in the target voxel cube are obtained. The step of obtaining the coordinate values ​​of pixels in the displayed image on the third coordinate axis by performing differential calculation in the third direction includes: Obtain the first coordinate difference between the first pixel and the second pixel on the first coordinate axis, and obtain the second coordinate difference between the first pixel and the second pixel on the second coordinate axis; the first pixel and the second pixel are adjacent pixels in the displayed image, and the coordinate value of the first pixel on the third coordinate axis is known; Obtain the target parameter value, wherein the target parameter value is the sum of the product of the first coordinate difference and the first component of the unit normal vector of the current camera plane, and the product of the second coordinate difference and the second component of the unit normal vector of the current camera plane; Based on the constraint equation between the first pixel and the second pixel, the coordinate value of the second pixel on the third coordinate axis is determined; the constraint equation is that the absolute value of the sum of the target change and the target parameter value is less than a first preset value, and the target change is the product of the difference equation between the first pixel and the second pixel on the third coordinate axis and the third component of the unit normal vector of the current camera plane.

2. The method according to claim 1, characterized in that, The four positioning points include a first positioning point, a second positioning point, a third positioning point, and a fourth positioning point. The first positioning point and the second positioning point are adjacent vertices, the first positioning point and the fourth positioning point are adjacent vertices, and the first positioning point and the third positioning point are diagonal vertices. By performing a linear scan in the first and second directions, the coordinate values ​​of pixels in the displayed image on the first coordinate axis and the coordinate values ​​on the second coordinate axis are obtained, including: Determine the direction of the scanning line; the direction of the line includes either the first positioning point pointing to the second positioning point, or the first positioning point pointing to the fourth positioning point; Based on the straight line direction and the preset scanning step size, a straight line scan is performed in the first direction and the second direction to determine the coordinate values ​​of the pixels of the displayed image in the first coordinate axis and the coordinate values ​​in the second coordinate axis at each step; the straight line scan starts from the first positioning point and ends at the fourth positioning point.

3. The method according to claim 2, characterized in that, Determining the coordinates of the pixels of the displayed image at each step on the first coordinate axis and the second coordinate axis includes: Determine the perpendicular vectors of the two positioning points that are perpendicular to the direction of the line; The vertical vector is reduced to a unit vector, and the length of the unit vector is 1. The starting point of the scanning line in step n is obtained as the sum of the coordinate vector corresponding to the first positioning point and n × the unit vector; Based on the scanning starting point and the direction of the straight line, determine the coordinate values ​​of the pixels of the displayed image in the first coordinate axis and the coordinate values ​​in the second coordinate axis in the nth step; where n is an integer greater than or equal to 1.

4. The method according to claim 2, characterized in that, Determining the direction of the scanning line includes: Obtain the first vector from the second positioning point to the first positioning point, and the second vector from the fourth positioning point to the first positioning point; If the length of the first vector is greater than the length of the second vector, the direction of the scanning line is determined to be from the first positioning point to the fourth positioning point; If the length of the first vector is less than or equal to the length of the second vector, the direction of the scanning line is determined to be from the first positioning point to the second positioning point.

5. The method according to claim 1, characterized in that, The acquisition of the four positioning points of the displayed image and the voxel coordinates of the four positioning points in the voxel coordinate system includes: Obtain multiple intersection points between the target voxel cube and the current camera plane, as well as the coordinate values ​​of the intersection points; Based on the intersection coordinates of the plurality of intersection points, the four positioning points of the displayed image and the voxel coordinates of the four positioning points in the voxel coordinate system are determined; the four positioning points are the four vertices of the circumscribed rectangle of the polygon formed by the plurality of intersection points, and the vertices of the polygon are the plurality of intersection points.

6. The method according to claim 5, characterized in that, The step of obtaining multiple intersection points between the target voxel cube and the current camera plane, and the coordinate values ​​of the intersection points, includes: Obtain the 8 vertices of the target voxel cube and the voxel coordinates of the 8 vertices in the voxel coordinate system; Based on the voxel coordinates of the eight vertices and the transformation between the voxel coordinate system and the world coordinate system, determine the world coordinates of the eight vertices in the world coordinate system. Determine the equation of the line between every two vertices in the eight vertices; Based on the equation of the straight line between each pair of vertices and the equation of the plane of the current camera plane, determine the multiple intersection points of the target voxel cube and the current camera plane, as well as the coordinate values ​​of the intersection points. The coordinate values ​​of the intersection points are the world coordinate values ​​of the intersection points in the world coordinate system.

7. The method according to claim 6, characterized in that, After obtaining the intersection coordinates of multiple intersection points, the method further includes: Based on the world coordinates of the eight vertices, determine the intersection point on the target voxel cube among the plurality of intersection points; The step of determining the four positioning points of the displayed image and the voxel coordinates of the four positioning points in the voxel coordinate system based on the intersection coordinate values ​​of the plurality of intersection points includes: Based on the intersection coordinates of the intersection points on the target voxel cube, the four positioning points of the display image are determined, as well as the voxel coordinates of the four positioning points in the voxel coordinate system. The four vertices are the four vertices of the circumscribed rectangle of the polygon formed by the intersection points on the target voxel cube.

8. The method according to claim 1, characterized in that, The four positioning points include a first positioning point, a second positioning point, a third positioning point, and a fourth positioning point. The first positioning point and the second positioning point are adjacent vertices, the first positioning point and the fourth positioning point are adjacent vertices, and the first positioning point and the third positioning point are diagonal vertices. The step of determining the first direction, the second direction, and the third direction based on the voxel coordinates of the four positioning points includes: Determine the positioning vector between the third positioning point and the first positioning point; The coordinate axis direction corresponding to the component with the largest absolute value of the positioning vector is determined as the first direction, the coordinate axis direction corresponding to the component with the smallest absolute value of the positioning vector is determined as the third direction, and the coordinate axis direction corresponding to the remaining components in the positioning vector is determined as the second direction.

9. A coordinate registration device for medical images, characterized in that, The device includes: The positioning point acquisition unit is used to acquire four positioning points of the display image and the voxel coordinates of the four positioning points in the voxel coordinate system; the display image is a rectangular image of the camera image displayed on the display interface, the camera image is the projection of a target voxel cube composed of multiple layers of medical images stacked on the current camera plane, and the four positioning points are the four vertices of the display image. The direction determination unit is used to determine a first direction, a second direction, and a third direction based on the voxel coordinates of the four positioning points; the first direction is the direction of the coordinate axis where the voxel coordinate change rate of the four positioning points is a first rate of change, the second direction is the direction of the coordinate axis where the voxel coordinate change rate of the four positioning points is a second rate of change, and the third direction is the direction of the coordinate axis where the voxel coordinate change rate of the four positioning points is a third rate of change, wherein the first rate of change is greater than or equal to the second rate of change, and the second rate of change is greater than or equal to the third rate of change; A linear scanning unit is used to obtain the coordinate values ​​of a pixel in the displayed image on a first coordinate axis and on a second coordinate axis by performing linear scanning in the first direction and the second direction; the coordinate values ​​of the first coordinate axis are the coordinate values ​​of the coordinate axis corresponding to the first direction, and the coordinate values ​​of the second coordinate axis are the coordinate values ​​of the coordinate axis corresponding to the second direction. The differential calculation unit is used to obtain the coordinate values ​​of the pixels in the display image on the third coordinate axis by performing differential calculation in the third direction, wherein the coordinate values ​​of the third coordinate axis are the coordinate values ​​of the coordinate axis corresponding to the third direction. The registration unit is used to combine the coordinate values ​​of the coordinate axis corresponding to the first direction, the coordinate values ​​of the coordinate axis corresponding to the second direction, and the coordinate values ​​of the coordinate axis of the third direction to obtain the voxel coordinates of at least one pixel in the display image in the target voxel cube. The step of obtaining the coordinate values ​​of pixels in the displayed image on the third coordinate axis by performing differential calculation in the third direction includes: Obtain the first coordinate difference between the first pixel and the second pixel on the first coordinate axis, and obtain the second coordinate difference between the first pixel and the second pixel on the second coordinate axis; the first pixel and the second pixel are adjacent pixels in the displayed image, and the coordinate value of the first pixel on the third coordinate axis is known; Obtain the target parameter value, wherein the target parameter value is the sum of the product of the first coordinate difference and the first component of the unit normal vector of the current camera plane, and the product of the second coordinate difference and the second component of the unit normal vector of the current camera plane; Based on the constraint equation between the first pixel and the second pixel, the coordinate value of the second pixel on the third coordinate axis is determined; the constraint equation is that the absolute value of the sum of the target change and the target parameter value is less than a first preset value, and the target change is the product of the difference equation between the first pixel and the second pixel on the third coordinate axis and the third component of the unit normal vector of the current camera plane.

10. An electronic device, characterized in that, The electronic device includes a memory and a processor; The memory is coupled to the processor; The memory stores program instructions that, when executed by the processor, cause the electronic device to perform the method according to any one of claims 1-8.