Method for displaying prosthesis model in x-ray image, electronic device, and storage medium
A method for generating solid two-dimensional images by cropping 3D CT and X-ray images of a prosthesis model at a specified cross section solves the problem of the prosthesis model appearing hollow in X-ray images and improves the accuracy of hip joint prosthesis planning.
Patent Information
- Application Number
- CN202411550279.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2044-11-01
AI Technical Summary
In the existing technology, after the hip joint prosthesis is planned, the prosthesis model appears as a hollow shape in the X-ray image, which makes it difficult for doctors to accurately determine the position and reduces the accuracy of hip joint prosthesis planning.
A method for generating solid two-dimensional images by cropping three-dimensional CT and X-ray images of a prosthetic model at a specified cross section, using selection commands to crop a first image and a three-dimensional CT image at a specified cross section, generating a second and third image, and displaying them simultaneously to help users determine the position of the prosthetic model.
It improves the accuracy of hip joint prosthesis planning, ensuring that the prosthesis model appears as a solid shape in X-ray images, making it easier for users to accurately determine the position and enhancing the accuracy of planning.
Smart Images

Figure CN119446442B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and specifically to a method for displaying a prosthetic model in an X-ray image, an electronic device, and a storage medium. 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 prosthesis planning stage, surgeons typically simulate the placement of the prosthesis on the patient's CT images as a reference for prosthesis installation during surgery. Surgeons often combine this with medical imaging techniques such as CT (Computed Tomography) and DRR (Digitally Reconstructed Radiograph) for further planning assistance.
[0004] However, current preoperative hip prosthesis planning methods generally cannot accurately represent the planned prosthesis model in X-ray images. This is because the prosthesis model is typically a hollow shell structure composed of multiple facets. If the prosthesis model is directly cropped, it will appear as a hollow, closed shape on the X-ray image, often making it difficult for surgeons to accurately determine the prosthesis's position, thus reducing the accuracy of hip prosthesis planning. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this application provides a method, electronic device, and storage medium for displaying a prosthesis model in an X-ray image. This application obtains a second image by cropping a first image at a specified cross section according to a selection instruction, and obtains a third image by cropping a three-dimensional CT image at the specified cross section. The second and third images are then displayed simultaneously, enabling the prosthesis model to be displayed as a solid graphic in a two-dimensional X-ray image. This facilitates users in accurately determining the position of the prosthesis model based on the second and third 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 displaying a prosthetic model in an X-ray image, comprising:
[0008] Acquire 3D CT images of the prosthesis model and the target object;
[0009] A first image enclosing the prosthetic model is generated based on the coordinates of all vertices of the prosthetic model, wherein the prosthetic model is composed of multiple vertices, and the first image is a three-dimensional image;
[0010] The system receives a selection instruction, and according to the selection instruction, it crops the first image at a specified cross section to obtain a second image, and crops the three-dimensional CT image at the specified cross section to obtain a third image, wherein both the second image and the third image are two-dimensional images;
[0011] The second image and the third image are displayed simultaneously, thereby displaying the prosthesis model in a two-dimensional X-ray image.
[0012] In some implementations, generating a first image enclosing the prosthetic model based on the coordinates of all vertices of the prosthetic model includes:
[0013] The enclosing spatial units surrounding the prosthetic model are determined based on the coordinates of all vertices of the prosthetic model;
[0014] Multiple voxels are generated to fill the enclosing space unit based on the preset voxel side length;
[0015] The grayscale values of all voxels in the enclosing spatial unit are set based on the coordinates of each vertex of the prosthetic model and the coordinates of each voxel in the enclosing spatial unit to obtain the first image.
[0016] In some implementations, setting the grayscale values of all voxels of the enclosing spatial unit based on the coordinates of each vertex of the prosthetic model and the coordinates of each voxel of the enclosing spatial unit to obtain the first image includes:
[0017] Based on the coordinates of each vertex of the prosthetic model and the coordinates of each voxel of the enclosing spatial unit, determine all target voxels located inside the prosthetic model in the enclosing spatial unit;
[0018] The gray values of all the target voxels are set to the gray values corresponding to the spoofing model, and the gray values of all voxels in the enclosing space unit except the target voxels are set to the background gray values to obtain the first image.
[0019] In some embodiments, simultaneously displaying the second image and the third image includes:
[0020] Set the color of all pixels representing the prosthetic model in the second image to the color corresponding to the prosthetic model to obtain the updated second image;
[0021] Simultaneously display the updated second image and the third image.
[0022] In some embodiments, the grayscale value of all pixels representing the prosthetic model in the second image is the grayscale value corresponding to the prosthetic model, and the step of setting the color of all pixels representing the prosthetic model in the second image to the color corresponding to the prosthetic model to obtain the updated second image includes:
[0023] Obtain the color mapping information of the prosthesis model;
[0024] Based on the color mapping information, the colors of all pixels in the second image whose grayscale values correspond to the grayscale values of the prosthetic model are set to their corresponding colors to obtain the updated second image.
[0025] In some implementations, the step of setting the color of all pixels in the second image whose grayscale value corresponds to the grayscale value of the prosthetic model to the corresponding color according to the color mapping relationship information, to obtain the updated second image, includes:
[0026] Based on the color mapping relationship information, the colors of all pixels in the second image whose grayscale values are the same as the grayscale values corresponding to the prosthetic model are set to the corresponding colors;
[0027] Based on the color mapping information, all pixels in the second image whose grayscale value is the background grayscale value are set to transparent to obtain the updated second image.
[0028] In some embodiments, the prosthetic model includes multiple sub-prosthetic models, each with a different grayscale value. The step of setting the color of all pixels in the second image whose grayscale value corresponds to the grayscale value of the prosthetic model to the corresponding color based on the color mapping information, to obtain the updated second image, includes:
[0029] For each sub-prosthetic model, according to the color mapping relationship information, the color of all pixels in the second image corresponding to the sub-prosthetic model whose grayscale value is the grayscale value corresponding to the sub-prosthetic model is set to the color corresponding to the sub-prosthetic model, so as to obtain the updated second image.
[0030] In some embodiments, simultaneously displaying the second image and the third image includes:
[0031] Place the layer containing the second image above the layer containing the third image, and display both the second image and the third image simultaneously.
[0032] Secondly, embodiments of this application provide an electronic device, the electronic device comprising:
[0033] At least one processor; and,
[0034] A memory communicatively connected to the at least one processor; wherein,
[0035] The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of displaying a prosthetic model in an X-ray image as described in the first aspect.
[0036] Thirdly, embodiments of this application provide a computer-readable storage medium storing an executable program, which is executed by a processor to implement the method for displaying a prosthetic model in an X-ray image as described in the first aspect.
[0037] This application provides a method, electronic device, and storage medium for displaying a prosthesis model in an X-ray image. This application obtains a second image by cropping a first image at a specified cross section according to a selection instruction, and obtains a third image by cropping a three-dimensional CT image at a specified cross section. The second and third images are then displayed simultaneously. This allows the prosthesis model to be displayed as a solid graphic in a two-dimensional X-ray image, making it easier for users to accurately determine the position of the prosthesis model based on the second and third images, thereby improving the accuracy of hip joint prosthesis planning. Attached Figure Description
[0038] Figure 1 This is a flowchart illustrating the method for displaying a prosthetic model in an X-ray image provided in an embodiment of this application.
[0039] Figure 2 yes Figure 1 A detailed flowchart of step S200.
[0040] Figure 3 This is a schematic diagram of the first display mode of the second and third images provided in the embodiments of this application.
[0041] Figure 4 yes Figure 1 A detailed flowchart of step S400.
[0042] Figure 5 yes Figure 4 A detailed flowchart of step S410.
[0043] Figure 6 This is a schematic diagram of a second display mode of the second and third images provided in the embodiments of this application.
[0044] Figure 7 This is a schematic diagram of a third display mode of the second and third images provided in the embodiments of this application.
[0045] Figure 8This is a schematic diagram of the structure of the display device for the prosthetic model in the X-ray image provided in the embodiments of this application.
[0046] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0047] Figure 10 This is a structural block diagram of a computer-readable storage medium provided in an embodiment of this application. Detailed Implementation
[0048] 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.
[0049] 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.
[0050] This application provides a method, electronic device, and storage medium for displaying a prosthesis model in an X-ray image. By selecting a first image from a specified section according to a selection instruction to obtain a second image, and selecting a three-dimensional CT image from a specified section to obtain a third image, the second and third images are displayed simultaneously. This allows the prosthesis model to be displayed as a solid graphic in a two-dimensional X-ray image, making it easier for users to accurately determine the position of the prosthesis model based on the second and third images, thereby improving the accuracy of hip joint prosthesis planning.
[0051] The method for displaying a prosthetic model in an X-ray image provided in this application will be described in detail below with reference to the accompanying drawings.
[0052] Please see Figure 1 , Figure 1 This is a flowchart illustrating the method for displaying a prosthetic model in an X-ray image according to an embodiment of this application. Figure 1 As shown, the method for displaying the prosthetic model in the X-ray image includes steps S100 to S400.
[0053] Step S100: Obtain 3D CT images of the prosthesis model and the target object.
[0054] A prosthesis model is a three-dimensional model of the prosthesis used in hip reconstruction surgery. A 3D CT image is a three-dimensional image 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.
[0055] In some implementations, the prosthesis model is obtained after the hip joint prosthesis planning is completed. At this point, the prosthesis model is already in the planned position in three-dimensional space.
[0056] Step S200: Generate a first image that surrounds the prosthetic model based on the coordinates of all vertices of the prosthetic model.
[0057] The prosthetic model consists of multiple vertices, and the first image is a three-dimensional image.
[0058] Optionally, the prosthetic model is a mesh model, which consists of multiple polygonal faces, each with multiple vertices.
[0059] In some implementations, a grid data toolkit is used to model and process all models and images in this method.
[0060] Alternatively, grid data toolkits include VTK (Visualization Toolkit), Meshmixer, CloudCompare, ParaView, and MeshLab.
[0061] Optionally, when using the VTK tool library, the surface mesh data for all models is of type vtkPolyData.
[0062] Please see Figure 2 , Figure 2 yes Figure 1 A detailed flowchart of step S200. (See attached diagram.) Figure 2 As shown, in some embodiments, step S200 includes steps S210 to S230.
[0063] Step S210: Determine the bounding space unit that surrounds the prosthetic model based on the coordinates of all vertices of the prosthetic model.
[0064] In some implementations, a bounding box algorithm is used to determine the bounding space units that enclose the prosthetic model.
[0065] Optionally, bounding box algorithms include AABB (axis-aligned bounding box) algorithm, spherical bounding box algorithm, elliptical bounding box algorithm, polygonal bounding box algorithm, quadtree bounding box algorithm, and octree bounding box algorithm, etc.
[0066] In some implementations, the three-dimensional spatial coordinate system includes mutually perpendicular X-axis, Y-axis and Z-axis, and the coordinates of the vertices of the spoof model include X-axis coordinates, Y-axis coordinates and Z-axis coordinates.
[0067] In some implementations, step S210 includes steps (210.1) to (210.2).
[0068] (210.1) Determine the maximum X-axis coordinate X1, minimum X-axis coordinate X2, maximum Y-axis coordinate Y1, minimum Y-axis coordinate Y2, maximum Z-axis coordinate Z1, and minimum Z-axis coordinate Z2 based on the coordinates of all vertices of the prosthetic model.
[0069] (210.2) The cuboid is defined by taking point (X1,Y1,Z1) as a first vertex and point (X2,Y2,Z2) as the opposite vertex of the first vertex of the cuboid, and the cuboid is defined as the enclosing space unit of the dummy model.
[0070] In this case, one side of the cuboid is parallel to one of the coordinate axes of the three-dimensional spatial coordinate system.
[0071] Step S220: Generate multiple voxels that fill the surrounding space unit based on the preset voxel side length.
[0072] In some implementations, a voxel is a cube element, and the side length of the voxel is the same as the side length of the cube element.
[0073] Optionally, the voxel side length can be 0.01 units or more, such as 0.01 units, 0.03 units, 0.05 units, 0.1 units, or 0.2 units. The unit length is the default unit length in a three-dimensional coordinate system.
[0074] In some implementations, when the enclosing space unit is a cuboid, a cuboid is divided into multiple voxels according to a preset voxel side length to generate multiple voxels that fill the enclosing space unit.
[0075] For example, when the enclosing spatial unit is a cuboid, and each side of the cuboid is parallel to a coordinate axis of the three-dimensional spatial coordinate system, the formula for calculating the number of voxels contained in the enclosing spatial unit is:
[0076]
[0077] Where a represents the preset voxel side length, ceil represents rounding up, n1 represents a side of the spatial unit that is parallel to the X-axis and consists of n1 voxels, n2 represents a side of the spatial unit that is parallel to the Y-axis and consists of n2 voxels, n3 represents a side of the spatial unit that is parallel to the Z-axis and consists of n3 voxels, and N represents the number of voxels contained in the spatial unit.
[0078] Step S230: Based on the coordinates of each vertex of the spoofing model and the coordinates of each voxel surrounding the spatial unit, set the grayscale values of all voxels surrounding the spatial unit to obtain the first image.
[0079] In some implementations, step S230 includes steps (230.1) to (230.2).
[0080] (230.1) Determine all target voxels located inside the pseudo model within the enclosing spatial unit based on the coordinates of each vertex of the pseudo model and the coordinates of each voxel of the enclosing spatial unit.
[0081] In some implementations, the coordinates of each vertex of the spoof model and the coordinates of each voxel in the enclosing spatial unit are used to determine whether each voxel in the enclosing spatial unit is inside the spoof model. If so, the voxel is identified as the target voxel inside the spoof model.
[0082] In some implementations, a first ray is generated with a voxel surrounding a spatial unit as its endpoint. If the number of intersections between the first ray and the surface of the prosthetic model is odd, the voxel is determined to be inside the prosthetic model. If the number of intersections is even, the voxel is determined not to be inside the prosthetic model.
[0083] (230.2) Set the gray values of all target voxels to the gray values corresponding to the spoof model, and set the gray values of all voxels except the target voxels in the enclosing space cell to the background gray values to obtain the first image.
[0084] In some implementations, the gray values of all voxels in the surrounding spatial cell are first set to the background gray values, and then the gray values of all target voxels are set to the gray values corresponding to the spoof model.
[0085] In some implementations, when using the VTK tool library, the grayscale values of all voxels in the bounding space cell are first set to the background grayscale values. Then, the spoof model is constructed as an image template of the vtkPolyDataToImageStencil class. The image template and the bounding space cell are input into the vtkImageStencil function. In the vtkImageStencil function, the SetBackgroundValue function is used to set the grayscale values of the background voxels output by the vtkImageStencil function to the grayscale values corresponding to the spoof model. Additionally, the reverse template fetching option of the ReverseStencilOn function is enabled. The output of the vtkImageStencil function is the first image.
[0086] Optionally, the grayscale value corresponding to the prosthesis model is 1.
[0087] Optionally, the background grayscale value is 0.
[0088] By setting the grayscale values of all target voxels to the grayscale values corresponding to the prosthesis model, and setting the grayscale values of all voxels except the target voxels in the enclosing spatial unit to the background grayscale values, the grayscale values of the voxels in the first image will not be changed when the first image is cropped to obtain the second image. Therefore, the grayscale values of all pixels representing the prosthesis model in the second image are the grayscale values corresponding to the prosthesis model, and the grayscale values of all pixels in the background area are the background grayscale values. This allows the prosthesis model to be clearly displayed in the two-dimensional X-ray image, making it easier for users to accurately determine the position of the prosthesis model based on the second and third images, thereby improving the accuracy of hip joint prosthesis planning.
[0089] Step S300: Receive a selection instruction, and according to the selection instruction, capture a first image at a specified section to obtain a second image, and capture a three-dimensional CT image at a specified section to obtain a third image.
[0090] The second and third images are both two-dimensional images.
[0091] In some implementations, users can specify a section in a 3D image from which they want to view a 2D image, which is called the specified section.
[0092] 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.
[0093] In some implementations, when using the VTK tool library, the SetResliceAxes function or the SetResliceAxesDirectionCosines function in the vtkImageReslice class is used to set a specified cross section, and the first image and the 3D CT image are respectively input into it. The output of the vtkImageReslice class are the second image and the third image, respectively.
[0094] It is understandable that the grayscale values of the voxels in the first image are not changed when the second image is obtained by cropping the first image. After performing step (230.2), in the second image obtained at this time, the grayscale values of all pixels representing the prosthesis model are the grayscale values corresponding to the prosthesis model, and the grayscale values of all pixels in the background area are the background grayscale values. In addition, the third image obtained by cropping the 3D CT image is a 2D X-ray image.
[0095] Step S400: Simultaneously display the second and third images to display the prosthesis model in a two-dimensional X-ray image.
[0096] In some implementations, the layer containing the second image is placed above the layer containing the third image, and then the second and third images are displayed simultaneously.
[0097] In some implementations, when using the VTK tool library, the second and third images are rendered in the same vtkRenderWindow using different rendering pipelines (i.e., they use different vtkRenderers). If the number of layers of the vtkRenderer corresponding to the third image is n, then the number of layers of the vtkRenderer corresponding to the second image is set to (n+1) so that the layer containing the second image is placed above the layer containing the third image.
[0098] Please see Figure 3 , Figure 3 This is a schematic diagram of a first display mode of the second and third images provided in the embodiments of this application. For example... Figure 3 As shown, in some embodiments, the layer containing the second image 2 is located above the layer containing the third image 1. In the second image 2, the grayscale values of all pixels in the region 21 displaying the prosthetic model are the grayscale values corresponding to the prosthetic model, which are brighter, while the grayscale values of all pixels in the background region 22 are the background grayscale values, which are darker.
[0099] In some implementations, the second image may be further processed in step S400 to optimize the display effect.
[0100] Please see Figure 4 , Figure 4 yes Figure 1A detailed flowchart of step S400. (See attached diagram.) Figure 4 As shown, in some embodiments, step S400 includes steps S410 to S420.
[0101] Step S410: Set the color of all pixels representing the prosthetic model in the second image to the color corresponding to the prosthetic model to obtain the updated second image.
[0102] As described above, in some embodiments, the grayscale value of the color of all pixels representing the prosthetic model in the second image is the grayscale value corresponding to the prosthetic model.
[0103] Please see Figure 5 , Figure 5 yes Figure 4 A detailed flowchart of step S410. (See attached diagram.) Figure 5 As shown, in some embodiments, step S410 includes steps S411 to S412.
[0104] Step S411: Obtain the color mapping relationship information of the prosthetic model.
[0105] Optionally, the color mapping information of the prosthetic model is used to map all pixels with at least one different grayscale value to different colors respectively.
[0106] For example, color mapping information is used to map all pixels with a grayscale value of 1 to green and all voxels with a grayscale value of 10 to red.
[0107] Optionally, color mapping information is also used to set the transparency of colors.
[0108] Step S412: Based on the color mapping relationship information, set the color of all pixels in the second image whose grayscale value corresponds to the grayscale value of the spoof model to the corresponding color, and obtain the updated second image.
[0109] 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.
[0110] For example, based on the color mapping information, the SetTableValue function binds all pixels in the color transparency mapping table with gray values corresponding to the gray values of the spoof model to green and completely opaque. At this time, the input of the SetTableValue function is (1, 0, 1, 0, 1).
[0111] In some implementations, after binding all colors in the color transparency map table according to the color mapping relationship information, the color transparency map table is applied to the second image to set the color of all pixels in the second image whose grayscale value corresponds to the grayscale value of the spoof model to the corresponding color.
[0112] In some implementations, the color of all pixels in the second image whose grayscale value is the same as the grayscale value of the spoof model is set to the corresponding color according to the color mapping relationship information, and all pixels in the second image whose grayscale value is the same as the background grayscale value are set to transparent according to the color mapping relationship information, thus obtaining the updated second image.
[0113] For example, based on the color mapping information, the SetTableValue function is used to bind pixels with grayscale values of the background grayscale value in the color transparency mapping table to be completely transparent. At this time, the input of the SetTableValue function is (0, 0, 0, 0, 0).
[0114] In some implementations, after binding all colors and transparency in the color transparency mapping table according to the color mapping relationship information, the color transparency mapping table is applied to the second image to set the color of all pixels in the second image whose grayscale value is the grayscale value corresponding to the spoof model to the corresponding color, and to set all pixels in the second image whose grayscale value is the background grayscale value to transparent.
[0115] By setting the color of all pixels in the second image whose grayscale value corresponds to the grayscale value of the prosthesis model to the corresponding color, and by setting all pixels in the second image whose grayscale value corresponds to the background grayscale value to transparent according to the color mapping information, the effect of displaying the prosthesis model in the two-dimensional X-ray image can be optimized, making the prosthesis model more obvious and making it easier for users to accurately determine the position of the prosthesis model based on the second and third images, thereby further improving the accuracy of hip joint prosthesis planning.
[0116] In some implementations, the prosthesis model includes multiple sub-prosthesis models, each with a different grayscale value.
[0117] In some implementations, the prosthesis model includes a pelvic prosthesis model and a femoral prosthesis model.
[0118] 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.
[0119] Optionally, the entire pelvic prosthesis model can be used as a sub-prosthesis model.
[0120] Optionally, the entire femoral prosthesis model can be used as a sub-prosthesis model.
[0121] 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.
[0122] In some implementations, each sub-prosthetic model is displayed differently.
[0123] In some implementations, when the prosthetic model includes multiple sub-prosthetic models, a first image surrounding each sub-prosthetic model is generated based on the coordinates of all vertices of each sub-prosthetic model. Then, each first image is cropped at a specified section to obtain a second image corresponding to each sub-prosthetic model.
[0124] In some implementations, for each sub-prosthetic model, the color of all pixels in the second image corresponding to the sub-prosthetic model whose grayscale value is the same as the grayscale value of the sub-prosthetic model is set to the color of the sub-prosthetic model according to the color mapping relationship information, so as to obtain the updated second image.
[0125] Furthermore, for each sub-prosthetic model, based on the color mapping information, the color of all pixels in the second image corresponding to the sub-prosthetic model whose grayscale value is the same as the grayscale value of the sub-prosthetic model is set to the color of the sub-prosthetic model, and all pixels in the second image whose grayscale value is the same as the background grayscale value are set to transparent. The specific method here refers to steps S411 to S412.
[0126] Step S420: Simultaneously display the updated second and third images.
[0127] In some implementations, the number of second images is one. Please refer to [link / reference needed]. Figure 6 , Figure 6 This is a schematic diagram of a second display mode of the second and third images provided in the embodiments of this application. Figure 6 The dashed box in the image is only used to indicate the position of the second image 2 and does not actually appear in the display. For example... Figure 6 As shown, in some embodiments, in the second image 2, the grayscale value of all pixels in the region 21 displaying the prosthetic model is the green color corresponding to the prosthetic model, while all pixels in the background region 22 are transparent.
[0128] In some implementations, multiple second images are used. In this case, the second and third images corresponding to all sub-prosthetic models are displayed simultaneously, thereby showing all sub-prosthetic models in the two-dimensional X-ray image. In this way, users can accurately determine the position of the sub-prosthetic model in the two-dimensional X-ray image and the relative positions between multiple sub-prosthetic models based on multiple second and third images, thereby further improving the accuracy of hip joint prosthesis planning.
[0129] In some implementations, a preset layer order is obtained, and the layer containing the second image corresponding to each sub-prosthetic model is set according to the preset layer order. This approach further optimizes the display effect, preventing one sub-prosthetic model from being obscured by other sub-prosthetic models, and also meeting different user needs.
[0130] Please see Figure 7 , Figure 7 This is a schematic diagram of a third display mode of the second and third images provided in the embodiments of this application. Figure 7 The dashed box in the image is only used to indicate the position of the second image and does not actually appear in the display. For example... Figure 7 As shown, in some embodiments, region 21 in second image 2 is green, representing the acetabular cup model; region 31 in second image 3 is magenta, representing the ball head model; and region 41 in second image 4 is blue, representing the femoral stem model. All pixels in second images 2, 3, and 4, except for those corresponding to the subprosthetic model, are transparent. The layer containing second image 4 is above the layer containing second image 3, and the layer containing second image 3 is above the layer containing second image 2.
[0131] In some implementations, the display method further includes: receiving a selection display instruction and displaying only the second image corresponding to one or more specified sub-prosthetic models according to the selection display instruction.
[0132] In summary, the method for displaying a prosthetic model in an X-ray image provided in this application has the following advantages:
[0133] 1. By selecting a first image from a specified section according to the selection command, a second image is obtained, and a third image is obtained by selecting a three-dimensional CT image from a specified section. The second and third images are then displayed simultaneously. This allows the prosthesis model to be displayed as a solid graphic in the two-dimensional X-ray image, making it easier for users to accurately determine the position of the prosthesis model based on the second and third images, thereby improving the accuracy of hip joint prosthesis planning.
[0134] 2. By setting the grayscale values of all target voxels to the grayscale values corresponding to the prosthesis model, and setting the grayscale values of all voxels except the target voxels in the enclosing spatial unit to the background grayscale values, the grayscale values of the voxels in the first image will not be changed when the first image is cropped to obtain the second image. Therefore, the grayscale values of all pixels representing the prosthesis model in the second image are the grayscale values corresponding to the prosthesis model, and the grayscale values of all pixels in the background area are the background grayscale values. Subsequently, the prosthesis model can be clearly displayed in the two-dimensional X-ray image, which makes it easier for users to accurately determine the position of the prosthesis model based on the second and third images, thereby improving the accuracy of hip joint prosthesis planning.
[0135] 3. By setting the color of all pixels in the second image whose grayscale value corresponds to the grayscale value of the prosthesis model to the corresponding color, and by setting all pixels in the second image whose grayscale value corresponds to the background grayscale value to transparent according to the color mapping information, the effect of displaying the prosthesis model in the two-dimensional X-ray image can be optimized, making the prosthesis model more obvious and making it easier for users to accurately determine the position of the prosthesis model based on the second and third images, thereby further improving the accuracy of hip joint prosthesis planning.
[0136] 4. By displaying all sub-prosthetic models in a two-dimensional X-ray image, users can accurately determine the position of the sub-prosthetic model in the two-dimensional X-ray image and the relative position between multiple sub-prosthetic models based on multiple second and third images, thereby further improving the accuracy of hip joint prosthesis planning.
[0137] 5. By setting the layer where the second image of each sub-prosthetic model is located according to the preset layer order, the display effect can be further optimized. On the one hand, it can avoid the situation where a sub-prosthetic model is occluded by other sub-prosthetic models, and on the other hand, it can meet different user needs.
[0138] Please see Figure 8 , Figure 8 This is a schematic diagram of the structure of the display device for the prosthetic model in the X-ray image provided in the embodiments of this application. Figure 8 As shown, the display device 300 for the prosthetic model in the X-ray image includes an acquisition module 310 and a processing module 320.
[0139] In some implementations, the acquisition module 310 is used to acquire three-dimensional CT images of the prosthesis model and the target object.
[0140] In some embodiments, the processing module 320 is used to generate a first image surrounding the prosthetic model based on the coordinates of all vertices of the prosthetic model, wherein the prosthetic model is composed of multiple vertices and the first image is a three-dimensional image; receive a selection instruction, and according to the selection instruction, crop the first image at a specified section to obtain a second image, and crop a three-dimensional CT image at the specified section to obtain a third image, wherein both the second image and the third image are two-dimensional images; and simultaneously display the second image and the third image, thereby displaying the prosthetic model in a two-dimensional X-ray image.
[0141] Please see Figure 9 , Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 9 As shown, the electronic device 400 includes: one or more processors 410 and a memory 420. Figure 9 Take a processor 410 as an example.
[0142] In some implementations, the processor 410 and the memory 420 may be connected via a bus or other means. Figure 9 Taking the example of a connection between China and Israel via a bus.
[0143] In some embodiments, the processor 410 is configured to acquire three-dimensional CT images of a prosthesis model and a target object; generate a first image surrounding the prosthesis model based on the coordinates of all vertices of the prosthesis model, wherein the prosthesis model is composed of multiple vertices and the first image is a three-dimensional image; receive a selection instruction, and according to the selection instruction, crop the first image at a specified section to obtain a second image, and crop the three-dimensional CT image at the specified section to obtain a third image, wherein both the second image and the third image are two-dimensional images; and simultaneously display the second image and the third image, thereby displaying the prosthesis model in a two-dimensional X-ray image.
[0144] 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 displaying a prosthetic model in an X-ray image according to 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 displaying a prosthetic model in an X-ray image according to the above-described method embodiments.
[0145] 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.
[0146] 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 displaying a prosthetic model in an X-ray image as described in any of the above method embodiments, for example, performing the above-described method. Figure 1 The method steps S100 to S400.
[0147] Please refer to Figure 10 , Figure 10 This 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 displaying a prosthetic model in an X-ray image as described in the above method embodiments.
[0148] 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 of the method for displaying the prosthetic model in the X-ray image 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.
[0149] 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 displaying a prosthetic model in an X-ray image.
[0150] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium 500, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0151] In summary, this application provides a method, electronic device, and storage medium for displaying a prosthesis model in an X-ray image. The method includes: acquiring three-dimensional CT images of the prosthesis model and a target object; generating a first image enclosing the prosthesis model based on the coordinates of all vertices of the prosthesis model, wherein the prosthesis model is composed of multiple vertices, and the first image is a three-dimensional image; receiving a selection command, cropping the first image at a specified section to obtain a second image according to the selection command, and cropping the three-dimensional CT image at the specified section to obtain a third image, both the second and third images being two-dimensional images; and simultaneously displaying the second and third images, thereby displaying the prosthesis model in a two-dimensional X-ray image. This application, by cropping the first image at a specified section to obtain the second image and the three-dimensional CT image at the specified section to obtain the third image, and then simultaneously displaying the second and third images, enables the prosthesis model to be displayed as a solid graphic in a two-dimensional X-ray image. This facilitates users in accurately determining the position of the prosthesis model based on the second and third images, thereby improving the accuracy of hip joint prosthesis planning.
[0152] 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 displaying a prosthetic model in an X-ray image, characterized in that, include: Acquire 3D CT images of the prosthesis model and the target object; A first image enclosing the prosthetic model is generated based on the coordinates of all vertices of the prosthetic model, wherein the prosthetic model is composed of multiple vertices, and the first image is a three-dimensional image; The step of generating a first image enclosing the prosthetic model based on the coordinates of all vertices of the prosthetic model includes: The enclosing spatial units surrounding the prosthetic model are determined based on the coordinates of all vertices of the prosthetic model; Multiple voxels are generated to fill the enclosing space unit based on the preset voxel side length; Based on the coordinates of each vertex of the prosthetic model and the coordinates of each voxel of the enclosing spatial unit, determine all target voxels located inside the prosthetic model in the enclosing spatial unit; The gray values of all the target voxels are set to the gray values corresponding to the sculpted model, and the gray values of all voxels in the enclosing space unit except the target voxels are set to the background gray values to obtain the first image; The system receives a selection instruction, and according to the selection instruction, it crops the first image at a specified cross section to obtain a second image, and crops the three-dimensional CT image at the specified cross section to obtain a third image, wherein both the second image and the third image are two-dimensional images; The second image and the third image are displayed simultaneously, thereby displaying the prosthesis model in a two-dimensional X-ray image.
2. The method for displaying a prosthetic model in an X-ray image according to claim 1, characterized in that, The simultaneous display of the second image and the third image includes: Set the color of all pixels representing the prosthetic model in the second image to the color corresponding to the prosthetic model to obtain the updated second image; Simultaneously display the updated second image and the third image.
3. The method for displaying a prosthetic model in an X-ray image according to claim 2, characterized in that, In the second image, the grayscale value of all pixels representing the prosthetic model is the grayscale value corresponding to the prosthetic model. The step of setting the color of all pixels representing the prosthetic model in the second image to the color corresponding to the prosthetic model, to obtain the updated second image, includes: Obtain the color mapping information of the prosthesis model; Based on the color mapping information, the colors of all pixels in the second image whose grayscale values correspond to the grayscale values of the prosthetic model are set to their corresponding colors to obtain the updated second image.
4. The method for displaying a prosthetic model in an X-ray image according to claim 3, characterized in that, The step of setting the color of all pixels in the second image whose grayscale value corresponds to the grayscale value of the prosthetic model to the corresponding color according to the color mapping relationship information, to obtain the updated second image, includes: Based on the color mapping relationship information, the colors of all pixels in the second image whose grayscale values are the same as the grayscale values corresponding to the prosthetic model are set to the corresponding colors; Based on the color mapping information, all pixels in the second image whose grayscale value is the background grayscale value are set to transparent to obtain the updated second image.
5. The method for displaying a prosthetic model in an X-ray image according to claim 3 or 4, characterized in that, The prosthetic model includes multiple sub-prosthetic models, each with a different grayscale value. The step of setting the color of all pixels in the second image whose grayscale value corresponds to that of the prosthetic model to the corresponding color based on the color mapping information, to obtain the updated second image, includes: For each sub-prosthetic model, according to the color mapping relationship information, the color of all pixels in the second image corresponding to the sub-prosthetic model whose grayscale value is the grayscale value corresponding to the sub-prosthetic model is set to the color corresponding to the sub-prosthetic model, so as to obtain the updated second image.
6. The method for displaying a prosthetic model in an X-ray image according to claim 1, characterized in that, The simultaneous display of the second image and the third image includes: Place the layer containing the second image above the layer containing the third image, and display both the second image and the third image simultaneously.
7. 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 displaying a prosthetic model in an X-ray image as described in any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores an executable program, which is executed by a processor to implement the method for displaying a prosthetic model in an X-ray image as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Medical image reconstruction method and device, equipment and storage medium
CN113764072A
Method for co-displaying three-dimensional bone reconstruction model and CT (Computed Tomography) slice
CN118365831A