Method for generating simulated x-ray images in hip prosthesis planning and electronic device

By generating simulated X-ray images and setting the color of the prosthesis model to the color of all voxels in the third image, a composite image is created to display the hip joint prosthesis planning results. This solves the problem that existing technologies cannot intuitively present the results in X-ray images and improves the accuracy of planning.

CN119498954BActive Publication Date: 2026-04-14LANCET ROBOTICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
LANCET ROBOTICS CO LTD
Filing Date
2024-11-01
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

In existing technologies, hip joint prosthesis planning methods cannot visually present the planning results in X-ray images, which affects the accuracy of the planning.

Method used

By generating simulated X-ray images, setting the color of the prosthesis model to the color of all voxels in the third image, and synthesizing the first, second, and fourth images, a simulated 3D CT image is obtained to demonstrate the hip joint prosthesis planning results.

Benefits of technology

It improves the accuracy of hip prosthesis planning, allowing doctors to visually see the planning results in X-ray images, thus enhancing the accuracy of the surgery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119498954B_ABST
    Figure CN119498954B_ABST
Patent Text Reader

Abstract

The application discloses a method for generating a simulated X-ray image in hip joint prosthesis planning and electronic equipment, and the method comprises the following steps: acquiring a left femur model, a right femur model and a three-dimensional CT image; processing the three-dimensional CT image based on the left femur model and the right femur model to obtain a first image, a second image and a third image; determining all first voxels located inside a prosthesis model based on the third image and the prosthesis model, setting the color of all the first voxels as the color corresponding to the prosthesis model, and obtaining a fourth image; and synthesizing the first image, the second image and the fourth image to obtain a simulated three-dimensional CT image. By setting the color of all the first voxels as the color corresponding to the prosthesis model to obtain the fourth image, the result of the hip joint prosthesis planning can be presented to a user for reference through the simulated three-dimensional CT image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and specifically to a method and electronic device for generating simulated X-ray images in hip joint prosthesis planning. Background Technology

[0002] In hip reconstruction surgery, it is crucial to ensure that the hip joint offset and hip joint length are equal on the operated and non-operated sides. Therefore, doctors need to plan the hip joint prosthesis before surgery to ensure that patients can recover hip joint function and reduce complications after surgery.

[0003] Currently, during the preoperative hip joint prosthesis planning stage, doctors usually simulate the placement of the prosthesis model on the patient's CT images as a reference for the prosthesis installation during surgery.

[0004] However, surgeons prefer to use medical imaging techniques such as CT (Computed Tomography) and DRR (Digitally Reconstructed Radiograph) for auxiliary planning. However, current preoperative hip prosthesis planning methods can only present a three-dimensional reconstructed model; they generally cannot display the stitched-together model results from the hip prosthesis planning in the X-ray image. This makes it impossible for surgeons to visually see the hip prosthesis planning results when referring to X-ray images, which often affects the accuracy of hip prosthesis planning. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this application provides a method and electronic device for generating simulated X-ray images in hip joint prosthesis planning. By setting the colors of all first voxels in the third image to the colors corresponding to the prosthesis model, a fourth image is obtained. Then, the first image, the second image, and the fourth image are synthesized to obtain a simulated three-dimensional CT image. This method can present the results of hip joint prosthesis planning to the user for reference through simulated three-dimensional CT images, thereby improving the accuracy of hip joint prosthesis planning.

[0006] To address the above problems, the present invention provides the following technical solution:

[0007] In a first aspect, embodiments of this application provide a method for generating simulated X-ray images in hip joint prosthesis planning, comprising: acquiring three-dimensional CT images of a left femoral model, a right femoral model, and a target object; processing the three-dimensional CT images based on the left femoral model and the right femoral model to obtain a first image showing only the left femoral bone of the target object, a second image showing only the right femoral bone of the target object, and a third image not showing the left and right femoral bones, wherein the first image, the second image, and the third image are all three-dimensional images; after hip joint prosthesis planning, determining all first voxels located inside the prosthesis model in the third image based on the coordinates of each voxel in the third image in a three-dimensional spatial coordinate system and the coordinates of each vertex on the surface of the prosthesis model in a three-dimensional spatial coordinate system, and setting the color of all first voxels in the third image to the color corresponding to the prosthesis model to obtain a fourth image, wherein the prosthesis model is composed of multiple vertices; and synthesizing the first image, the second image, and the fourth image to obtain a simulated three-dimensional CT image.

[0008] In some embodiments, processing the three-dimensional CT images based on the left femur model and the right femur model to obtain a first image showing only the left femur of the target object, a second image showing only the right femur of the target object, and a third image not showing the left and right femurs includes:

[0009] The three-dimensional CT image is cropped based on the left femoral model or the right femoral model to obtain the cropped three-dimensional CT image;

[0010] Based on the left femur model and the right femur model, the cropped three-dimensional CT image is processed to obtain a first image showing only the left femur of the target object, a second image showing only the right femur of the target object, and a third image showing neither the left nor the right femur.

[0011] In some embodiments, the step of cropping the three-dimensional CT image based on the left femoral model or the right femoral model to obtain the cropped three-dimensional CT image includes:

[0012] The principal axis of the model is determined based on the coordinates of each vertex on the left femur model or the right femur model;

[0013] A point on the main axis that is close to the first endpoint of the main axis and whose distance from the first endpoint is a preset ratio multiplied by the length of the main axis is selected as the first calculation point, wherein the physiological position of the first endpoint is close to the pelvis of the target object;

[0014] The three-dimensional CT image is cropped by a plane that passes through the first calculation point and is parallel to the horizontal plane of the three-dimensional spatial coordinate system, thus obtaining the cropped three-dimensional CT image.

[0015] In some embodiments, both the left femur model and the right femur model are composed of multiple vertices. Processing the 3D CT image based on the left femur model and the right femur model to obtain a first image showing only the left femur of the target object, a second image showing only the right femur of the target object, and a third image not showing either the left or right femur includes: determining all second voxels located inside the left femur model in the 3D CT image based on the coordinates of each voxel in the 3D CT image in a 3D spatial coordinate system and the coordinates of each vertex on the surface of the left femur model in a 3D spatial coordinate system; and processing the 3D CT image... The first image is obtained by setting the color of all voxels in the image except the second voxel to a preset background color; the third voxel in the three-dimensional CT image is determined based on the coordinates of each voxel in the three-dimensional spatial coordinate system and the coordinates of each vertex on the surface of the right femur model in the three-dimensional spatial coordinate system; the color of all voxels in the three-dimensional CT image except the third voxel is set to the background color to obtain the second image; the third image is obtained by setting the colors of all the second voxels and the third voxels in the three-dimensional CT image to the background color.

[0016] In some embodiments, before determining all first voxels located inside the prosthesis model in the third image based on the coordinates of each voxel in the third image in a three-dimensional coordinate system and the coordinates of each vertex on the surface of the prosthesis model in a three-dimensional coordinate system after hip joint prosthesis planning, and setting the color of all first voxels in the third image to the color corresponding to the prosthesis model to obtain a fourth image, the method further includes: obtaining a first position transformation matrix of the left femoral model, a second position transformation matrix of the right femoral model, and a third position transformation matrix of the pelvic model after hip joint prosthesis planning; multiplying the first position transformation matrix with the first image to move the first image so that the position of the first image corresponds to the position of the left femoral model after hip joint prosthesis planning; multiplying the second position transformation matrix with the second image to move the second image so that the position of the second image corresponds to the position of the right femoral model after hip joint prosthesis planning; and multiplying the third position transformation matrix with the third image to move the third image so that the position of the third image corresponds to the position of the pelvic model after hip joint prosthesis planning.

[0017] In some embodiments, the prosthesis model includes multiple sub-prosthesis models. After hip joint prosthesis planning, determining all first voxels located inside the prosthesis model in the third image based on the coordinates of each voxel in the third image in a three-dimensional coordinate system and the coordinates of each vertex on the surface of the prosthesis model in a three-dimensional coordinate system, and setting the color of all first voxels in the third image to the color corresponding to the prosthesis model to obtain a fourth image includes: after hip joint prosthesis planning, determining a subset of first voxels located inside each of the sub-prosthesis models in the third image based on the coordinates of each voxel in the third image in a three-dimensional coordinate system and the coordinates of each vertex on the surface of each sub-prosthesis model in a three-dimensional coordinate system, obtaining multiple subsets of first voxels; setting the color of all voxels in each subset of first voxels to the color corresponding to the subset of first voxels, obtaining the fourth image.

[0018] In some implementations, the hip joint prosthesis planning mode includes a hip joint offset planning mode and a hip joint length planning mode. After hip joint prosthesis planning, based on the coordinates of each voxel in the third image in the three-dimensional coordinate system and the coordinates of each vertex on the surface of the prosthesis model in the three-dimensional coordinate system, all first voxels located inside the prosthesis model in the third image are determined, and the color of all first voxels in the third image is set to the color corresponding to the prosthesis model to obtain a fourth image. This includes: after hip joint prosthesis planning, based on the coordinates of each voxel in the third image in the three-dimensional coordinate system and the coordinates of each vertex on the surface of the prosthesis model in the hip joint offset planning mode... The coordinates of all first voxels located inside the prosthesis model in the third image are determined in the three-dimensional spatial coordinate system, and the colors of all first voxels in the third image are set to the colors corresponding to the prosthesis model, thus obtaining a fourth image corresponding to the hip joint offset planning mode; based on the coordinates of each voxel in the third image in the three-dimensional spatial coordinate system and the coordinates of each vertex on the surface of the prosthesis model in the three-dimensional spatial coordinate system in the hip joint length planning mode, the coordinates of all first voxels located inside the prosthesis model in the third image are determined, and the colors of all first voxels in the third image are set to the colors corresponding to the prosthesis model, thus obtaining a fourth image corresponding to the hip joint length planning mode.

[0019] In some embodiments, synthesizing the first image, the second image, and the fourth image to obtain a simulated three-dimensional CT image includes: resampling the first image based on the first image and the fourth image so that the size of the first image is the same as the size of the fourth image; resampling the second image based on the second image and the fourth image so that the size of the second image is the same as the size of the fourth image; and adding the first image, the second image, and the fourth image to obtain the simulated three-dimensional CT image.

[0020] In some embodiments, the method further includes: inputting the simulated three-dimensional CT image into a ray projection model to obtain a simulated two-dimensional DRR image, wherein the simulated two-dimensional DRR image displays the prosthesis model.

[0021] In a second aspect, embodiments of this application provide an electronic device, the electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method for generating simulated X-ray images in hip joint prosthesis planning as described in the first aspect.

[0022] This application provides a method and electronic device for generating simulated X-ray images in hip joint prosthesis planning. This application obtains a fourth image by setting the color of all first voxels in the third image to the color corresponding to the prosthesis model, and then synthesizes the first image, the second image and the fourth image to obtain a simulated three-dimensional CT image. This can present the results of hip joint prosthesis planning to the user for reference through simulated three-dimensional CT images, thereby improving the accuracy of hip joint prosthesis planning. Attached Figure Description

[0023] Figure 1 This is a flowchart illustrating the first embodiment of the method for generating simulated X-ray images in hip joint prosthesis planning provided in this application.

[0024] Figure 2 This is a flowchart illustrating the second embodiment of the method for generating simulated X-ray images in hip joint prosthesis planning provided in this application.

[0025] Figure 3 This is a schematic diagram of a cross-sectional two-dimensional X-ray image of a three-dimensional CT image obtained from an embodiment of this application.

[0026] Figure 4 yes Figure 1 A detailed flowchart of step S200.

[0027] Figure 5A yes Figure 4 A schematic diagram of the principle of step S210.

[0028] Figure 5B yes Figure 4 A schematic diagram of the principle of step S230.

[0029] Figure 6 This is a schematic diagram of a cross-sectional two-dimensional X-ray image of the third image provided in the embodiments of this application.

[0030] Figure 7 yes Figure 1 A schematic diagram of the first detailed process of step S300.

[0031] Figure 8 yes Figure 1 A schematic diagram of the second detailed process of step S300.

[0032] Figure 9 yes Figure 1 A detailed flowchart of step S400.

[0033] Figure 10A This is a schematic diagram of the first combined model provided in the embodiments of this application.

[0034] Figure 10B This is a schematic diagram of the first simulated two-dimensional X-ray image provided in the embodiments of this application.

[0035] Figure 10C This is a schematic diagram of the second combined model provided in the embodiments of this application.

[0036] Figure 10D This is a schematic diagram of the second simulated two-dimensional X-ray image provided in the embodiments of this application.

[0037] Figure 11 This is a flowchart illustrating the third embodiment of the method for generating simulated X-ray images in hip joint prosthesis planning provided in this application.

[0038] Figure 12A This is a schematic diagram of the first simulated two-dimensional DRR image provided in the embodiments of this application.

[0039] Figure 12B This is a schematic diagram of the second simulated two-dimensional DRR image provided in the embodiments of this application.

[0040] Figure 13 This is a schematic diagram of the structure of the device for generating simulated X-ray images in hip joint prosthesis planning provided in the embodiments of this application.

[0041] Figure 14 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0042] Figure 15 This is a structural block diagram of a computer-readable storage medium provided in an embodiment of this application. Detailed Implementation

[0043] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0044] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0045] This application provides a method and electronic device for generating simulated X-ray images in hip joint prosthesis planning. By setting the colors of all first voxels in the third image to the colors corresponding to the prosthesis model, a fourth image is obtained. Then, the first image, the second image, and the fourth image are synthesized to obtain a simulated three-dimensional CT image. The results of hip joint prosthesis planning can be presented to the user for reference through simulated three-dimensional CT images, thereby improving the accuracy of hip joint prosthesis planning.

[0046] The method for generating simulated X-ray images in hip joint prosthesis planning provided in this application will be described in detail below with reference to the accompanying drawings.

[0047] Please see Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the method for generating simulated X-ray images in hip joint prosthesis planning provided in this application. Figure 1 As shown, the method for generating simulated X-ray images in the hip joint prosthesis planning includes steps S100 to S400.

[0048] Step S100: Obtain three-dimensional CT images of the left femur model, the right femur model, and the target object.

[0049] 3D CT images are three-dimensional images created by superimposing two-dimensional X-ray images using 3D reconstruction technology and computer post-processing techniques. A 3D CT image consists of multiple voxels. A voxel, short for volume pixel, is the smallest unit of division in a 3D CT image in three-dimensional space, corresponding to a pixel in two-dimensional space. A 3D CT image is a three-dimensional image in a three-dimensional coordinate system, and each voxel in the 3D CT image has coordinates in that three-dimensional coordinate system.

[0050] In some implementations, the pelvic model, left femur model, and right femur model of the target object are obtained based on the three-dimensional CT images of the target object.

[0051] Optionally, methods for obtaining the pelvic, left femur, and right femur models of the target object based on the three-dimensional CT images of the target object include manual segmentation methods and artificial intelligence algorithms.

[0052] In some implementations, in step S100, the three-dimensional CT images of the left femoral model, the right femoral model, and the target object have been predetermined, and the three-dimensional CT images of the left femoral model, the right femoral model, and the target object are directly acquired.

[0053] Please see Figure 2 , Figure 2 This is a flowchart illustrating a second embodiment of the method for generating simulated X-ray images in hip joint prosthesis planning provided in this application. Figure 2 As shown, in some embodiments, before step S200, the method for generating simulated X-ray images in the hip joint prosthesis planning further includes step S110.

[0054] Step S110: Extract a three-dimensional CT image based on the left femoral model or the right femoral model to obtain the extracted three-dimensional CT image.

[0055] Because the prosthesis model is mainly located near the pelvic bone model in hip joint prosthesis planning, further processing can be performed only on the cropped 3D CT images. This reduces the computational load.

[0056] In some implementations, step S110 includes steps (110.1) to (110.3).

[0057] (110.1) Determine the principal axis of the model based on the coordinates of each vertex on the left femur model or the right femur model.

[0058] In some implementations, both the left femur model and the right femur model are composed of multiple vertices.

[0059] Optionally, both the left femur model and the right femur model are mesh models, which are composed of multiple polygonal patches, each with multiple vertices.

[0060] In some implementations, a grid data toolkit is used to model and process all models in this method.

[0061] Alternatively, grid data toolkits include VTK (Visualization Toolkit), Meshmixer, CloudCompare, ParaView, and MeshLab.

[0062] Optionally, when using the VTK tool library, the surface mesh data for all models is of type vtkPolyData.

[0063] In some implementations, a vertex on the left or right femoral model is designated as the first endpoint of the model's principal axis when its vertical coordinate is the maximum among all vertices.

[0064] Optionally, in a three-dimensional coordinate system, the coordinate axis in the vertical direction is the Z-axis, and the coordinate value of the vertex in the vertical direction is the Z-axis coordinate value.

[0065] In some implementations, when the coordinates of a vertex on the left or right femoral model are the minimum of the vertical coordinates of all vertices, that vertex is determined as the second endpoint of the model's principal axis.

[0066] Optionally, the first and second endpoints of the main axis can be connected to obtain the main axis of the model.

[0067] In some implementations, the PCA (Principal Component Analysis) method is used to determine the first and second endpoints of the principal axes of the model.

[0068] (110.2) Select a point on the main spindle that is close to the first endpoint of the main spindle and whose distance from the first endpoint is a preset ratio multiplied by the length of the main spindle as the first calculation point.

[0069] The physiological location of the first endpoint is close to the pelvis of the target object.

[0070] Optionally, the length of the main shaft can be obtained by subtracting the coordinate value of the second endpoint in the vertical direction from the coordinate value of the first endpoint in the vertical direction.

[0071] Optionally, the preset ratio ranges from one-fifth to one-half, for example, the preset ratio is one-fifth, one-quarter, one-third or one-half, etc.

[0072] (110.3) The three-dimensional CT image is cropped according to the plane that passes through the first calculation point and is parallel to the horizontal plane of the three-dimensional spatial coordinate system, so as to obtain the cropped three-dimensional CT image.

[0073] As mentioned above, a 3D CT image is a 3D image in a 3D spatial coordinate system, and each voxel in a 3D CT image has coordinates in the 3D spatial coordinate system.

[0074] In some implementations, a plane parallel to the horizontal plane of the three-dimensional spatial coordinate system is drawn through the first calculation point. This plane is used to crop the three-dimensional CT image, retaining a portion of the pelvis of the target object, thus obtaining the cropped three-dimensional CT image. The cropped three-dimensional CT image is also a three-dimensional image.

[0075] Optionally, the horizontal plane of the three-dimensional spatial coordinate system is the XOY plane.

[0076] In some implementations, users can specify a section in the 3D image from which they want to view the 2D image, according to their own needs.

[0077] In some implementations, a specified cross section is determined according to a selection instruction, and then the specified cross section is used to crop the three-dimensional image to obtain a two-dimensional image.

[0078] Please see Figure 3 , Figure 3 This is a schematic diagram of a cross-sectional two-dimensional X-ray image of a cropped three-dimensional CT image provided in an embodiment of this application. For example... Figure 3 As shown, a cross-section of the three-dimensional CT image and a two-dimensional X-ray image 1 show the pelvis of the target object as well as a portion of the left and right femurs.

[0079] It is understandable that the left femur of the target object is located on the right side of a cross-section of the 3D CT image 1, and the right femur of the target object is located on the left side of a cross-section of the 3D CT image 1.

[0080] After cropping the 3D CT image, the 3D CT images processed in the following steps are all cropped 3D CT images.

[0081] Step S200: Process the three-dimensional CT images based on the left femur model and the right femur model to obtain a first image that only shows the left femur of the target object, a second image that only shows the right femur of the target object, and a third image that does not show the left and right femurs.

[0082] Among them, the first image, the second image, and the third image are all three-dimensional images.

[0083] In some implementations, step S200 includes: processing the cropped three-dimensional CT image based on the left femur model and the right femur model to obtain a first image that only shows a portion of the left femur of the target object, a second image that only shows a portion of the right femur of the target object, and a third image that does not show the left and right femurs.

[0084] Please see Figure 4 , Figure 4 yes Figure 1 A detailed flowchart of step S200. (See attached diagram.) Figure 4 As shown, in some embodiments, step S200 includes steps S210 to S250.

[0085] Step S210: Determine all second voxels located inside the left femur model in the 3D CT image based on the coordinates of each voxel in the 3D CT image in the 3D spatial coordinate system and the coordinates of each vertex on the surface of the left femur model in the 3D spatial coordinate system.

[0086] Please see Figure 5A , Figure 5A yes Figure 4 A schematic diagram of the principle of step S210. (See attached diagram.) Figure 5A As shown, in some embodiments, the left femoral model 10 has a position in a three-dimensional spatial coordinate system, and the cropped three-dimensional CT image also has a position in a three-dimensional spatial coordinate system. Figure 5A The image shows a cross-section of a 2D X-ray image 1 taken from a 3D CT image, positioned behind the left femur model 10. It can be understood that in the 3D CT image 1, the voxel region showing the target object's left femur is located within the left femur model 10.

[0087] In some implementations, each voxel in the 3D CT image is determined to be inside the left femur model based on the coordinates of each voxel in the 3D CT image in the 3D spatial coordinate system and the coordinates of each vertex on the surface of the left femur model in the 3D spatial coordinate system. If so, the voxel is identified as the second voxel inside the left femur model.

[0088] In some implementations, a first ray is generated using a voxel in the 3D CT image as the endpoint of the first ray. If the number of intersections between the first ray and the surface of the left femur model is odd, the voxel is determined to be inside the left femur model. If the number of intersections is even, the voxel is determined to be outside the left femur model.

[0089] Step S220: Set the color of all voxels in the 3D CT image except the second voxel to the preset background color to obtain the first image.

[0090] The first image shows only the left femur of the target object.

[0091] Optionally, the gray values ​​of all voxels in the 3D CT image except the second voxel are set to a preset background gray value.

[0092] Optionally, the background grayscale value is 0.

[0093] Optionally, when using the VTK tool library, the left femur model is constructed as the first image template of the vtkPolyDataToImageStencil class. The first image template and the 3D CT image are input into the vtkImageStencil function. In the vtkImageStencil function, the SetBackgroundValue function is used to set the grayscale value of the background voxels (all voxels except the first voxel) output by the vtkImageStencil function to 0. The output of the vtkImageStencil function is the first image.

[0094] Step S230: Determine all third voxels located inside the right femur model in the 3D CT image based on the coordinates of each voxel in the 3D CT image in the 3D spatial coordinate system and the coordinates of each vertex on the surface of the right femur model in the 3D spatial coordinate system.

[0095] Please see Figure 5B , Figure 5B yes Figure 4 A schematic diagram of the principle of step S230. (See diagram below.) Figure 5B As shown, in some embodiments, the right femur model 20 has a position in a three-dimensional spatial coordinate system, and the cropped three-dimensional CT image also has a position in a three-dimensional spatial coordinate system. Figure 5A The image shows a cross-section of a 2D X-ray image 1 taken from a 3D CT image, positioned behind the right femur model 20. It can be understood that in the 3D CT image, the voxel region showing the target object's right femur is located within the right femur model 20.

[0096] In some implementations, each voxel in the 3D CT image is determined to be inside the right femur model based on the coordinates of each voxel in the 3D CT image in the 3D spatial coordinate system and the coordinates of each vertex on the surface of the right femur model in the 3D spatial coordinate system. If so, the voxel is identified as the third voxel inside the right femur model.

[0097] In some implementations, a second ray is generated using a voxel in the 3D CT image as its endpoint. If the number of intersections between the second ray and the surface of the right femur model is odd, the voxel is determined to be inside the right femur model. If the number of intersections is even, the voxel is determined to be outside the right femur model.

[0098] Step S340: Set the color of all voxels in the 3D CT image except the third voxel to the background color to obtain the second image.

[0099] The second image shows only the right femur of the target object.

[0100] Optionally, the grayscale values ​​of all voxels in the 3D CT image except the third voxel can be set to a preset background grayscale value.

[0101] Optionally, when using the VTK tool library, the right femur model is constructed as the second image template of the vtkPolyDataToImageStencil class. The second image template and the 3D CT image are input into the vtkImageStencil function. In the vtkImageStencil function, the SetBackgroundValue function is used to set the grayscale value of the background voxels (all voxels except the third voxel) output by the vtkImageStencil function to 0. The output of the vtkImageStencil function is the second image.

[0102] Step S250: Set the colors of all second and third voxels in the 3D CT image to the background color to obtain the third image.

[0103] In some implementations, a third image is obtained by subtracting the first and second images from the three-dimensional CT image simultaneously.

[0104] Specifically, the voxel value of each voxel in the three-dimensional CT image is simultaneously subtracted from the voxel value of the voxel at the same position in the first image and the voxel value of the voxel at the same position in the second image to obtain the third image.

[0105] In some implementations, when using the VTK tool library, the right femur model is constructed as a second image template of the vtkPolyDataToImageStencil class. The first image template and the first image are input into the vtkImageStencil function. In the vtkImageStencil function, the SetBackgroundValue function is used to set the grayscale value of the background voxel output by the vtkImageStencil function to 0, and the reverse template fetching option of the ReverseStencilOn function is also enabled. The output of the vtkImageStencil function is the third image.

[0106] Please see Figure 6 , Figure 6 This is a schematic diagram of a cross-sectional two-dimensional X-ray image of the third image provided in an embodiment of this application. For example... Figure 6 As shown, the second cross-section of the third image, a two-dimensional X-ray image, does not show the left and right femurs of the target object.

[0107] In some embodiments, before step S300, the method for generating simulated X-ray images in hip joint prosthesis planning further includes: moving the first image, the second image, and the third image respectively, so that the position of the first image corresponds to the position of the left femoral model after hip joint prosthesis planning, the position of the second image corresponds to the position of the right femoral model after hip joint prosthesis planning, and the position of the third image corresponds to the position of the pelvic model after hip joint prosthesis planning.

[0108] In some implementations, the hip prosthesis planning modes include hip offset planning mode and hip length planning mode.

[0109] Optionally, the first image, the second image, and the third image are moved according to the movement command in the hip joint offset planning mode and the hip joint length planning mode, respectively, so that the positions of the images and the model correspond in the current hip joint prosthesis planning mode.

[0110] In some implementations, prior to step S300, the method for generating simulated X-ray images in the hip joint prosthesis planning further includes steps (260.1) to (260.4).

[0111] (260.1) Obtain the first position transformation matrix of the left femur model, the second position transformation matrix of the right femur model, and the third position transformation matrix of the pelvic model after hip joint prosthesis planning.

[0112] (260.2) Multiply the first position transformation matrix with the first image to move the first image so that the position of the first image corresponds to the position of the left femur model after hip joint prosthesis planning.

[0113] Optionally, the coordinates of each voxel in the first image are multiplied by a first position transformation matrix, thereby moving the first image.

[0114] (260.3) Multiply the second position transformation matrix with the second image to move the second image so that the position of the second image corresponds to the position of the right femur model after hip joint prosthesis planning.

[0115] Optionally, the coordinates of each voxel in the second image are multiplied by the second position transformation matrix, thereby moving the second image.

[0116] (260.4) Multiply the third position transformation matrix with the third image to move the third image so that the position of the third image corresponds to the position of the pelvic model after hip joint prosthesis planning.

[0117] Optionally, the coordinates of each voxel in the third image are multiplied by the third position transformation matrix, thereby shifting the third image.

[0118] Step S300: After planning the hip joint prosthesis, based on the coordinates of each voxel in the third image in the three-dimensional coordinate system and the coordinates of each vertex on the surface of the prosthesis model in the three-dimensional coordinate system, determine all the first voxels located inside the prosthesis model in the third image, and set the color of all the first voxels in the third image to the color corresponding to the prosthesis model to obtain the fourth image.

[0119] The method for determining all first voxels located inside the prosthesis model in the third image in step S300 is the same as the method for determining all second voxels located inside the left femur model in the three-dimensional CT image in step S210.

[0120] The prosthetic model consists of multiple vertices.

[0121] Optionally, the prosthetic model is a mesh model, which consists of multiple polygonal faces, each with multiple vertices.

[0122] For example, the gray values ​​of all first voxels in the third image are set to the gray values ​​corresponding to the spoof model to obtain the fourth image.

[0123] Optionally, since prostheses are mostly made of high-density polymers or metals, their grayscale values ​​in real CT images are often very high (e.g., grayscale values ​​above 2000). Therefore, the grayscale value range corresponding to the prosthesis model is 2000 to 3500, for example, the grayscale value corresponding to the prosthesis model is 2000, 2500, 3000 or 3500, etc.

[0124] For example, when using the VTK tool library, the prosthetic model is constructed as a third image template of the vtkPolyDataToImageStencil class. The third image template and the third image are input into the vtkImageStencil function. In the vtkImageStencil function, the SetBackgroundValue function is used to set the grayscale value of the background voxel output by the vtkImageStencil function to 3000, and the reverse template fetching option of the ReverseStencilOn function is also enabled. The output of the vtkImageStencil function is the fourth image.

[0125] In some implementations, the prosthesis model includes multiple sub-prosthesis models.

[0126] In some implementations, the prosthesis model includes a pelvic prosthesis model and a femoral prosthesis model.

[0127] Optionally, the pelvic prosthesis model includes an acetabular cup model and a liner model, and the femoral prosthesis model includes a ball head model and a femoral stem model. In hip reconstruction surgery, the acetabular cup and liner are installed in the target patient's pelvis, and the ball head and femoral stem are installed in the target patient's femur.

[0128] Optionally, the entire pelvic prosthesis model can be used as a sub-prosthesis model.

[0129] Optionally, the entire femoral prosthesis model can be used as a sub-prosthesis model.

[0130] Optionally, the acetabular cup model, the liner model, the ball head model, and the femoral stem model can each be used as a sub-prosthesis model.

[0131] In some implementations, each sub-prosthetic model is displayed differently.

[0132] Please see Figure 7 , Figure 7 yes Figure 1 A detailed flowchart of step S300. (See diagram below.) Figure 7 As shown, in some embodiments, step S300 includes steps S310 to S320.

[0133] Step S310: After planning the hip joint prosthesis, based on the coordinates of each voxel in the third image in the three-dimensional coordinate system and the coordinates of each vertex on the surface of each sub-prosthesis model in the three-dimensional coordinate system, determine the first voxel subset located inside each sub-prosthesis model in the third image, and obtain multiple first voxel subsets.

[0134] The method for determining the first voxel subset located inside each sub-prosthetic model in the third image in step S310 is the same as the method for determining all the second voxels located inside the left femur model in the three-dimensional CT image in step S210.

[0135] Step S320: Set the color of all voxels in each first voxel subset to the color corresponding to the first voxel subset to obtain the fourth image.

[0136] By setting the color of all voxels in each first voxel subset to the color corresponding to the first voxel subset, each sub-prosthesis model can be displayed differently. This makes it easier for users to determine the accurate location of each sub-prosthesis model based on the simulated 3D CT image obtained from the fourth image, thereby further improving the accuracy of hip joint prosthesis planning.

[0137] In some implementations, step S320 includes steps (320.1) to (320.3).

[0138] (320.1) Set the gray values ​​of all voxels in each first voxel subset to the gray values ​​corresponding to the first voxel subset.

[0139] Different subsets of the first voxel correspond to different gray values.

[0140] For example, the gray values ​​of all voxels in the first voxel subset corresponding to the pelvic prosthesis model are set to 2500, and the gray values ​​of all voxels in the first voxel subset corresponding to the femoral prosthesis model are set to 3000.

[0141] (320.2) Obtain the color mapping information of the prosthetic model.

[0142] Optionally, the color mapping information of the prosthetic model is used to map all voxels of multiple different grayscale values ​​to different colors respectively.

[0143] For example, the color mapping information is used to map all voxels with a grayscale value of 2500 to green and all voxels with a grayscale value of 3000 to red.

[0144] Optionally, color mapping information is also used to set the transparency of colors.

[0145] For example, when using the VTK tool library, a new vtkLookupTable color transparency mapping table is created. The SetTableValue function in the table can accept five input values. The first input value is the pixel index value, the second to fourth input values ​​are the ratio values ​​of the three RGB colors, and the fifth input value is the opacity value.

[0146] (320.3) Based on the color mapping relationship information, set the color of all voxels in the third image with a preset gray value to the corresponding color.

[0147] For example, based on the color mapping relationship information, all voxels with a gray value of 2500 in the third image are mapped to green, and all voxels with a gray value of 3000 are mapped to red, to obtain the fourth image.

[0148] For example, when using the VTK tool library, the SetTableValue function is used to bind all voxels with a grayscale value of 2500 in the color transparency map to completely opaque green. The input to the SetTableValue function is (1, 0, 1, 0, 1). After binding all colors in the color transparency map according to the color mapping information, this color transparency map is applied to the third image to set the color of all voxels in the third image with a preset grayscale value to the corresponding color.

[0149] As described above, in some embodiments, the hip joint prosthesis planning modes include a hip joint offset planning mode and a hip joint length planning mode.

[0150] Optionally, a fourth image corresponding to each hip joint prosthesis planning pattern is determined, and subsequently, the corresponding first, second, and fourth images are synthesized under each hip joint prosthesis planning pattern to obtain a simulated 3D CT image. In this way, the hip joint prosthesis planning results under each planning pattern can be presented to the user for reference through simulated 3D CT images, thereby further improving the accuracy of hip joint prosthesis planning.

[0151] Please see Figure 8 , Figure 8 yes Figure 1 A detailed flowchart of step S300. (See diagram below.) Figure 8 As shown, in some embodiments, step S300 includes steps S330 to S340.

[0152] Step S330: After planning the hip joint prosthesis, based on the coordinates of each voxel in the third image in the three-dimensional coordinate system and the coordinates of each vertex on the surface of the prosthesis model in the three-dimensional coordinate system in the hip joint offset planning mode, determine all the first voxels located inside the prosthesis model in the third image, and set the color of all the first voxels in the third image to the color corresponding to the prosthesis model, thus obtaining the fourth image corresponding to the hip joint offset planning mode.

[0153] Step S340: Based on the coordinates of each voxel in the third image in the three-dimensional spatial coordinate system and the coordinates of each vertex on the surface of the prosthesis model in the three-dimensional spatial coordinate system in the hip joint length planning mode, determine all the first voxels located inside the prosthesis model in the third image, and set the color of all the first voxels in the third image to the color corresponding to the prosthesis model, to obtain the fourth image corresponding to the hip joint length planning mode.

[0154] The specific methods for obtaining the fourth image in steps S330 and S340 are described above.

[0155] Step S400: Synthesize the first image, the second image, and the fourth image to obtain a simulated three-dimensional CT image.

[0156] In some implementations, corresponding first, second, and fourth images are synthesized in each hip prosthesis planning mode to obtain a simulated three-dimensional CT image.

[0157] Please see Figure 9 , Figure 9 yes Figure 1 A detailed flowchart of step S400. (See attached diagram.) Figure 9 As shown, in some embodiments, step S400 includes steps S410 to S430.

[0158] Step S410: Resample the first image based on the first image and the fourth image so that the size of the first image is the same as the size of the fourth image.

[0159] For example, when using the VTK tool library, the ResampleImageFilter class is used to resample the first image based on the first image and the fourth image. Specifically, using the fourth image as a reference image, a suitable interpolator (e.g., the BSplineInterpolateImageFunction interpolator) is selected to resample the first image so that the size of the first image is the same as the size of the fourth image.

[0160] Step S420: Resample the second image based on the second image and the fourth image so that the size of the second image is the same as the size of the fourth image.

[0161] For example, when using the VTK tool library, the ResampleImageFilter class is used to resample the second image based on the second and fourth images. Specifically, using the fourth image as a reference image, an appropriate interpolator (e.g., the BSplineInterpolateImageFunction interpolator) is selected to resample the second image so that the size of the second image is the same as the size of the fourth image.

[0162] Step S430: Add the first image, the second image and the fourth image to obtain a simulated three-dimensional CT image.

[0163] For example, when using the VTK tool library, the AddImageFilter function is used to add the fourth image to the first and second images in sequence to obtain a simulated three-dimensional CT image.

[0164] In some implementations, when the color of all first voxels in the fourth image has been set to the color corresponding to the prosthesis model, each voxel in the simulated 3D CT image that is at the same position as the first voxel is set to the color corresponding to the first voxel.

[0165] In some implementations, users can specify a cross section in a simulated 3D CT image that they need to view a 2D X-ray image, and then obtain the simulated 2D X-ray image corresponding to that cross section using the method of this application.

[0166] In some implementations, a specified cross section is determined according to a selection instruction, and then the specified cross section is used to crop the simulated three-dimensional CT image to obtain a simulated two-dimensional X-ray image.

[0167] Please see Figure 10A and Figure 10B , Figure 10A This is a schematic diagram of the first combined model provided in the embodiments of this application. Figure 10B This is a schematic diagram of the first simulated two-dimensional X-ray image provided in the embodiments of this application.

[0168] like Figure 10A As shown, the first combined model 3 is a combined model obtained under the hip joint offset planning mode. In some embodiments, the pelvic model 30 and the pelvic prosthesis model 40 partially overlap to form a pelvic-pelvic prosthesis combined model. The pelvic prosthesis model 40 includes an acetabular cup model 41 and a liner model 42.

[0169] In some embodiments, the right femoral model 20 overlaps with the femoral prosthesis model 50 to form a femoral-femoral prosthesis composite model. The femoral prosthesis model 50 includes a ball head model 51 and a femoral stem model 52.

[0170] like Figure 10B As shown, the first simulated two-dimensional X-ray image 4 is a simulated two-dimensional X-ray image corresponding to the hip joint offset planning mode. The bright white part in the first simulated two-dimensional X-ray image 4 represents the position of the prosthesis model in the hip joint offset planning mode. It can be seen that the first simulated two-dimensional X-ray image 4 is very clear, and the display effect is comparable to that of a real two-dimensional X-ray image, indicating that the method for generating simulated X-ray images in hip joint prosthesis planning provided in this application embodiment can achieve good processing results.

[0171] Please see Figure 10C and Figure 10D , Figure 10C This is a schematic diagram of the second combined model provided in the embodiments of this application. Figure 10D This is a schematic diagram of the second simulated two-dimensional X-ray image provided in the embodiments of this application.

[0172] like Figure 10C As shown, the second combined model 5 is a combined model obtained under the hip joint length planning mode.

[0173] like Figure 10D As shown, the second simulated two-dimensional X-ray image 6 is a two-dimensional X-ray image corresponding to the hip joint length planning mode. The bright white portion in the second simulated two-dimensional X-ray image 6 represents the position of the prosthesis model in the hip joint length planning mode. It can be seen that the second simulated two-dimensional X-ray image 6 is very clear, and the display effect is comparable to that of a real two-dimensional X-ray image, indicating that the method for generating simulated X-ray images in hip joint prosthesis planning provided in this application embodiment can achieve good processing results.

[0174] Please see Figure 11 , Figure 11 This is a flowchart illustrating the third embodiment of the method for generating simulated X-ray images in hip joint prosthesis planning provided in this application. Figure 11 As shown, in some embodiments, the method for generating simulated X-ray images in the hip joint prosthesis planning further includes step S500.

[0175] Step S500: Input the simulated 3D CT image into the ray projection model to obtain a simulated 2D DRR image.

[0176] The prosthesis model is displayed in the simulated two-dimensional DRR image.

[0177] DRR (Digitally Reconstructed Radiograph) is a type of digitally reconstructed radiographic imaging. A DRR image is a two-dimensional projection image obtained by simulating a user's three-dimensional CT scan from a specific viewpoint using a computer. In this way, the results of hip prosthesis planning can be presented to the user on a simulated two-dimensional DRR image for reference, thereby further improving the accuracy of hip prosthesis planning.

[0178] For example, when using the VTK tool library, a simulated 3D CT image is used as the input image of the ResampleImageFilter class. The RayCastInterpolateImageFunction and SetFocalPoint functions are used to place the simulated X-ray source at a preset distance directly in front of the simulated 3D CT image, thereby obtaining a simulated 2D DRR image.

[0179] In some implementations, users can specify an observation location in the simulated 3D CT image where they need to view a simulated 2D DRR image, and then obtain the simulated 2D DRR image corresponding to that observation location using the method of this application.

[0180] In some implementations, in step S500, a specified observation position is determined according to the selection instruction, and then the relevant parameters in the ray projection model are adjusted to obtain a simulated two-dimensional DRR image corresponding to the observation position.

[0181] As described above, in some embodiments, the hip joint prosthesis planning modes include a hip joint offset planning mode and a hip joint length planning mode.

[0182] Optionally, simulated three-dimensional CT images corresponding to the hip joint offset planning mode and the hip joint length planning mode are input into the ray projection model to obtain simulated two-dimensional DRR images corresponding to the hip joint offset planning mode and simulated two-dimensional DRR images corresponding to the hip joint length planning mode.

[0183] Please see Figure 12A and Figure 12B , Figure 12A This is a schematic diagram of the first simulated two-dimensional DRR image provided in the embodiments of this application. Figure 12B This is a schematic diagram of the second simulated two-dimensional DRR image provided in an embodiment of this application. For example... Figure 12A and Figure 12B As shown, the first simulated two-dimensional DRR image 7 and the second simulated two-dimensional DRR image 8 are very clear, and the display effect is comparable to that of the real two-dimensional DRR image, indicating that the method for generating simulated X-ray images in hip joint prosthesis planning provided in this application embodiment can achieve good processing results.

[0184] In summary, the method for generating simulated X-ray images in hip joint prosthesis planning provided in this application has the following advantages:

[0185] 1. By setting the color of all the first voxels in the third image to the color corresponding to the prosthesis model, a fourth image is obtained. Then, the first image, the second image, and the fourth image are synthesized to obtain a simulated three-dimensional CT image. The results of hip joint prosthesis planning can be presented to the user for reference through simulated three-dimensional CT images, thereby improving the accuracy of hip joint prosthesis planning.

[0186] 2. By setting the color of all voxels in each first voxel subset to the color corresponding to the first voxel subset, each sub-prosthesis model can be displayed differently, making it easier for users to determine the accurate position of each sub-prosthesis model based on the simulated 3D CT image obtained from the fourth image, thereby further improving the accuracy of hip joint prosthesis planning.

[0187] 3. By synthesizing the corresponding first, second, and fourth images under each hip joint prosthesis planning mode to obtain simulated 3D CT images, the results of hip joint prosthesis planning under each mode can be presented to the user for reference through simulated 3D CT images, thereby further improving the accuracy of hip joint prosthesis planning.

[0188] 4. By generating simulated two-dimensional DRR images, the results of hip joint prosthesis planning can be presented to users for reference on simulated two-dimensional DRR images, thereby further improving the accuracy of hip joint prosthesis planning.

[0189] Please see Figure 13 , Figure 13 This is a schematic diagram of the device for generating simulated X-ray images in hip joint prosthesis planning provided in an embodiment of this application. Figure 13 As shown, the device 300 for generating simulated X-ray images in hip joint prosthesis planning includes an acquisition module 310 and a processing module 320.

[0190] In some implementations, the acquisition module 310 is used to acquire three-dimensional CT images of the left femoral model, the right femoral model, and the target object.

[0191] In some implementations, the processing module 320 processes the three-dimensional CT images based on the left femoral model and the right femoral model to obtain a first image showing only the left femoral bone of the target object, a second image showing only the right femoral bone of the target object, and a third image not showing the left and right femoral bones. After hip joint prosthesis planning, based on the coordinates of each voxel in the third image in the three-dimensional coordinate system and the coordinates of each vertex on the surface of the prosthesis model in the three-dimensional coordinate system, all first voxels located inside the prosthesis model in the third image are determined, and the color of all first voxels in the third image is set to the color corresponding to the prosthesis model to obtain a fourth image, wherein the prosthesis model is composed of multiple vertices. The first image, the second image, and the fourth image are synthesized to obtain a simulated three-dimensional CT image.

[0192] Please see Figure 14 , Figure 14 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. For example... Figure 14 As shown, the electronic device 400 includes: one or more processors 410 and a memory 420. Figure 14 Take a processor 410 as an example.

[0193] In some implementations, the processor 410 and the memory 420 may be connected via a bus or other means. Figure 14 Taking the example of a connection between China and Israel via a bus.

[0194] In some embodiments, the processor 410 is configured to acquire three-dimensional CT images of a left femoral model, a right femoral model, and a target object; process the three-dimensional CT images based on the left and right femoral models to obtain a first image showing only the left femoral part of the target object, a second image showing only the right femoral part of the target object, and a third image not showing the left and right femoral parts; after planning the hip joint prosthesis, determine all first voxels located inside the prosthesis model in the third image based on the coordinates of each voxel in the third image in the three-dimensional coordinate system and the coordinates of each vertex on the surface of the prosthesis model in the three-dimensional coordinate system, and set the color of all first voxels in the third image to the color corresponding to the prosthesis model to obtain a fourth image, wherein the prosthesis model is composed of multiple vertices; synthesize the first image, the second image, and the fourth image to obtain a simulated three-dimensional CT image.

[0195] In some embodiments, memory 420 serves as a non-volatile computer-readable storage medium, used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules for the method of generating simulated X-ray images in hip joint prosthesis planning according to the embodiments of this application. Processor 410 executes various functional applications and data processing of electronic device 400 by running the non-volatile software programs, instructions, and modules stored in memory 420, thereby implementing the method for generating simulated X-ray images in hip joint prosthesis planning according to the above-described method embodiments.

[0196] In some embodiments, memory 420 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of electronic device 400, etc. Furthermore, memory 420 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 420 may optionally include memory remotely located relative to processor 410, and this remote memory may be connected to the controller via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0197] In some implementations, one or more modules are stored in memory 420 and, when executed by one or more processors 410, perform the method for generating simulated X-ray images in hip joint prosthesis planning as described in any of the above method embodiments, for example, performing the above-described... Figure 1 The method steps S100 to S400.

[0198] Please refer to Figure 15 , Figure 15This is a structural block diagram of a computer-readable storage medium provided in an embodiment of this application. The computer-readable storage medium 500 stores program code 510, which can be called by a processor to execute the method for generating simulated X-ray images in hip joint prosthesis planning as described in the above method embodiments.

[0199] The computer-readable storage medium 500 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium includes a non-volatile computer-readable storage medium. The computer-readable storage medium 500 has storage space for program code that performs any of the method steps in the method for generating simulated X-ray images in the hip joint prosthesis planning described above. This program code can be read from or written to one or more computer program products. The program code may, for example, be compressed in a suitable form.

[0200] In some embodiments, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method for generating simulated X-ray images in hip joint prosthesis planning.

[0201] In summary, this application provides a method and electronic device for generating simulated X-ray images in hip joint prosthesis planning. The method for generating simulated X-ray images in hip joint prosthesis planning includes: acquiring three-dimensional CT images of a left femoral model, a right femoral model, and a target object; processing the three-dimensional CT images based on the left and right femoral models to obtain a first image showing only the left femoral part of the target object, a second image showing only the right femoral part of the target object, and a third image not showing the left and right femoral parts; after hip joint prosthesis planning, determining all first voxels located inside the prosthesis model in the third image based on the coordinates of each voxel in the third image in the three-dimensional coordinate system and the coordinates of each vertex on the surface of the prosthesis model in the three-dimensional coordinate system, and setting the color of all first voxels in the third image to the color corresponding to the prosthesis model to obtain a fourth image, wherein the prosthesis model is composed of multiple vertices; and synthesizing the first image, the second image, and the fourth image to obtain a simulated three-dimensional CT image. This application obtains a fourth image by setting the color of all first voxels in the third image to the color corresponding to the prosthesis model, and then synthesizes the first image, the second image and the fourth image to obtain a simulated three-dimensional CT image. This allows the results of hip joint prosthesis planning to be presented to the user for reference through simulated three-dimensional CT images, thereby improving the accuracy of hip joint prosthesis planning.

[0202] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for generating simulated X-ray images in hip joint prosthesis planning, characterized in that, include: Acquire 3D CT images of the left femur model, the right femur model, and the target object; The three-dimensional CT images are processed based on the left femur model and the right femur model to obtain a first image that only shows the left femur of the target object, a second image that only shows the right femur of the target object, and a third image that does not show the left and right femurs. The first image, the second image, and the third image are all three-dimensional images. After hip joint prosthesis planning, based on the coordinates of each voxel in the third image in the three-dimensional coordinate system and the coordinates of each vertex on the surface of the prosthesis model in the three-dimensional coordinate system, all first voxels located inside the prosthesis model in the third image are determined, and the color of all first voxels in the third image is set to the color corresponding to the prosthesis model, resulting in a fourth image. The prosthesis model is composed of multiple vertices. A third ray is generated using one voxel in the third image as the endpoint. When the number of intersections between the third ray and the surface of the prosthesis model is odd, the voxel is determined to be inside the prosthesis model and identified as the first voxel. When the number of intersections between the third ray and the surface of the prosthesis model is even, the voxel is determined to be outside the prosthesis model. The first image, the second image, and the fourth image are combined to obtain a simulated three-dimensional CT image.

2. The method for generating simulated X-ray images in hip joint prosthesis planning according to claim 1, characterized in that, The process of processing the three-dimensional CT image based on the left femur model and the right femur model to obtain a first image showing only the left femur of the target object, a second image showing only the right femur of the target object, and a third image not showing the left and right femurs includes: The three-dimensional CT image is cropped based on the left femoral model or the right femoral model to obtain the cropped three-dimensional CT image; Based on the left femur model and the right femur model, the cropped three-dimensional CT image is processed to obtain a first image showing only the left femur of the target object, a second image showing only the right femur of the target object, and a third image showing neither the left nor the right femur.

3. The method for generating simulated X-ray images in hip joint prosthesis planning according to claim 2, characterized in that, The step of cropping the three-dimensional CT image based on the left femoral model or the right femoral model to obtain the cropped three-dimensional CT image includes: The principal axis of the model is determined based on the coordinates of each vertex on the left femur model or the right femur model; A point on the main axis that is close to the first endpoint of the main axis and whose distance from the first endpoint is a preset ratio multiplied by the length of the main axis is selected as the first calculation point, wherein the physiological position of the first endpoint is close to the pelvis of the target object; The three-dimensional CT image is cropped by a plane that passes through the first calculation point and is parallel to the horizontal plane of the three-dimensional spatial coordinate system, thus obtaining the cropped three-dimensional CT image.

4. The method for generating simulated X-ray images in hip joint prosthesis planning according to any one of claims 1-3, characterized in that, Both the left femur model and the right femur model are composed of multiple vertices. The processing of the 3D CT image based on the left femur model and the right femur model to obtain a first image showing only the left femur of the target object, a second image showing only the right femur of the target object, and a third image not showing either the left or right femur includes: Based on the coordinates of each voxel in the three-dimensional CT image in the three-dimensional spatial coordinate system and the coordinates of each vertex on the surface of the left femur model in the three-dimensional spatial coordinate system, determine all second voxels located inside the left femur model in the three-dimensional CT image; The first image is obtained by setting the colors of all voxels in the three-dimensional CT image except the second voxel to a preset background color. Based on the coordinates of each voxel in the three-dimensional CT image in the three-dimensional spatial coordinate system and the coordinates of each vertex on the surface of the right femur model in the three-dimensional spatial coordinate system, all third voxels located inside the right femur model in the three-dimensional CT image are determined. The second image is obtained by setting the colors of all voxels in the 3D CT image except for the third voxel to the background color. The third image is obtained by setting the colors of all the second and third voxels in the three-dimensional CT image to the background color.

5. The method for generating simulated X-ray images in hip joint prosthesis planning according to claim 1, characterized in that, After planning the hip joint prosthesis, based on the coordinates of each voxel in the third image in a three-dimensional coordinate system and the coordinates of each vertex on the surface of the prosthesis model in a three-dimensional coordinate system, all first voxels located inside the prosthesis model in the third image are determined, and the colors of all first voxels in the third image are set to the colors corresponding to the prosthesis model. Before obtaining the fourth image, the method further includes: Obtain the first position transformation matrix of the left femoral model, the second position transformation matrix of the right femoral model, and the third position transformation matrix of the pelvic model after hip joint prosthesis planning; The first position transformation matrix is ​​multiplied by the first image to move the first image so that the position of the first image corresponds to the position of the left femoral model after hip joint prosthesis planning; The second position transformation matrix is ​​multiplied by the second image to move the second image so that the position of the second image corresponds to the position of the right femur model after hip joint prosthesis planning; The third position transformation matrix is ​​multiplied by the third image to move the third image so that the position of the third image corresponds to the position of the pelvic model after hip joint prosthesis planning.

6. The method for generating simulated X-ray images in hip joint prosthesis planning according to claim 1, characterized in that, The prosthesis model includes multiple sub-prosthesis models. After hip joint prosthesis planning, based on the coordinates of each voxel in the third image in the three-dimensional coordinate system and the coordinates of each vertex on the surface of the prosthesis model in the three-dimensional coordinate system, all first voxels located inside the prosthesis model in the third image are determined, and the color of all first voxels in the third image is set to the color corresponding to the prosthesis model, resulting in a fourth image, including: After hip joint prosthesis planning, based on the coordinates of each voxel in the third image in the three-dimensional coordinate system and the coordinates of each vertex on the surface of each sub-prosthesis model in the three-dimensional coordinate system, a first voxel subset located inside each sub-prosthesis model in the third image is determined, resulting in multiple first voxel subsets. The fourth image is obtained by setting the color of all voxels in each of the first voxel subsets to the color corresponding to the first voxel subset.

7. The method for generating simulated X-ray images in hip joint prosthesis planning according to claim 1, characterized in that, The hip joint prosthesis planning modes include a hip joint offset planning mode and a hip joint length planning mode. After hip joint prosthesis planning, based on the coordinates of each voxel in the third image in the three-dimensional coordinate system and the coordinates of each vertex on the surface of the prosthesis model in the three-dimensional coordinate system, all first voxels located inside the prosthesis model in the third image are determined, and the colors of all first voxels in the third image are set to the colors corresponding to the prosthesis model, resulting in a fourth image, including: After hip joint prosthesis planning, based on the coordinates of each voxel in the third image in the three-dimensional coordinate system and the coordinates of each vertex on the surface of the prosthesis model in the three-dimensional coordinate system in the hip joint offset planning mode, all first voxels located inside the prosthesis model in the third image are determined, and the color of all first voxels in the third image is set to the color corresponding to the prosthesis model, thus obtaining a fourth image corresponding to the hip joint offset planning mode. Based on the coordinates of each voxel in the third image in the three-dimensional coordinate system and the coordinates of each vertex on the surface of the prosthesis model in the three-dimensional coordinate system in the hip joint length planning mode, all first voxels located inside the prosthesis model in the third image are determined, and the color of all first voxels in the third image is set to the color corresponding to the prosthesis model, thus obtaining a fourth image corresponding to the hip joint length planning mode.

8. The method for generating simulated X-ray images in hip joint prosthesis planning according to claim 1, characterized in that, The process of synthesizing the first image, the second image, and the fourth image to obtain a simulated three-dimensional CT image includes: The first image is resampled based on the first image and the fourth image so that the size of the first image is the same as the size of the fourth image. The second image is resampled based on the second image and the fourth image so that the size of the second image is the same as the size of the fourth image; The simulated three-dimensional CT image is obtained by adding the first image, the second image, and the fourth image together.

9. The method for generating simulated X-ray images in hip joint prosthesis planning according to claim 1, characterized in that, The method further includes: The simulated three-dimensional CT image is input into the ray projection model to obtain a simulated two-dimensional DRR image, in which the prosthesis model is displayed.

10. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method for generating simulated X-ray images in hip prosthesis planning as described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Image processing method and device, electronic equipment and storage medium

    CN114299177A

  • Pre-operative planning for reorientation surgery: surface-model-free approach using simulated x-rays

    US20200197096A1