Method of using CT images to simulate X-ray imaging effects in prosthesis planning
By setting the voxel value range in the CT image and using the VTK library's 3D volume rendering mapper to render the prosthesis model, a simulated X-ray imaging effect is generated, which solves the problem that CT 3D images cannot be directly mapped to 2D X-rays and improves the efficiency and accuracy of prosthesis implantation surgery planning.
Patent Information
- Application Number
- CN202510916324.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-03
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2045-07-03
AI Technical Summary
In existing technologies, the prosthesis implantation planning results on 3D CT images cannot be directly mapped to the 2D X-rays commonly used by doctors, which requires doctors to repeatedly compare CT and X-rays, reducing the efficiency of diagnosis and surgical planning and potentially causing errors.
By setting the voxel value range of the prosthesis implantation area in the CT image, the prosthesis model is placed at the position to be implanted in the CT image, and rendered using a 3D volume rendering mapper to generate a simulated X-ray imaging effect, including setting the voxel value range, assigning corresponding voxel values to the prosthesis model, and using the 3D volume rendering mapper of the VTK library for transparent overlay rendering.
It can directly generate simulated two-dimensional X-ray effects while retaining the three-dimensional planning accuracy of CT, reducing the doctor's operating burden and human errors, improving surgical planning efficiency, meeting the needs of reading films from different perspectives, and simplifying the image acquisition process.
Smart Images

Figure CN120392291B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a method for simulating X-ray imaging effects by using CT images in prosthesis planning. Background Art
[0002] X-rays are a medical imaging technique that uses X-rays to penetrate human tissue and form images on film. They reveal internal structures by varying degrees of radiation absorption and are commonly used to examine bones, joints, and certain soft tissue lesions. Their advantages include rapid imaging, low cost, and relatively low radiation dose, making them suitable for preliminary diagnosis of fractures, dislocations, and other problems. However, X-rays are two-dimensional, making it difficult to clearly display complex anatomical structures or overlapping areas.
[0003] Computed tomography (CT) is a technology that uses X-rays to scan the human body at different angles and then combines computer processing to generate three-dimensional images. Compared to traditional X-rays, CT images can more clearly reveal tissue details and internal structures, making them suitable for examining complex fractures, tumors, brain lesions, internal organs, and blood vessels. Its advantages include high resolution and precise imaging, but the radiation dose is higher and the cost is higher than X-rays. Therefore, CT is generally used for more complex or detailed diagnostic scenarios.
[0004] Because CT images offer high resolution and three-dimensional imaging, they can provide precise anatomical information. Planning orthopedic prosthesis implants based on CT images facilitates the development of personalized treatment plans. However, in practice, due to the greater prevalence of X-rays, doctors often combine CT images with traditional two-dimensional X-rays to develop surgical plans, enabling a more comprehensive assessment of the patient's condition and confirming the accuracy of prosthesis placement.
[0005] CT scans provide three-dimensional images that accurately display the relative position of bone tissue structure and the implanted prosthesis, making them a primary tool for prosthesis planning. However, the planning results cannot be directly mapped to the two-dimensional X-rays commonly used by doctors. This information fragmentation increases the workload of doctors, requiring them to repeatedly compare CT scans and X-rays to infer the corresponding position of the prosthesis on the two-dimensional X-ray images. This not only reduces the efficiency of diagnosis and surgical planning, but also may lead to errors and affect treatment effectiveness. Summary of the Invention
[0006] The present invention proposes a method for using CT images to simulate X-ray imaging effects in prosthesis planning. This solves the problem in the existing technology 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. Doctors need to repeatedly compare between CT and X-ray films to infer the corresponding position of the prosthesis on the two-dimensional X-ray image, which not only reduces the efficiency of diagnosis and surgical planning, but also may cause errors and affect the treatment effect.
[0007] The technical solution of the present invention is achieved as follows:
[0008] The present invention provides a method for simulating X-ray imaging effects using CT images in prosthesis planning, comprising the following steps:
[0009] Set the voxel value range of the prosthesis implantation area in the CT image;
[0010] Place the prosthesis model at the location to be implanted in the CT image;
[0011] Assign corresponding voxel values to the prosthesis model based on the set voxel value range;
[0012] Based on the voxel value, the opacity corresponding to the configuration of the CT image and the prosthesis model is configured, and the CT image and the prosthesis model are rendered in three dimensions using a three-dimensional volume rendering mapper to obtain a CT image that simulates the imaging effect of an X-ray film.
[0013] Specifically, the method for setting the voxel value range of the prosthesis implantation area in the CT image includes:
[0014] Reconstruct a three-dimensional bone model based on the patient's CT images;
[0015] Randomly sample the voxel values of n points in the CT image that fall inside the 3D bone model;
[0016] Sort the voxel values of n points in ascending order;
[0017] The average value of the voxel values of several points in the top order is taken as the lower limit of the voxel value, and the average value of the voxel values of several points in the bottom order is taken as the upper limit of the voxel value.
[0018] Specifically, the method for placing the prosthesis model at the position to be implanted in the CT image is as follows:
[0019] During the preoperative planning stage, the prosthesis model was imported and moved in the MPR reading mode of the CT image to ensure that the rotation center of the prosthesis model was at the center of the implantation position, whether viewed from the coronal view, axial view, or sagittal view of the CT image, and the anteversion angle of the prosthesis model was 5° to 25° and the abduction angle was 30° to 50°.
[0020] Specifically, the method of assigning voxel values corresponding to the prosthesis model includes the following steps:
[0021] Generate an axial bounding box of the prosthesis model;
[0022] Fill the axial bounding box with voxels of the same size as the CT image voxels;
[0023] Traverse all voxels within the axial bounding box and set the voxel value inside the prosthesis model to H , set the voxel value outside the prosthesis model to L - H ;in, H 、 L are the upper and lower limits of the preset voxel value range respectively.
[0024] Specifically, the method for configuring the opacity corresponding to the CT image and the prosthesis model based on the voxel value is:
[0025] The voxel value-opacity transfer function is established as follows:
[0026] ;
[0027] ;
[0028] in, is opacity, V is the voxel value; H 、 L are the upper and lower limits of the preset voxel value range, I The default opacity.
[0029] Furthermore, when CT images are rendered in three dimensions I The value is greater than when the prosthesis model is rendered in three dimensions I The value of .
[0030] Furthermore, when CT images are rendered in three dimensions, I The value of is 0.2±0.05; when the prosthesis model is rendered in three dimensions, I The value is 0.02±0.005.
[0031] Specifically, the CT image and the prosthesis model are rendered in three dimensions using the cumulative blending mode of the three-dimensional volume rendering mapper provided by the VTK library, forming a transparent superposition effect of the CT image and the prosthesis model at a specified viewing angle.
[0032] Compared with the prior art, the present invention has the following beneficial effects:
[0033] (1) The present invention directly converts 3D CT data and prosthesis planning information into 3D images that simulate 2D X-ray effects through efficient volume rendering technology. This allows doctors to verify the prosthesis placement effect through familiar 2D X-ray views while retaining the 3D planning accuracy of CT. Doctors do not need to repeatedly compare CT and X-rays, reducing the operational burden and the risk of human error. This improves surgical planning efficiency, shortens preoperative preparation time, and optimizes the allocation of medical resources.
[0034] (2) The simulation results of the present invention are essentially volume rendering projections of three-dimensional data. X-rays at different angles can be dynamically generated by simply adjusting the camera perspective in the three-dimensional space of the three-dimensional volume rendering mapper, thereby meeting the doctor's reading needs at different perspectives. There is no need to recalculate the prosthesis position or call additional algorithms, which significantly simplifies the multi-angle image acquisition process.
[0035] (3) The present invention directly renders three-dimensional data through the cumulative blending mode of the VTK three-dimensional volume rendering mapper. With the help of the high computational efficiency of volume rendering technology, simulated X-rays can be quickly generated to meet clinical real-time requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0037] Figure 1 A schematic flow chart of a method for simulating X-ray imaging effects using CT images in prosthesis planning according to the present invention;
[0038] Figure 2 This is a rendering of the acetabular cup prosthesis model placed in the native acetabular fossa position in a CT image according to an embodiment of the present invention;
[0039] Figure 3 This is an effect diagram after assigning voxel values to the acetabular cup prosthesis model in an embodiment of the present invention;
[0040] Figure 4 is a schematic diagram of a voxel value-opacity transfer function according to an embodiment of the present invention;
[0041] Figure 5 This is an effect diagram of using CT images to simulate X-ray films in an embodiment of the present invention;
[0042] Figure 6 These are X-ray film renderings at other viewing angles obtained by moving the camera viewing angle in three-dimensional space in an embodiment of the present invention. DETAILED DESCRIPTION
[0043] The following will clearly and completely describe the technical solutions of the present invention in conjunction with the embodiments of the present invention. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention.
[0044] Reference Figure 1The present invention provides a method for simulating X-ray imaging effects using CT images in prosthesis planning, comprising the following steps:
[0045] Step 1: Setting the voxel value range of the prosthesis implantation area in the CT image, specifically including the following steps:
[0046] Step 101, reconstructing a three-dimensional skeleton model based on the patient's CT image;
[0047] Step 102 , randomly sampling the voxel values of n (in this embodiment, n is not less than 200, and the specific number can be flexibly adjusted according to actual conditions) points in the CT image that fall within the three-dimensional bone model;
[0048] Step 103, sorting the voxel values of the n points in ascending order;
[0049] In step 104, the average voxel value of a number of points ranked at the top (in this embodiment, the top 5% of the points are taken, and the specific number can be flexibly adjusted according to actual conditions) is taken as the voxel value lower limit L, and the average voxel value of a number of points ranked at the bottom (in this embodiment, the bottom 5% of the points are taken, and the specific number can be flexibly adjusted according to actual conditions) is taken as the voxel value upper limit H.
[0050] In this embodiment, a deep learning method (such as U-Net) can be used to reconstruct a 3D bone model based on the patient's CT images (this method is an existing technology). The general process is as follows:
[0051] Input: Patient CT series in DICOM format (slice thickness ≤ 1 mm);
[0052] Preprocessing: CT images were normalized (voxel values were mapped to [0, 1]) and resampled (voxel spacing was unified to 1 mm³);
[0053] Network training: Use a well-labeled skeleton mask dataset (such as the public dataset TCIA), the loss function is DiceLoss, and the optimizer is Adam (learning rate 0.001);
[0054] Output: Binarized bone segmentation mask.
[0055] The segmentation mask is converted into a three-dimensional mesh model (a closed three-dimensional surface) using the Marching Cubes algorithm, and the mesh resolution is consistent with the original CT voxel spacing.
[0056] Step 2: Place the prosthesis model at the location to be implanted in the CT image. The specific steps are as follows:
[0057] In the preoperative planning stage, CT images are loaded into medical imaging software (such as 3D Slicer), multi-planar reconstruction (MPR) mode is enabled, and the prosthetic STL model (such as hip acetabulum) is imported. The position of the prosthetic model is adjusted through the interactive translation / rotation tool. In this embodiment, a hip CT image and an acetabulum prosthesis model are taken as an example, that is, the CT image is the image, and the acetabulum prosthesis model is the implant. The implant is moved until the rotation center of the implant coincides with the center of the native acetabulum (with an error of less than 2 mm) regardless of whether it is observed from the coronal view (Coronal), axial view (Axial) or sagittal view (Saggital) of the image, and the anteversion angle of the implant is 5° to 25°, and the abduction angle is 30° to 50°, as shown in FIG. Figure 2 As shown, Figure 2 In this example, to highlight the hip joint, only the pelvis is retained in the CT scan; the femur has been removed. Numerical evaluation metrics for prostheses vary for different body parts, but preoperative planning essentially aims to determine the appropriate relative position between the prosthesis model and the CT image.
[0058] Step 3: assign voxel values corresponding to the prosthesis model based on the set voxel value range. The specific steps are as follows:
[0059] Step 301: Generate the axial bounding box AABB of the implant as follows:
[0060] The geometric center of the prosthesis STL model was calculated and extended along the X, Y, and Z axes to completely surround the model, with the boundaries rounded to the CT voxel size.
[0061] Step 302, voxelization processing, the method is as follows:
[0062] Fill the axial bounding box with voxels of the same size as the image voxels (e.g., 0.2 mm × 0.2 mm × 0.2 mm) (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 a bin;
[0063] Step 303, traverse all voxels in the bin, and set the voxel value inside the implant (using the ray intersection method to determine whether the voxel is inside the implant model) to H , set the voxel value outside the prosthesis model to L - H (Avoid confusion with CT value).
[0064] The 3D view, coronal view, axial view and sagittal view of the bin after processing are as follows Figure 3 As shown; the implant interior refers to the area in space occupied by the prosthesis model, such as Figure 3The white part in the figure; prostheses are generally made of high-density materials such as ceramics and metals, and their HU values (voxel values) are close to or higher than the voxel values of bones. Since the highest HU value of the bone area is set to H, the voxel value of the prosthesis is also set to H to facilitate the display of the high-density material effect in subsequent volume mapping; similarly, the voxel value of the non-prosthesis part is set to LH, which is very small (such as air) and is almost not displayed in volume mapping.
[0065] Step 4: Based on the voxel values, the opacity corresponding to the CT image and the prosthesis model is configured. A 3D volume rendering mapper is used to render the CT image and the prosthesis model in 3D to obtain a CT image that simulates the imaging effect of an X-ray film. The specific method is as follows:
[0066] Create a voxel value-opacity transfer function:
[0067] ;
[0068] ;
[0069] in, is opacity, V is the voxel value; H 、 L are the upper and lower limits of the preset voxel value range, I It is the preset maximum opacity, which can be flexibly set according to actual conditions;
[0070] like Figure 4 As shown, combined with the above transfer function, it can be seen that the voxel value of the CT image and the prosthesis model in the image is less than or equal to the lower limit value L The opacity of the part is set to 0, the voxel value is greater than or equal to the upper limit H The partial opacity is set to I , and the voxel value is at the lower limit L and upper limit value H In the part between, the opacity and the voxel value are linearly related, with a slope of k , the intercept is b .
[0071] In the specific implementation process, when performing three-dimensional rendering of CT images I The value is greater than when the prosthesis model is rendered in three dimensions I The value of .
[0072] Furthermore, when CT images are rendered in three dimensions, I The value of is 0.2±0.05; when the prosthesis model is rendered in three dimensions, I The value is 0.02±0.005.
[0073] In this embodiment, when performing three-dimensional rendering on the CT image, I The value of is 0.2 (simulating the grayscale contrast of bones in X-rays). When the prosthesis model is rendered in three dimensions, I The value of is 0.02 (to simulate the highlight display of metal prosthesis); 0.2 and 0.02 are empirical values with wide applicability obtained by trying various bone CT and prosthesis models. During specific implementation, slight customization can be made based on 0.2 and 0.02.
[0074] In this embodiment, the additive blend mode of the 3D volume mapping mapper (vtkVolumeMapper) provided by the VTK library is used to perform 3D rendering of the CT image and the prosthesis model. The light stepping is matched with the CT resolution, the projection angle simulates the X-ray tube-detector geometry (such as the source-image distance of 100 cm, 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 angle of view. The final imaging effect is as follows Figure 5 shown.
[0075] Medical X-ray imaging is a technology that uses the differences in the absorption of X-rays by different tissues (such as bones, muscles, and air) when they penetrate the human body to form images: high-density tissue (such as bones) absorbs more X-rays and appears white, while low-density tissue (such as lungs) absorbs less and appears black. The cumulative blending mode of the VTK 3D volume rendering mapper is a 3D data visualization technology based on ray casting. Its core principle is to sample volume data along the line of sight and directly add the opacity values of all sampling points without considering occlusion relationships to form a transparent overlay effect. This method is suitable for scenes that emphasize weak signals or sparse structures. Taking into account that the above-mentioned volume rendering method is very similar to the principle of X-ray imaging, the present invention uses volume rendering of CT data to simulate two-dimensional X-ray films, thereby taking into account the reading requirements of CT and traditional X-ray images.
[0076] Since the X-ray film simulated in this application is actually a volume rendering of a 3D image, the image and bin are still in the 3D space of the VTK 3D volume rendering mapper. During the reading process, if you want to switch the perspective, you only need to move the camera perspective in the 3D space of the VTK 3D volume rendering mapper during rendering to obtain the X-ray film effect under other perspectives, such as Figure 6 As shown, this process does not require any additional calculations.
[0077] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for simulating X-ray imaging effects using CT images in prosthesis planning, characterized in that: The following steps are involved: Set the voxel value range of the prosthesis implantation area in the CT image; Place the prosthesis model at the location to be implanted in the CT image; Assign corresponding voxel values to the prosthesis model based on the set voxel value range; Based on the voxel value, the opacity corresponding to the CT image and the prosthesis model is configured, and the CT image and the prosthesis model are rendered in three dimensions using a three-dimensional volume rendering mapper to obtain a CT image that simulates the imaging effect of an X-ray film; The method of assigning voxel values corresponding to the prosthetic model comprises 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 voxels within the axial bounding box and set the voxel value inside the prosthesis model to H , set the voxel value outside the prosthesis model to L - H ;in, H 、 L are the upper and lower limits of the preset voxel value range respectively; The method for configuring the opacity of the CT image and the phantom model based on voxel values is: The voxel value-opacity transfer function is established as follows: ; ; in, is opacity, V is the voxel value; H 、 L are the upper and lower limits of the preset voxel value range, I The default opacity.
2. The method for simulating X-ray imaging effects using CT images in prosthesis planning according to claim 1, characterized in that: Methods for setting the voxel value range of the prosthesis implant area in the CT image include: Reconstruct a three-dimensional bone model based on the patient's CT images; Randomly sample the voxel values of n points in the CT image that fall inside the 3D bone model; Sort the voxel values of n points in ascending order; The average value of the voxel values of several points in the top order is taken as the lower limit of the voxel value, and the average value of the voxel values of several points in the bottom order is taken as the upper limit of the voxel value.
3. The method for simulating X-ray imaging effects using CT images in prosthesis planning according to claim 1, characterized in that: The method for placing the prosthesis model at the intended implantation position in the CT image is as follows: During the preoperative planning stage, the prosthesis model was imported and moved in the MPR reading mode of the CT image to ensure that the rotation center of the prosthesis model was at the center of the implantation position, whether viewed from the coronal view, axial view, or sagittal view of the CT image, and the anteversion angle of the prosthesis model was 5° to 25° and the abduction angle was 30° to 50°.
4. The method for simulating X-ray imaging effects using CT images in prosthesis planning according to claim 1, characterized in that: When performing 3D rendering of CT images I The value is greater than when the prosthesis model is rendered in three dimensions I The value of .
5. The method for simulating X-ray imaging effects using CT images in prosthesis planning according to claim 4, characterized in that: When CT images are rendered in three dimensions, I The value of is 0.2±0.05; when the prosthesis model is rendered in three dimensions, I The value is 0.02±0.
005.
6. The method for simulating X-ray imaging effects using CT images in prosthesis planning according to claim 1, characterized in that: The CT image and the prosthesis model are rendered in three dimensions using the cumulative blending mode of the three-dimensional volume rendering mapper provided by the VTK library, forming a transparent superposition 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
Method for generating simulated X-ray image in hip joint prosthesis planning and electronic equipment
CN119498954A