Multi-model virtual X-ray image generation method and related equipment

By using GPU acceleration and Gaussian spherical source simulation in virtual X-ray image generation, tetrahedral mesh processing and Bill Lambo's law calculations are optimized, and the problems of low computing efficiency and insufficient imaging accuracy in the prior art are solved, achieving high efficiency, Accurate multi-model virtual X-ray image generation to meet real-time application needs.

CN119417926AActive Publication Date: 2025-02-11XI AN JIAOTONG UNIV

Patent Information

Application Number
CN202411522595.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-02-11
Estimated Expiration
2044-10-29

AI Technical Summary

Technical Problem

In the prior art, low computing efficiency, insufficient imaging accuracy, difficulty in handling complex geometric structures and heterogeneous materials, and failure to fully utilize GPU parallel computing capabilities, resulting in difficult real-time application generation of virtual X-ray images.

Method used

By providing a multi-model virtual X-ray image generation method, using GPU acceleration technology, combining more realistic Gaussian spherical source simulation, optimizing tetrahedral mesh generation and processing technology, using Bill Lambo's law to calculate the ray attenuation value, and through OpenCV Generate virtual X-ray images.

Benefits of technology

It improves the computing efficiency of virtual X-ray image generation, reduces calculation time, meets the needs of real-time application, improves imaging accuracy and authenticity, supports simultaneous imaging of multiple objects, and improves the flexibility and applicability of simulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119417926A_ABST
    Figure CN119417926A_ABST
Patent Text Reader

Abstract

The invention relates to the field of X-ray digital imaging and computer graphics, and discloses a multi-model virtual X-ray image generation method and related equipment, and the method comprises the steps: receiving rays emitted by an X-ray source simulating a real emission source to each pixel point of a detector; loading the model data to obtain a tetrahedral mesh data file, and extracting geometric information of the tetrahedral mesh data file; detecting intersection information of the ray and the tetrahedral mesh data file, and outputting intersection point data according to the intersection information; calculating the attenuation value of each ray penetrating through the loading model to reach a detector pixel by utilizing the Beer-Lanbo law according to the intersection point data; through the GPU acceleration technology, the calculation efficiency of virtual X-ray image generation is improved, and the calculation time is shortened, so that the requirement of real-time application is met, the imaging precision and authenticity are improved, the interpolation error is reduced, and the method is closer to actual radiation distribution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of X-ray digital imaging and computer graphics, and in particular to a multi-model virtual X-ray image generation method and related equipment. Background Art

[0002] Virtual X-ray imaging simulation has been widely used in medicine and engineering. In medical physics, X-rays are used to simulate the process of interaction with matter to improve the quality and accuracy of medical imaging, minimize damage to normal tissues and improve the efficacy of treatment. On the other hand, non-destructive testing is an important application area in the engineering field. X-ray simulation can be used to detect defects, cracks, density distribution, etc. of materials to ensure product quality and safety without destroying the integrity of the object.

[0003] There are two main methods for simulating virtual X-ray images, namely Monte Carlo simulation and ray tracing. Jenu used Geant4 to develop an X-ray imaging dose simulator, created a patient model based on CT scan data, and simulated the absorbed dose of X-rays. Research on ray tracing methods mainly focuses on the medical field. Frank proposed the use of triangular meshes to achieve real-time generation of virtual X-ray images on OpenGL, and Ehlke proposed the use of tetrahedral meshes to quickly generate virtual X-ray images based on three-dimensional anatomical models.

[0004] Although Monte Carlo simulation can provide high-precision X-ray absorption and scattering data, its computational cost is very high, especially in complex three-dimensional models. The large number of photon tracing during the simulation process will lead to long calculation times, which is difficult to meet the needs of real-time or quasi-real-time applications.

[0005] Most existing technologies use point light sources to simulate X-rays. The light source model is relatively simple and cannot truly reflect the emission characteristics of the actual X-ray source, resulting in insufficient physical authenticity of the imaging results. In addition, imaging processing is usually performed on a single model. When processing objects containing multiple materials or with high heterogeneity, the accuracy and flexibility are often not high, and there is a lack of support for multiple models or complex scenes, which affects the diagnostic or detection quality of the image. Summary of the invention

[0006] In order to overcome the defects of the above-mentioned prior art, the purpose of the present invention is to provide a multi-model virtual X-ray image generation method and related equipment to solve the technical problems in the prior art such as low computing efficiency, insufficient imaging accuracy, difficulty in processing complex geometric structures and heterogeneous materials, and failure to fully utilize the parallel computing capabilities of GPU.

[0007] The present invention is achieved through the following technical solutions: In a first aspect, the present invention provides a method for generating a multi-model virtual X-ray image, comprising: Receiving rays emitted by an X-ray source simulating a real emission source to each pixel of the detector; Load the model data to obtain a tetrahedral mesh data file, and extract the geometric information of the tetrahedral mesh data file; Detecting intersection information between the ray and the tetrahedral mesh data file, and outputting intersection data according to the intersection information; The attenuation value of each ray penetrating the loading model and reaching the detector pixel is calculated based on the intersection data using the Bill-Lambert law; The attenuation value is converted into a grayscale value, and a virtual X-ray image is generated through OpenCV based on the grayscale value.

[0008] Preferably, an OpenGL environment is initialized for the rays emitted by an X-ray source that simulates a real emission source to each pixel point of the detector and the detector position, the detector plane is divided into a pixel grid, the center coordinates of each pixel grid are calculated, and the ray direction is determined by the center coordinates, wherein initializing the OpenGL environment includes creating a context, setting a viewport and a projection matrix.

[0009] Preferably, the tetrahedral mesh data file of the model is loaded using the Assimp library, and the vertices and tetrahedral mesh data of the tetrahedral mesh data file are extracted.

[0010] Preferably, an intersection detection algorithm is used to detect whether the ray intersects with each face of the tetrahedral mesh data file. When the ray does not intersect with each face of the tetrahedral mesh data file, all other faces of the tetrahedral mesh data file are traversed and re-detected; when the ray intersects with each face of the tetrahedral mesh data file, the intersection information is recorded to obtain the intersection data; The GPU is used to batch process the intersection detection information of all ray and tetrahedral mesh data files to obtain all intersection point data.

[0011] Furthermore, the specific process of obtaining the intersection data according to the intersection information is as follows: The path length of each ray in the tetrahedron is calculated. When the number of intersections between the ray and the tetrahedron is even, the path length between every two intersections is calculated and accumulated according to the order of the intersections. Otherwise, the abnormal intersections are corrected and eliminated, and the intersection information is re-recorded.

[0012] Furthermore, based on the initial intensity of the ray, the path length, the set material properties and their corresponding attenuation coefficients, the Bill-Lambert law is applied to calculate the attenuation value of each ray penetrating the loading model to reach the detector pixel, and the attenuation value calculation task of each ray is assigned to the GPU, and the attenuation calculation of all rays is completed in parallel, wherein the attenuation value is converted to a grayscale value, normalized and mapped to a grayscale range, and a complete grayscale image matrix is ​​generated, and the final virtual X-ray image is displayed and saved using OpenCV.

[0013] Preferably, after the virtual X-ray image is generated by OpenCV, a comprehensive image quality evaluation is performed based on the actual working conditions of smoke and filtrate sputtering conditions, motion blur, geometric blur caused by the size and shape of the X-ray light source, the energy spectrum of the X-ray light source, the radiation dose, and the imaging configuration, wherein the imaging configuration is optimized within the adjustable range of the source focal spot parameters, and a high-quality original image is obtained based on the quality evaluation indicators of the image signal-to-noise ratio and contrast; the high-quality original image is optimized, and a deep learning model based on a conditional generative adversarial network and / or a diffusion model is used to remove smoke and motion noise, and the X-ray image is optimized with high confidence under the established image quality evaluation system in combination with the light source parameters and imaging configuration during the actual shooting process.

[0014] In a second aspect, the present invention also provides a multi-model virtual X-ray image generation system, comprising A ray receiving module, used to receive rays emitted by an X-ray source simulating a real emission source to each pixel of the detector; A 3D model processing module is used to load the model data to obtain a tetrahedral mesh data file and extract geometric information of the tetrahedral mesh data file; A ray projection module, used for detecting intersection information between the ray and the tetrahedral mesh data file, and outputting intersection data according to the intersection information; An attenuation calculation module is used to calculate the attenuation value of each ray penetrating the loading model and reaching the detector pixel according to the intersection data using the Bill-Lambert law; The image processing module is used to convert the attenuation value into a grayscale value, and generate a virtual X-ray image through OpenCV based on the grayscale value.

[0015] In a third aspect, the present invention also provides a mobile terminal, characterized in that it comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the multi-model virtual X-ray image generation method as described above is implemented.

[0016] In a fourth aspect, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the multi-model virtual X-ray image generation method as described above is implemented.

[0017] Compared with the prior art, the present invention has the following beneficial technical effects: The present invention provides a multi-model virtual X-ray image generation method, which improves the computational efficiency of virtual X-ray image generation and reduces the computational time through GPU acceleration technology, thereby meeting the needs of real-time applications. Secondly, combined with a more realistic Gaussian spherical source simulation, by optimizing the tetrahedral mesh generation and processing technology, the present invention improves the accuracy and authenticity of imaging, reduces interpolation errors, and is closer to the actual radiation distribution. In addition, objects with different material properties and photon energies at different energy levels can be set, which can accurately simulate the X-ray interaction of heterogeneous materials, and on this basis support simultaneous imaging of multiple objects, improving the flexibility and applicability of the simulation.

[0018] Furthermore, by loading different tetrahedral mesh data files, the attenuation effect of objects of different shapes, materials and structures on X-rays can be easily simulated. This flexibility enables this method to be widely used in a variety of scenarios, such as X-ray imaging simulation of objects of different shapes, non-destructive testing of the internal structure of materials, etc. At the same time, as the model data is updated and expanded, this method can continue to adapt to new application requirements.

[0019] Furthermore, the Bill-Lambert law is used to accurately calculate the attenuation value of the ray when it passes through the object, ensuring the accuracy of the generated image. At the same time, through the efficient algorithm to process the intersection data and attenuation value conversion, this method can improve the calculation efficiency and reduce the time required to generate the image while ensuring the image quality.

[0020] Furthermore, the calculated attenuation values ​​are converted into grayscale values, and virtual X-ray images are generated through image processing libraries such as OpenCV, making the results more intuitive and easy to understand. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 is a schematic diagram of a method for generating a multi-model virtual X-ray image in an embodiment of the present invention; Figure 2 is a detailed flow chart of a method for generating a multi-model virtual X-ray image in an embodiment of the present invention; Figure 3 A 3D spatial schematic diagram of a model and a virtual X-ray imaging result in an embodiment of the present invention; Figure 4 A virtual X-ray image of the armature displayed by the detector imaging board in an embodiment of the present invention; Figure 5A schematic diagram of the square iron sheet and the circular copper sheet in an embodiment of the present invention respectively setting different energy levels of photon energy for the X-ray penetrating the model; Figure 6 Schematic diagram of the structure of a multi-model virtual X-ray image generation system in an embodiment of the present invention; In the figure: 1-ray receiving module; 2-3D model processing module; 3-ray projection module; 4-attenuation calculation module; 5-image processing module. DETAILED DESCRIPTION

[0022] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0023] The present invention is further described in detail below in conjunction with the accompanying drawings: The purpose of the present invention is to provide a multi-model virtual X-ray image generation method and related equipment to solve the technical problems in the prior art such as low computing efficiency, insufficient imaging accuracy, difficulty in processing complex geometric structures and heterogeneous materials, and failure to fully utilize the parallel computing capabilities of GPU.

[0024] See also Figure 1 and Figure 2 In one embodiment of the present invention, a method for generating a multi-model virtual X-ray image is provided, comprising the following process: Step 1, receiving a ray emitted by an X-ray source simulating a real emission source to each pixel of the detector, wherein the emission source follows a Gaussian probability density function; Specifically, the OpenGL environment is initialized for the rays emitted by the X-ray source that simulates the real emission source to each pixel point of the detector and the detector position, the detector plane is divided into pixel grids, the center coordinates of each pixel grid are calculated, and the ray direction is determined by the center coordinates, wherein initializing the OpenGL environment includes creating a context, setting the viewport and the projection matrix.

[0025] The specific initialization process includes: Detector position and attitude setting: First, the position of the detector and its attitude (such as direction and angle) in three-dimensional space need to be determined. This is usually based on the layout of the actual X-ray imaging equipment or set according to simulation requirements.

[0026] Detector plane segmentation: The detector plane is divided into multiple small pixel grids. Each grid represents a pixel on the detector, which is used to receive the radiation from the X-ray source and measure its intensity after attenuation.

[0027] The density of the grid (i.e., pixel size) determines the resolution of the image. Higher resolution means finer image details, but it may also lead to increased computational effort.

[0028] The specific process of ray emission and direction determination includes: X-ray source settings: Set the position, energy distribution, emission characteristics, and diameter of the X-ray source to simulate the behavior of a real source.

[0029] The energy distribution may include multiple energy levels to support simulation of multi-spectral or multi-energy imaging.

[0030] Pixel grid center coordinate calculation: Calculate the center coordinates of each pixel grid. These coordinates will be used as the starting point or target point for ray shooting, depending on the specific implementation of the simulation.

[0031] In some cases, a ray may be emitted from an X-ray source toward the center of each pixel grid to simulate the response of each pixel on the detector.

[0032] Ray direction determination: The direction of each ray can be calculated using the center coordinates of the pixel grid and the position of the X-ray source.

[0033] The ray direction is usually a straight line from the X-ray source to the center of the detector pixel grid.

[0034] Initializing the OpenGL environment includes: Create an OpenGL context: Create a window using GLFW, SDL or other window libraries, and create an OpenGL context on the window, which is the execution environment for OpenGL rendering operations.

[0035] Set the viewport: By calling the glViewport function, set the viewport size for OpenGL rendering, that is, the window area that the rendering result will cover, to ensure that the rendered image fills the window correctly.

[0036] Set the projection matrix: Create the projection matrix: Calculate the projection matrix according to the required visual effect (such as perspective projection or orthographic projection), and upload the calculated projection matrix to the OpenGL shader program through glUniformMatrix4fv (or other similar functions).

[0037] Step 2, loading the model data to obtain a tetrahedral mesh data file, and extracting geometric information of the tetrahedral mesh data file; Specifically, the tetrahedral mesh data file of the model is loaded using the Assimp library, and the vertices and tetrahedral mesh data of the tetrahedral mesh data file are extracted.

[0038] Among them, using Assimp to load the model requires calling Assimp's import function (such as aiImportFile) and passing in the file path containing the tetrahedral mesh data. Assimp will parse the file and convert it into an internal scene graph representation, which includes information such as vertices, faces (tetrahedrons in the case of tetrahedral meshes), textures, materials, etc. Traverse the Assimp scene graph and extract the vertex data and tetrahedron data of the tetrahedral mesh (usually as a face index array, each tetrahedron is defined by four vertex indices).

[0039] Draw the tetrahedron mesh: Use glDrawElements (or similar functions) and the VAO created earlier to draw the tetrahedron mesh. OpenGL will automatically render the tetrahedron mesh based on the vertex data and index array.

[0040] Step 3, detecting the intersection information between the ray and the tetrahedral mesh data file, and outputting the intersection data according to the intersection information; Specifically, an intersection detection algorithm is used to detect whether the ray intersects with each face of the tetrahedral mesh data file. When the ray does not intersect with each face of the tetrahedral mesh data file, all other faces of the tetrahedral mesh data file are traversed and re-detected; when the ray intersects with each face of the tetrahedral mesh data file, intersection information is recorded to obtain intersection data; The GPU is used to batch process the intersection detection information of all ray and tetrahedral mesh data files to obtain all intersection point data.

[0041] The specific process of obtaining the intersection data according to the intersection information is as follows: The path length of each ray in the tetrahedron is calculated. When the number of intersections between the ray and the tetrahedron is even, the path length between every two intersections is calculated and accumulated according to the order of the intersections. Otherwise, the abnormal intersections are corrected and eliminated, and the intersection information is re-recorded.

[0042] The specific process of intersection detection in this embodiment is as follows: Ray Shooting: For each ray shot from the X-ray source toward the center of the detector pixel grid, an intersection check is performed.

[0043] Face-by-face detection: For each ray, traverse each tetrahedron (or "unit" or "voxel") in the tetrahedron mesh data file. For each tetrahedron, check whether the ray intersects any of its faces.

[0044] Geometric intersection test: Commonly used algorithms include the Möller-Trumbore algorithm or the Plücker coordinate method, which can efficiently detect whether a ray intersects a triangle (a face of a tetrahedron) and calculate the intersection point.

[0045] To improve efficiency, a space partitioning structure (such as an octree, KD tree, or BSP tree) can be used to reduce the number of tetrahedrons that need to be detected.

[0046] The intersection information and intersection sorting are recorded by intersection points.

[0047] In the path length calculation and exception handling of this embodiment, for the sorted intersections, the path length (i.e., the length of the ray segment) between every two adjacent intersections is calculated. This is usually achieved by calculating the Euclidean distance between two points. If the number of intersections between the ray and the tetrahedron is an even number, this usually means that the ray completely penetrates a tetrahedron or a series of tetrahedrons (without considering the reflection inside the tetrahedron). At this time, the path length between every two adjacent intersections is accumulated to obtain the total path length. If the number of intersections is an odd number, there may be anomalies (such as the starting point or end point of the ray is located inside the tetrahedron), and these abnormal intersections need to be corrected and excluded, and then the valid intersection information is re-recorded.

[0048] In this embodiment, the parallel processing capability of the GPU is utilized to significantly accelerate the intersection detection process between rays and tetrahedron meshes. By sending the ray and tetrahedron data to the GPU and executing the intersection detection algorithm on the GPU, multiple rays and multiple tetrahedrons can be processed simultaneously, thereby significantly reducing the processing time.

[0049] Step 4, using the Bill-Lambert law to calculate the attenuation value of each ray on the detector pixel according to the intersection data; Specifically, based on the initial intensity of the ray, the path length, the set material properties and their corresponding attenuation coefficients, the Bill-Lambert law is applied to calculate the attenuation value of each ray on the detector pixel, and the attenuation value calculation task of each ray is assigned to the GPU to complete the attenuation calculation of all rays in parallel.

[0050] Among them, the mathematical expression of Bill Lamb's law is: I = I 0⋅ e −μ⋅x in, I 0 is the initial intensity of the ray, I is the intensity of the ray after passing through the medium, μ is the attenuation coefficient of the medium, x is the path length that the ray travels in the medium.

[0051] For each ray, the attenuation value in each tetrahedral unit it passes through can be calculated based on the material properties and path length of the unit. Then, these attenuation values ​​are accumulated to obtain the total attenuation value of the ray before it reaches the detector.

[0052] Step 5: convert the attenuation value to a grayscale value, and generate a virtual X-ray image through OpenCV based on the grayscale value.

[0053] Specifically, the attenuation values ​​are converted to grayscale values, normalized and mapped to a grayscale range, a complete grayscale image matrix is ​​generated, and the final virtual X-ray image is displayed and saved using OpenCV.

[0054] Among them, the attenuation values ​​are linearly mapped to the grayscale range (usually 0 to 255). This can be achieved by normalizing the attenuation values ​​to a fixed range (such as 0 to 1) and then multiplying by 255. However, because the physical meaning and range of attenuation values ​​may vary for different materials and ray energies, it may be necessary to scale or offset the attenuation values ​​first to ensure that they can be reasonably mapped to the grayscale range.

[0055] A nonlinear transfer function such as a logarithmic, exponential, or S-shaped curve is used to map the attenuation values ​​to grayscale values. These functions can be adjusted as needed to produce a more natural image or to emphasize specific features.

[0056] Before converting the attenuation values ​​to grayscale, it is usually necessary to normalize them to ensure that all values ​​are within a comparable range. Normalization can be achieved by subtracting the minimum value from each attenuation value and dividing it by the difference between the maximum and minimum values, thereby scaling the values ​​to between 0 and 1.

[0057] Once the attenuation values ​​are normalized, they can be multiplied by 255 (or the maximum value of the grayscale range) and then rounded to the nearest integer to get the grayscale values. These grayscale values ​​will form the elements of the grayscale image matrix.

[0058] The grayscale image matrix is ​​a two-dimensional array where each element corresponds to the grayscale value of a pixel in the image. This matrix can be filled based on the results of the intersection detection of the ray with the tetrahedral mesh and the attenuation calculation. Usually, the size of the matrix corresponds to the size of the detector pixel grid.

[0059] according to Figure 3 As shown, a 3D spatial schematic diagram of the model and virtual X-ray imaging results (taking the armature model as an example) includes a spherical Gaussian source, an armature model, and a detector imaging plate, all of which can be adjusted in position and direction.

[0060] according to Figure 4As shown, the detector imaging board displays a virtual X-ray image of the armature.

[0061] according to Figure 5 As shown in the figure, there are two models, namely a square iron sheet with a width of 100 mm and a thickness of 6 mm and a round copper sheet with a diameter of 50 mm and a thickness of 0.5 mm. Different energy levels of photon energy are set for the X-rays penetrating the models (equivalent to setting different attenuation coefficients for the models), and the detector imaging board displays a virtual X-ray image of the armature.

[0062] In the present invention, after the virtual X-ray image is initially generated, a series of actual working conditions such as smoke and filtrate sputtering conditions, motion blur, geometric blur caused by the size and shape of the X-ray source, X-ray source energy spectrum, radiation dose, and imaging configuration are considered to establish a comprehensive image quality evaluation method, optimize the imaging configuration within the adjustable range of the source focal spot parameters, and consider quality evaluation indicators such as image signal-to-noise ratio and contrast to obtain a high-quality original image.

[0063] Then, based on the deep learning image optimization method, a deep learning model based on conditional generative adversarial network and / or diffusion model is used to remove smoke and motion noise and improve contrast and signal-to-noise ratio. Combined with the light source parameters and imaging configuration in the actual shooting process, the X-ray image is optimized with high confidence under the established image quality evaluation system.

[0064] In summary, the present invention provides a multi-model virtual X-ray image generation method, which improves the computational efficiency of virtual X-ray image generation and reduces the computational time through GPU acceleration technology, thereby meeting the needs of real-time applications. Secondly, combined with a more realistic Gaussian spherical source simulation, by optimizing the tetrahedral mesh generation and processing technology, the present invention improves the accuracy and authenticity of imaging, reduces interpolation errors, and is closer to the actual radiation distribution. In addition, objects with different material properties and photon energies at different energy levels can be set, which can accurately simulate the X-ray interaction of heterogeneous materials, and on this basis support simultaneous imaging of multiple objects, thereby improving the flexibility and applicability of the simulation.

[0065] Example 2 according to Figure 6 As shown, this embodiment also provides a multi-model virtual X-ray image generation system, including A ray receiving module 1 is used to receive rays emitted by an X-ray source simulating a real emission source to each pixel of the detector; 3D model processing module 2, used for loading model data to obtain tetrahedral mesh data file, and extracting geometric information of the tetrahedral mesh data file; A ray projection module 3, used for detecting the intersection information between the ray and the tetrahedral mesh data file, and outputting the intersection data according to the intersection information; Attenuation calculation module 4, used to calculate the attenuation value of each ray penetrating the loading model and reaching the detector pixel according to the intersection data using the Bill-Lambert law; The image processing module 5 is used to convert the attenuation value into a grayscale value, and generate a virtual X-ray image through OpenCV based on the grayscale value.

[0066] Example 3 The present invention also provides a mobile terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, such as a multi-model virtual X-ray image generation program.

[0067] When the processor executes the computer program, the steps of the above-mentioned multi-model virtual X-ray image generation method are implemented, for example: Receiving rays emitted by an X-ray source simulating a real emission source to each pixel of the detector; Load the model data to obtain a tetrahedral mesh data file, and extract the geometric information of the tetrahedral mesh data file; Detecting intersection information between the ray and the tetrahedral mesh data file, and outputting intersection data according to the intersection information; The attenuation value of each ray penetrating the loading model and reaching the detector pixel is calculated based on the intersection data using the Bill-Lambert law; The attenuation value is converted into a grayscale value, and a virtual X-ray image is generated through OpenCV based on the grayscale value.

[0068] Alternatively, when the processor executes the computer program, the functions of each module in the above system are realized, for example: A ray receiving module 1 is used to receive rays emitted by an X-ray source simulating a real emission source to each pixel of the detector; 3D model processing module 2, used for loading model data to obtain tetrahedral mesh data file, and extracting geometric information of the tetrahedral mesh data file; A ray projection module 3, used for detecting the intersection information between the ray and the tetrahedral mesh data file, and outputting the intersection data according to the intersection information; Attenuation calculation module 4, used to calculate the attenuation value of each ray penetrating the loading model and reaching the detector pixel according to the intersection data using the Bill-Lambert law; The image processing module 5 is used to convert the attenuation value into a grayscale value, and generate a virtual X-ray image through OpenCV based on the grayscale value.

[0069] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program in the mobile terminal.

[0070] For example, the computer program may be divided into a ray receiving module 1, a 3D model processing module 2, a ray projection module 3, an attenuation calculation module 4 and an image processing module 5; A ray receiving module 1 is used to receive rays emitted by an X-ray source simulating a real emission source to each pixel of the detector; 3D model processing module 2, used for loading model data to obtain tetrahedral mesh data file, and extracting geometric information of the tetrahedral mesh data file; A ray projection module 3, used for detecting the intersection information between the ray and the tetrahedral mesh data file, and outputting the intersection data according to the intersection information; Attenuation calculation module 4, used to calculate the attenuation value of each ray penetrating the loading model and reaching the detector pixel according to the intersection data using the Bill-Lambert law; The image processing module 5 is used to convert the attenuation value into a grayscale value, and generate a virtual X-ray image through OpenCV based on the grayscale value.

[0071] The mobile terminal 6 may be a computing device such as a desktop computer, a notebook, a palm computer, a cloud server, etc. The mobile terminal may include, but is not limited to, a processor and a memory.

[0072] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the mobile terminal, and uses various interfaces and lines to connect various parts of the entire mobile terminal.

[0073] The memory may be used to store the computer programs and / or modules, and the processor implements various functions of the mobile terminal by running or executing the computer programs and / or modules stored in the memory and calling the data stored in the memory.

[0074] The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (SmartMediaCard, SMC), a secure digital (SecureDigital, SD) card, a flash card (FlashCard), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0075] Example 4 The present invention also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the multi-model virtual X-ray image generation method are implemented.

[0076] If the module / unit integrated in the mobile terminal is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.

[0077] Based on such understanding, the present invention implements all or part of the processes in the above method, and can also be completed by instructing related hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the above multi-model virtual X-ray image generation method can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc.

[0078] The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc.

[0079] It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media does not include electrical carrier signals and telecommunication signals.

[0080] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A method for generating a multi-model virtual X-ray image, characterized in that: include: Receiving rays emitted by an X-ray source simulating a real emission source to each pixel of the detector; Load the model data to obtain a tetrahedral mesh data file, and extract the geometric information of the tetrahedral mesh data file; Detecting intersection information between the ray and the tetrahedral mesh data file, and outputting intersection data according to the intersection information; The attenuation value of each ray penetrating the loading model and reaching the detector pixel is calculated based on the intersection data using the Bill-Lambert law; The attenuation value is converted into a grayscale value, and a virtual X-ray image is generated through OpenCV based on the grayscale value.

2. A method for generating a multi-model virtual X-ray image according to claim 1, characterized in that: Initialize the OpenGL environment for the rays emitted by the X-ray source that simulates the real emission source to each pixel point of the detector and the detector position, divide the detector plane into pixel grids, calculate the center coordinates of each pixel grid, and determine the ray direction through the center coordinates. Initializing the OpenGL environment includes creating a context, setting the viewport and projection matrix.

3. The method for generating a multi-model virtual X-ray image according to claim 1, characterized in that: Use the Assimp library to load the tetrahedral mesh data file of the model and extract the vertices and tetrahedral mesh data of the tetrahedral mesh data file.

4. The method for generating a multi-model virtual X-ray image according to claim 1, characterized in that: Using an intersection detection algorithm to detect whether the ray intersects with each face of the tetrahedral mesh data file, when the ray does not intersect with each face of the tetrahedral mesh data file, traversing all other faces of the tetrahedral mesh data file and re-detecting; when the ray intersects with each face of the tetrahedral mesh data file, recording intersection information to obtain intersection data; The GPU is used to batch process the intersection detection information of all ray and tetrahedral mesh data files to obtain all intersection point data.

5. A method for generating a multi-model virtual X-ray image according to claim 4, characterized in that: The specific process of obtaining intersection data according to intersection information is as follows: The path length of each ray in the tetrahedron is calculated. When the number of intersections between the ray and the tetrahedron is even, the path length between every two intersections is calculated and accumulated according to the order of the intersections. Otherwise, the abnormal intersections are corrected and eliminated, and the intersection information is re-recorded.

6. A method for generating a multi-model virtual X-ray image according to claim 5, characterized in that: According to the initial intensity of the ray, the path length, the set material properties and their corresponding attenuation coefficients, the Bill-Lambert law is applied to calculate the attenuation value of each ray penetrating the loading model to reach the detector pixel, and the attenuation value calculation task of each ray is assigned to the GPU, and the attenuation calculation of all rays is completed in parallel, wherein the attenuation value is converted to a grayscale value, normalized and mapped to a grayscale range, and a complete grayscale image matrix is ​​generated. The final virtual X-ray image is displayed and saved using OpenCV.

7. The method for generating a multi-model virtual X-ray image according to claim 1, characterized in that: After the virtual X-ray image is generated by OpenCV, a comprehensive evaluation of the image quality is performed based on the actual working conditions of smoke and filtrate sputtering conditions, motion blur, geometric blur caused by the size and shape of the X-ray light source, the energy spectrum of the X-ray light source, the radiation dose, and the imaging configuration. The imaging configuration is optimized within the adjustable range of the source focal spot parameters, and a high-quality original image is obtained based on the quality evaluation indicators of the image signal-to-noise ratio and contrast. The high-quality original image is optimized by using a deep learning model based on a conditional generative adversarial network and / or a diffusion model to remove smoke and motion noise. Combined with the light source parameters and imaging configuration in the actual shooting process, the X-ray image is optimized with high confidence under the established image quality evaluation system.

8. A multi-model virtual X-ray image generation system, characterized in that: include A ray receiving module (1) is used to receive rays emitted by an X-ray source simulating a real emission source to each pixel point of the detector; The 3D model processing module (2) is used to load the model data to obtain a tetrahedral mesh data file and extract geometric information of the tetrahedral mesh data file; A ray projection module (3) is used to detect the intersection information between the ray and the tetrahedral mesh data file, and output the intersection data according to the intersection information; An attenuation calculation module (4) is used to calculate the attenuation value of each ray penetrating the loading model and reaching the detector pixel using the Bill-Lambert law according to the intersection data; An image processing module (5) is used to convert the attenuation value into a grayscale value, and generate a virtual X-ray image based on the grayscale value through OpenCV.

9. A mobile terminal, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for generating a multi-model virtual X-ray image according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for generating a multi-model virtual X-ray image according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Image projection recovery method based on X ray source array imaging

    CN106706681A

  • Neural network training method and system

    CN112489189A

  • Casting defect detection method and system based on three-dimensional model and flaw detection image

    CN115713622A

Cited By

  • Switch equipment structure point cloud generation method and system based on X-ray image gray level

    CN119693563A