Method for simulating imaging effect of X-ray film by using CT (Computed Tomography) image in prosthesis planning
By setting the voxel value range in the CT image and rendering the prosthetic model with a three-dimensional volume drawing mapper, a simulated X-ray imaging effect is generated, which solves the problem of information splitting between the CT image and the X-ray film, and improves the efficiency and accuracy of prosthetic implantation planning.
Patent Information
- Application Number
- CN202510916324.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-03
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-07-03
AI Technical Summary
In the prior art, the prosthetic implant planning results on CT three-dimensional images cannot be directly mapped to the two-dimensional X-rays commonly used by doctors, resulting in doctors requiring repeated comparisons between CT and X-rays, which reduces the efficiency of diagnosis and surgical planning and may cause errors.
By setting the voxel value range of the prosthetic implant area in the CT image, the prosthetic model is placed at the position to be implanted in the CT image, and rendered using a three-dimensional body drawing mapper to generate a simulated X-ray imaging effect. The accumulation mixing mode of the three-dimensional body drawing mapper provided by the VTK library is used for transparent superposition to realize three-dimensional rendering of the CT image and the prosthetic model.
While retaining the accuracy of CT three-dimensional planning, it realizes that the placement effect of the prosthesis is verified through familiar two-dimensional X-ray views, reducing the operating burden and artificial error risks, improving the efficiency of surgical planning, and meeting the needs of clinical real-time and multi-angle image acquisition.
Smart Images

Figure CN120392291A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and particularly to a method for simulating the imaging effect of X-ray films using CT images in prosthesis planning. Background Art
[0002] X-ray film is a medical imaging technology that uses X-rays to penetrate human tissues and form images on films. It shows the internal structure of the human body through different absorption degrees of the rays and is commonly used to examine bones, joints, and some soft tissue lesions. Its advantages are rapid imaging, low cost, and relatively small radiation dose, making it suitable for the preliminary diagnosis of fractures, joint dislocations, etc. However, the imaging of X-ray films is two-dimensional, making it difficult to clearly display complex anatomical structures or overlapping parts.
[0003] CT (Computed Tomography) is a technology that scans the human body at different angles with X-rays and combines computer processing to generate three-dimensional images. Compared with traditional X-ray films, CT images can more clearly show the details and internal structures of tissues and are suitable for examining complex fractures, tumors, brain lesions, internal organs, and blood vessels. Its advantages are high resolution and accurate imaging, but its radiation dose is higher and the cost is higher than that of X-ray films. Therefore, it is usually used in more complex or detailed diagnostic scenarios.
[0004] Because the high resolution and three-dimensional imaging of CT images can provide accurate anatomical information, planning orthopedic prosthesis implantation surgery on CT images can facilitate the formulation of personalized treatment plans. However, in specific practices, due to the more widespread use of X-ray films, doctors often combine CT images with traditional two-dimensional X-ray films to formulate surgical plans in order to more comprehensively evaluate the patient's condition and confirm the accuracy of prosthesis placement.
[0005] The three-dimensional images provided by CT can accurately show the relative positional relationship between the bone tissue structure and the prosthesis to be implanted, which is the main tool for prosthesis planning. However, the planning results on it cannot be directly mapped to the two-dimensional X-ray films commonly used by doctors. This information gap increases the workload of doctors, requiring them to repeatedly compare between CT and X-ray films to infer the corresponding positions of the prosthesis on the two-dimensional X-ray images, which not only reduces the efficiency of diagnosis and surgical planning but also may cause errors and affect the treatment effect. Summary of the Invention
[0006] The present invention proposes a method for simulating the imaging effect of X-ray films using CT images in prosthesis planning, which solves the problem in the prior art that the prosthesis implantation planning results on CT three-dimensional images cannot be directly mapped to the two-dimensional X-ray films commonly used by doctors, resulting in doctors having to repeatedly compare between CT and X-ray films to infer the corresponding positions of the prosthesis on the two-dimensional X-ray images, not only reducing the efficiency of diagnosis and surgical planning but also possibly causing errors and affecting the treatment effect.
[0007] The technical solution of the present invention is realized as follows: The present invention provides a method for simulating the imaging effect of an X-ray film using CT images in prosthesis planning, including the following steps: Set the voxel value range of the prosthesis implantation area in the CT image; Place the prosthesis model at the position to be implanted in the CT image; Assign corresponding voxel values to the prosthesis model based on the set voxel value range; Configure corresponding opacities for the CT image and the prosthesis model based on the voxel values, and use a three-dimensional volume rendering mapper to perform three-dimensional rendering on the CT image and the prosthesis model to obtain a CT image simulating the imaging effect of an X-ray film.
[0008] Specifically, the method for setting the voxel value range of the prosthesis implantation area in the CT image includes: Reconstruct a three-dimensional bone model based on the patient's CT image; Randomly sample the voxel values of n points in the CT image that fall inside the three-dimensional bone model; Sort the voxel values of the n points in ascending order; Take the average value of the voxel values of several points with the front rank in the sorting as the lower limit value of the voxel value, and take the average value of the voxel values of several points with the rear rank in the sorting as the upper limit value of the voxel value.
[0009] Specifically, the method for placing the prosthesis model at the position to be implanted in the CT image is: In the preoperative planning stage, in the MPR viewing mode of the CT image, import and move the prosthesis model to ensure that regardless of observing from the coronal view, axial view or sagittal view of the CT image, the rotation center of the prosthesis model is at the center of the position to be implanted, and the anteversion angle of the prosthesis model is 5° to 25°, and the abduction angle is 30° to 50°.
[0010] Specifically, the method for assigning corresponding voxel values to the prosthesis model includes the following steps: Generate an axial bounding box of the prosthesis model; Fill the axial bounding box with voxels of the same size as the CT image voxels; Traverse all the voxels in the axial bounding box, set the voxel values of the voxels located inside the prosthesis model to H , and set the voxel values of the voxels located outside the prosthesis model to L - H ; where H , L are respectively the upper limit value and the lower limit value of the preset voxel value range.
[0011] Specifically, the method for configuring the corresponding opacity based on the voxel values for the CT image and the prosthesis model is as follows: Establish a voxel value-opacity transfer function as follows: ; ; Wherein, is the opacity, V is the voxel value; H and L are respectively the upper limit value and the lower limit value of the preset voxel value range, I is the preset opacity.
[0012] Furthermore, when performing 3D rendering on the CT image I the value of I is greater than the value of
[0013] when performing 3D rendering on the prosthesis model. I When performing 3D rendering on the CT image, the value of I is 0.2 ± 0.05; when performing 3D rendering on the prosthesis model, the value of
[0014] is 0.02 ± 0.005. Specifically, the 3D rendering of the CT image and the prosthesis model is performed using the accumulation blending mode of the 3D volume rendering mapper provided by the VTK library, forming a transparent overlay effect of the CT image and the prosthesis model from a specified perspective.
[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: (1) By directly converting the 3D CT data and the prosthesis planning information into a 3D image simulating the effect of a 2D X-ray film through an efficient volume rendering technique, the present invention allows doctors to verify the prosthesis placement effect through a familiar 2D X-ray view while retaining the 3D planning accuracy of the CT; doctors do not need to repeatedly compare between the CT and the X-ray film, reducing the operation burden and the risk of human error; improving the surgical planning efficiency, shortening the preoperative preparation time, and optimizing the allocation of medical resources; (2) The simulation result of the present invention is essentially a volume rendering projection of 3D data. By simply adjusting the camera perspective in the 3D space of the 3D volume rendering mapper, X-ray films at different angles can be dynamically generated, thus meeting the doctors' needs for viewing films from different perspectives; there is no need to recalculate the prosthesis position or call an additional algorithm, significantly simplifying the process of obtaining multi-angle images; (3) By directly rendering the 3D data through the accumulation blending mode of the VTK 3D volume rendering mapper and leveraging the high computational efficiency of the volume rendering technique, the present invention can quickly generate simulated X-ray films to meet the clinical real-time requirements. Description of the Drawings
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0017] Figure 1 It is a schematic flowchart of a method for simulating the imaging effect of an X-ray film using a CT image in the prosthesis planning of the present invention; Figure 2 It is an effect diagram of placing the acetabular cup prosthesis model into the position of the native acetabular fossa in the CT image in the embodiment of the present invention; Figure 3 It is an effect diagram after assigning voxel values to the acetabular cup prosthesis model in the embodiment of the present invention; Figure 4 It is a schematic diagram of the voxel value-opacity transfer function in the embodiment of the present invention; Figure 5 It is an effect diagram of simulating an X-ray film using a CT image in the embodiment of the present invention; Figure 6 It is an effect diagram of the X-ray film from other perspectives obtained after moving the camera view in the three-dimensional space in the embodiment of the present invention. Specific embodiments
[0018] The following will clearly and completely describe the technical solutions of the present invention in combination with the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0019] Refer to Figure 1 , the present invention provides a method for simulating the imaging effect of an X-ray film using a CT image in prosthesis planning, including the following steps: Step 1, set the voxel value range of the prosthesis implantation area in the CT image, specifically including the following steps: Step 101, reconstruct the three-dimensional bone model based on the patient's CT image; Step 102, randomly sample the voxel values of n (in this embodiment, n is not less than 200, and the specific quantity can be flexibly adjusted according to the actual situation) points falling inside the three-dimensional bone model in the CT image; Step 103, sort the voxel values of the n points in ascending order; Step 104, take the average of the voxel values of several points with the highest rankings (in this embodiment, take the top 5% of the points, and the specific number can be flexibly adjusted according to the actual situation) as the lower limit value L of the voxel value, and take the average of the voxel values of several points with the lowest rankings (in this embodiment, take the bottom 5% of the points, and the specific number can be flexibly adjusted according to the actual situation) as the upper limit value H of the voxel value.
[0020] In this embodiment, a deep learning method (such as U-Net) can be used to reconstruct a three-dimensional bone model based on the patient's CT images (this method is a prior art). The general process is as follows: Input: The patient's CT sequence in DICOM format (slice thickness ≤ 1 mm); Preprocessing: Normalize the CT images (map the voxel values to [0, 1]) and resample (unify the voxel spacing to 1 mm³); Network training: Use a labeled bone mask dataset (such as the public dataset TCIA), the loss function is DiceLoss, and the optimizer is Adam (learning rate 0.001); Output: A binary bone segmentation mask.
[0021] Convert the segmentation mask into a three-dimensional mesh model (this model is a closed three-dimensional surface) through the Marching Cubes algorithm, and the mesh resolution is the same as the original CT voxel spacing.
[0022] Step 2, place the prosthesis model at the implantation position in the CT image. The specific method is as follows: In the preoperative planning stage, load the CT image in a medical imaging software (such as 3D Slicer), enable the multi-planar reconstruction (MPR) mode, import the prosthesis STL model (such as the hip acetabular cup), and adjust the position of the prosthesis model through the interactive translation / rotation tool; in this embodiment, take the hip CT image and the acetabular cup prosthesis model as an example, that is, the CT image is image, and the acetabular cup prosthesis model is implant. Move implant until the rotation center of implant coincides with the center of the native acetabular fossa (error less than 2 mm) when observed from the coronal view (Coronal), axial view (Axial), or sagittal view (Saggital) of image, and the anteversion angle of implant is 5° - 25°, and the abduction angle is 30° - 50°, as Figure 2 shown Figure 2 In, to highlight the hip joint area, the example CT only retains the pelvic part, and the femoral part has been removed. The numerical evaluation indicators of prostheses for different body parts are different, but the essence of preoperative planning is to obtain the relative position relationship between the appropriate prosthesis model and the CT image.
[0023] Step 3, assign corresponding voxel values to the prosthesis model based on the set voxel value range. The specific steps are as follows: Step 301, generate the axial bounding box AABB of the implant. The method is as follows: Calculate the geometric center of the prosthesis STL model, and expand it along the XYZ axes to completely enclose the model. The boundaries are rounded to the CT voxel size.
[0024] Step 302, perform voxelization. The method is as follows: Fill the axial bounding box with voxels of the same size as the image voxels (such as 0.2mm×0.2mm×0.2mm) (create a voxel grid with the same resolution as the CT image within the AABB), and record the three-dimensional image composed of these new voxels as bin; Step 303, traverse all voxels in bin, and set the voxel values of the voxels located inside the implant (judge whether the voxel is inside the prosthesis model by the ray intersection method) to H and set the voxel values of the voxels located outside the prosthesis model to L - H (to avoid confusion with CT values).
[0025] The 3D view, coronal view, axial view, and sagittal view of bin after processing are as shown in Figure 3 ; The inside of the implant refers to the area in space occupied by the prosthesis model, such as the white part in Figure 3 . Generally, the prosthesis is made of high-density materials such as ceramics and metals, and its HU value (voxel value) is close to or higher than the voxel value of bone. Since the highest HU value of the bone area set previously is H, the voxel values of the prosthesis part are also set to H to facilitate the display of the effect of high-density materials in subsequent volume rendering. Similarly, the voxel values of the non-prosthesis part are set to L - H, which is a very small value (such as air) and is hardly displayed in volume rendering.
[0026] Step 4, configure corresponding opacities for the CT image and the prosthesis model based on the voxel values, and use a three-dimensional volume rendering mapper to perform three-dimensional rendering on the CT image and the prosthesis model to obtain a CT image simulating the X-ray film imaging effect. The specific method is as follows: Establish a voxel value-opacity transfer function: ; ; Among them, is the opacity, V is the voxel value; H , L are respectively the upper limit value and the lower limit value of the preset voxel value range, I is the preset maximum opacity, which can be flexibly set according to the actual situation; As Figure 4 shown, combining the above transfer function, it can be seen that the voxel values of the CT image and the prosthesis model in the image are less than or equal to the lower limit value L and the opacity of this part is set to 0, and the voxel values are greater than or equal to the upper limit value H and the opacity of this part is set to I , while for the part where the voxel value is between the lower limit value L and the upper limit value H , there is a linear relationship between the opacity and the voxel value, with a slope of k and an intercept of b .
[0027] In the specific implementation process, when performing 3D rendering on the CT image I the value of I is greater than the value of
[0028] when performing 3D rendering on the prosthesis model I and the value of I is 0.02 ± 0.005 when performing 3D rendering on the prosthesis model
[0029] In this embodiment, when performing 3D rendering on the CT image I the value of I is 0.2 (simulating the gray-scale contrast of bones in X-ray films), and the value of
[0030] In this embodiment, the additive blend mode of the vtkVolumeMapper provided by the VTK library is used to perform 3D rendering on the CT image and the prosthesis model. The ray stepping matches the CT resolution, and the projection angle simulates the X-ray tube-detector geometry of the X-ray machine (such as a source-image distance of 100 cm and orthogonal projection), and a single-channel grayscale image (simulating an X-ray film) is output to form a transparent superposition effect of the CT image and the prosthesis model at a specified viewing angle. The final imaging effect is as Figure 5 shown.
[0031] Medical X-ray imaging is a technology that uses the absorption differences of different tissues (such as bones, muscles, air) in the human body when penetrated by X-rays to form images: high-density tissues (such as bones) absorb more X-rays and appear white, while low-density tissues (such as lungs) absorb less and appear black. The accumulation blending mode of the VTK three-dimensional volume rendering mapper is a three-dimensional data visualization technology based on ray casting. Its core principle is to sample the volume data along the line of sight direction and directly accumulate the opacity values of all sampling points without considering occlusion relationships to form a transparent overlay effect. This method is suitable for scenarios that emphasize weak signals or sparse structures. Considering that the above volume rendering method is very similar to the X-ray imaging principle, the present invention uses the volume rendering of CT data to simulate two-dimensional X-ray films, thus taking into account the reading requirements of both CT and traditional X-ray images.
[0032] Since the X-ray film simulated in this application is actually the volume rendering of a three-dimensional image, the image and bin are still in the three-dimensional space of the VTK three-dimensional volume rendering mapper. During the film reading process, if you want to switch the viewing angle, you only need to move the camera angle in the three-dimensional space of the VTK three-dimensional volume rendering mapper during rendering to obtain the X-ray film effect from other viewing angles, such as Figure 6 shown. This process does not require any additional calculations.
[0033] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A method for simulating the imaging effect of X-ray films using CT images in prosthesis planning, characterized in that, It includes the following steps: Set the voxel value range of the prosthesis implantation area in the CT image; Place the prosthesis model at the position to be implanted in the CT image; Assign corresponding voxel values to the prosthesis model based on the set voxel value range; Configure corresponding opacities for the CT image and the prosthesis model based on the voxel values, and use a 3D volume rendering mapper to perform 3D rendering on the CT image and the prosthesis model to obtain a CT image simulating the X-ray film imaging effect.
2. The method for simulating the imaging effect of an X-ray film using a CT image in prosthesis planning according to claim 1, wherein, The method for setting the voxel value range of the prosthesis implantation area in the CT image includes: Reconstruct the 3D bone model based on the patient's CT image; Randomly sample the voxel values of n points in the CT image that fall inside the 3D bone model; Sort the voxel values of the n points in ascending order; Take the average value of the voxel values of several points with the earliest sorting as the lower limit value of the voxel value, and take the average value of the voxel values of several points with the latest sorting as the upper limit value of the voxel value.
3. A method for simulating the imaging effect of an X-ray film using CT images in prosthesis planning, characterized in that, The method for placing the prosthesis model at the position to be implanted in the CT image is: In the preoperative planning stage, in the MPR viewing mode of the CT image, import and move the prosthesis model to ensure that no matter from the coronal view, axial view or sagittal view of the CT image, the rotation center of the prosthesis model is at the center of the position to be implanted, and the anteversion angle of the prosthesis model is 5° - 25°, and the abduction angle is 30° - 50°.
4. A method for simulating the imaging effect of X-ray films using CT images in prosthesis planning, characterized in that, The method for assigning corresponding voxel values to the prosthesis model includes the following steps: Generate the axial bounding box of the prosthesis model; Fill the axial bounding box with voxels of the same size as the CT image voxels; Traverse all voxels within the axial bounding box, and set the voxel values located inside the prosthesis model to H , and set the voxel values located outside the prosthesis model to L - H ; where H and L are the upper and lower limit values of the preset voxel value range, respectively.
5. The method for simulating the imaging effect of an X-ray film using a CT image in prosthesis planning according to claim 1, characterized in that, The method for configuring corresponding opacities for the CT image and the prosthesis model based on the voxel values is: Establish the following voxel value-opacity transfer function: ; ; Among them, is the opacity, V is the voxel value; H , L are respectively the upper limit value and the lower limit value of the preset voxel value range, I is the preset opacity.
6. A method for simulating the imaging effect of X-ray films using CT images in prosthesis planning, characterized in that, When performing three-dimensional rendering on CT images I has a value greater than when performing three-dimensional rendering on the prosthesis model I 's value.
7. A method for simulating the imaging effect of X-ray films using CT images in prosthesis planning, characterized in that, When performing 3D rendering on CT images, I takes a value of 0.2 ± 0.05; when performing 3D rendering on the prosthesis model, I takes a value of 0.02 ± 0.
005.
8. A method for simulating the imaging effect of X-ray films using CT images in prosthesis planning, characterized in that, Use the accumulation blending mode of the 3D volume rendering mapper provided by the VTK library to perform 3D rendering on the CT image and the prosthesis model to form a transparent overlay effect of the CT image and the prosthesis model at a specified viewing angle.
Citation Information
Patent Citations
Ray tracing volume rendering method based on gradient sampling
CN111080765A
Knee joint replacement operation planning method, device and equipment based on X-ray image and storage medium
CN116019548A
Method for generating simulated X-ray image in hip joint prosthesis planning and electronic equipment
CN119498954A
Method and device for producing three-dimensional image and medical image diagnostic device
JP1998031754A
Three-dimensional image display device for directly making three-dimensional image from projection data of x-ray CT apparatus
JP2004188149A