Method, device, equipment and computer storage medium for generating scanned image of workpiece
Through computer simulation reconstruction and neural network conversion, the CT images of the artifact are generated, which solves the problems of time-consuming and labor-intensive and poor economical in the prior art, and achieves efficient and economical CT images acquisition.
Patent Information
- Application Number
- CN202210164352.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-22
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2042-02-22
AI Technical Summary
The prior art is time-consuming and laborious and economical in obtaining CT images of workpieces or samples, making it difficult to produce accurate sample mockups without actual CT detection.
Through computer simulation methods, the computer-aided design file of the target object is reconstructed by using the target prediction model, and the three-dimensional simulation image is converted into CT images using a pre-trained neural network model, simulating the CT scanning process, and generating the CT scan image of the target object.
The acquisition efficiency and economicality of CT scan images are improved, and the need for actual CT detection is avoided.
Smart Images

Figure CN114581605B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of image processing, and particularly relates to a method, device, equipment and computer storage medium for generating a scanned image of a workpiece. Background Art
[0002] CT imaging technology obtains projection data of an object within a certain angular range through the relative movement between the object to be inspected and the detector, and reconstructs the projection data into three-dimensional volume data of the object to be detected through the FDK algorithm. It can obtain the three-dimensional structure of the object without damaging the object, so it is widely used in industrial fields such as non-destructive testing and security inspection.
[0003] Currently, the method of actually performing CT detection and image annotation to obtain CT images of workpieces or samples is not only time-consuming and laborious, with poor economy, but also difficult to produce accurate sample phantoms. Therefore, there is an urgent need for a new method for generating industrial CT datasets to obtain CT images of various samples without actual CT detection. Summary of the Invention
[0004] Embodiments of this application provide a method, device, equipment and computer storage medium for generating a scanned image of a workpiece, which can obtain a simulated CT image of the object to be detected through computer simulation without CT detection.
[0005] In a first aspect, embodiments of this application provide a method for generating a scanned image of a workpiece, the method including:
[0006] Obtain a computer-aided design file of a target object;
[0007] Perform three-dimensional simulation reconstruction on the computer-aided design file of the target object to obtain a three-dimensional simulation image of the target object;
[0008] Input the three-dimensional simulation image into a target prediction model, and use the image output by the target prediction model as the computed tomography (CT) image of the target object. The target prediction model is a neural network model trained through historical training samples, and the historical training samples include three-dimensional simulation images and CT images of historical workpieces.
[0009] In a second aspect, embodiments of this application provide a device for generating a scanned image of a workpiece, the device including:
[0010] An obtaining module, configured to obtain a computer-aided design file of a target object;
[0011] A reconstruction module, configured to perform three-dimensional simulation reconstruction on the computer-aided design file of the target object to obtain a three-dimensional simulation image of the target object;
[0012] A prediction module, configured to input the three-dimensional simulation image into a target prediction model, and use the image output by the target prediction model as the computed tomography (CT) image of the target object, where the target prediction model is a neural network model trained by historical training samples, and the historical training samples include three-dimensional simulation images and CT images of historical workpieces.
[0013] In a third aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory storing computer program instructions;
[0014] When the processor executes the computer program instructions, the method for generating a scanned image of a workpiece according to the first aspect of the present application is implemented.
[0015] In a fourth aspect, an embodiment of the present application provides a computer storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the method for generating a scanned image of a workpiece according to the first aspect of the present application is implemented.
[0016] The scanned image generation device for a workpiece in the embodiment of the present application can obtain a simulated CT image of a target object according to a computer-aided design file of the target object, and endow the simulated image with the characteristics of an actual CT scanned image by using a pre-trained neural network, so as to generate a CT scanned image of the target object. In the embodiment of the present application, actual CT detection is not required. Through computer simulation, the physical process of CT scanning is simulated, and a neural network is used to endow the simulated image with actual image characteristics to generate CT images of various workpieces, improving the efficiency of obtaining CT scanned images and the economy of image acquisition. Description of the Drawings
[0017] To more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required to be used in the embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative efforts.
[0018] Figure 1 is a schematic flowchart of the method for generating a scanned image of a workpiece according to an embodiment of the present application;
[0019] Figure 2 is a schematic diagram of a simulation model of a simulated object according to an embodiment of the present application;
[0020] Figure 3 is a schematic diagram of the boundary contour pixel points of the simulated object according to an embodiment of the present application;
[0021] Figure 4 is a schematic diagram of the three-dimensional volume data of the simulated object according to an embodiment of the present application;
[0022] Figure 5 It is a schematic diagram of the reconstructed body data of the simulated object involved in the embodiment of the present application;
[0023] Figure 6 It is a schematic diagram of the actual CT system scan image of the simulated object involved in the embodiment of the present application;
[0024] Figure 7 It is a schematic diagram of the simulated image of the simulated object involved in the embodiment of the present application;
[0025] Figure 8 It is a schematic structural diagram of a scanning image generation device for a workpiece involved in the embodiment of the present application;
[0026] Figure 9 It is a schematic structural diagram of an electronic device involved in the embodiment of the present application. Detailed implementation manners
[0027] The features and exemplary embodiments of each aspect of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than limiting the present application. For those skilled in the art, the present application can be implemented without some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by showing examples of the present application.
[0028] It should be noted that, in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover a non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, elements defined by the statement "including..." do not exclude the presence of additional identical elements in the process, method, article or device including the elements.
[0029] In order to solve the problems of the prior art, the embodiments of the present application provide a method, device, equipment and computer storage medium for generating a scanning image of a workpiece. The method for generating a scanning image of a workpiece provided by the embodiments of the present application will be introduced first below.
[0030] Figure 1The flowchart shows a method for generating a scanned image of a workpiece provided by an embodiment of the present application. As Figure 1 shown, the method for generating a scanned image of a workpiece provided by an embodiment of the present application includes:
[0031] Step 101, obtain the computer-aided design file of the target object;
[0032] Step 102, perform 3D simulation reconstruction on the computer-aided design file of the target object to obtain a 3D simulation image of the target object;
[0033] Step 103, input the 3D simulation image into the target prediction model, and use the image output by the target prediction model as the computed tomography (CT) image of the target object. The target prediction model is a neural network model trained by historical training samples, and the historical training samples include the 3D simulation images and CT images of historical workpieces.
[0034] The workpiece scanned image generation device according to the embodiment of the present application can obtain the simulated CT image of the target object according to the computer-aided design file of the target object, and endow the simulated image with the characteristics of the actual CT scan image by using the pre-trained neural network, so as to generate the CT scan image of the target object. The embodiment of the present application does not require actual CT detection. By means of computer simulation, the physical process of CT scanning is simulated, and the neural network is used to endow the simulated image with actual image characteristics to generate CT images of various workpieces, improving the efficiency of obtaining CT scan images and the economy of image acquisition.
[0035] The method for generating a scanned image of a workpiece provided by an embodiment of the present application can be applied to the industrial design process to obtain the scanned image of the workpiece. When applied to the industrial design process, the method for generating a scanned image of a workpiece provided by an embodiment of the present application can be executed by a computer. The following takes the generation of a scanned image of a workpiece as an example to introduce the method for generating a scanned image of a workpiece of the present application. It should be noted that the generation of a scanned image of a workpiece in the present application is for convenience of description and should not be construed as a limitation on the application scope of the method for generating a scanned image of a workpiece of the present application.
[0036] Regarding step 101, the computer can obtain the computer-aided design file of the target object.
[0037] The target object can be an object or workpiece in industrial CT, such as a product or a component of a product in the industrial manufacturing process. For detection tasks such as security inspection that focus on object recognition and segmentation, the object to be simulated can be designed as a combination of various different types of workpieces.
[0038] The target object can be composed of one or more materials, and the types, densities, and properties of the materials of each part of the target object can be obtained according to the design attributes of the target object.
[0039] A computer-aided design file is a file formed during the computer-aided design process and contains the structural data of the target object. The computer-aided design file in the embodiments of the present application can be a product (engineering) design file in digital form formed by using a computer-aided design system, such as files in STL format and OBJ format, etc.
[0040] Computer-aided design software can include: AutoCAD, CAXA, CATIA, and Solid works, etc.
[0041] The computer-aided design file of the target object can be obtained by the computer from a storage device or a cloud server, or can also be input by the user.
[0042] Exemplarily, assuming that the method for acquiring a scanned image of a workpiece in the present application is applied to industrial manufacturing, when acquiring the scanned image of the workpiece, the computer can acquire the computer-aided design file of the workpiece to be scanned.
[0043] Regarding step 102, the computer can perform three-dimensional simulation reconstruction on the computer-aided design file of the target object to obtain a three-dimensional simulation image of the target object.
[0044] Three-dimensional simulation reconstruction refers to the process in which the computer obtains a three-dimensional simulation image of the target object through simulation.
[0045] The three-dimensional simulation image can be a simulated CT image of the target object, that is, a simulated scanned image of the simulated model of the target object.
[0046] Exemplarily, assuming that the method for acquiring a scanned image of a workpiece in the present application is applied to industrial manufacturing, the computer can obtain the three-dimensional data of the target object according to the computer-aided design file of the target object, establish a simulation model according to the three-dimensional data of the target object, and perform CT imaging simulation according to the simulation model, so as to obtain a three-dimensional simulation image of the target object.
[0047] In the embodiments of the present application, performing three-dimensional simulation reconstruction on the computer-aided design file of the target object to obtain a three-dimensional simulation image of the target object includes:
[0048] Obtaining the boundary contour pixel point information of the simulated model of the target object through the computer-aided design file;
[0049] Filling the simulated model according to the boundary contour pixel point information of the simulated model of the target object to obtain the three-dimensional volume data of the target object;
[0050] Obtaining the first simulated attenuation projection data of the target object according to the three-dimensional volume data of the target object;
[0051] Reconstruct the first simulated attenuation projection data to obtain a three-dimensional simulation image of the target object.
[0052] The simulation model of the target object can be a computer simulation model of the target object generated according to the computer-aided design file of the target object. Specifically, the simulation model can be modeled based on the parameter characteristics of the target object to generate a three-dimensional solid model of the target object. The simulation model of the target object contains structural information such as point and surface data of the target object.
[0053] The boundary contour pixel points of the simulation model of the target object are the pixel points located on the boundary contour of the simulation model of the target object, and the boundary contour pixel points can be obtained through computer discretized sampling.
[0054] The computer can perform discretized sampling in the Matlab software according to the point and surface data of the object to be simulated to obtain the boundary contour pixel points of the simulation model of the target object. The number of sampling points is determined by the requirements of the simulation accuracy. The more the number of sampling points, the finer the model of the simulated object.
[0055] The pixel physical size can be determined according to the ratio of the actual physical size of the simulation model in the x, y, and z directions to the number of sampling points of the simulation model in the x, y, and z directions. The specific formula is as follows:
[0056]
[0057] Where d x,y,z is the pixel physical size of the volume data pixels in the x, y, and z directions, S x,y,z is the actual physical size of the object in the x, y, and z directions, N x,y,z is the number of sampling points in the x, y, and z directions.
[0058] Filling the simulation model of the target object can be filling the simulation model according to the boundary contour pixel point information of the simulation model of the target object to generate the three-dimensional volume data of the target object. Specifically, the computer can fill the closed structure composed of the boundary contour pixel points of the target object.
[0059] The three-dimensional volume data of the target object is the three-dimensional structure data after the simulation model of the target object is filled.
[0060] The first simulated attenuation projection data is the CT projection data of the target object predicted according to the material and structure information of the target object and the simulated ray parameters. The first simulated attenuation projection data can also be called the theoretical attenuation projection data.
[0061] The computer can obtain the first simulated attenuation projection data according to the material of the target object and the actual acquisition process of the simulated CT image.
[0062] The three-dimensional simulation image of the target object is a reconstructed image of the target object obtained by a computer performing three-dimensional reconstruction on the target object.
[0063] Specifically, the computer can perform reconstruction on the first simulation attenuation projection data of the target object by using a CT image reconstruction algorithm to obtain a simulated CT image of the target object.
[0064] CT image reconstruction algorithms can include: back-projection method, iterative reconstruction algorithm, analytical method, etc.
[0065] As an implementation manner of the present application, the computer can use the FDK (Filtered backprojection) algorithm to reconstruct the first simulation attenuation projection data of the target object.
[0066] Principle of the FDK algorithm: By measuring and operating on the X-ray lines passing through the cross-section of the object, the absorption coefficients corresponding one-to-one to the tomographic spatial positions of the object are obtained, so as to restore the structural information of the object cross-section.
[0067] Exemplarily, assuming that the method for acquiring the scanned image of the workpiece of the present application is applied to industrial manufacturing, the computer can obtain the simulation model of the target object according to the computer-aided design file of the target object, and obtain the boundary contour pixel point information of the simulation model through discrete sampling. The computer can fill the closed structure composed of the boundary contour pixel points of the simulation model of the target object to obtain the three-dimensional volume data of the target object. The computer generates the first simulation attenuation projection data of the target object according to the three-dimensional volume data of the target object and the actual generation process of the CT image, and reconstructs the three-dimensional simulation image of the target object according to the first simulation attenuation projection data.
[0068] In this embodiment, by simulating the physical process of CT scanning by the computer, without performing actual CT detection, various workpiece CT images can be generated according to the three-dimensional volume data of the target object and the relevant parameters of CT image scanning, improving the efficiency of acquiring CT scanned images and the economy of image acquisition.
[0069] In the embodiment of the present application, before filling the simulation model according to the boundary contour pixel point information of the simulation model of the target object to obtain the three-dimensional volume data of the target object, it includes:
[0070] Obtain the target input for the simulation model;
[0071] In response to the target input, update the boundary contour pixel point information of the simulation model to obtain the updated boundary contour pixel point information;
[0072] Filling the target object according to the boundary contour pixel point information of the simulation model of the target object to obtain the three-dimensional volume data of the target object, including:
[0073] Based on the updated boundary contour pixel point information, filling the simulation model of the target object to obtain the three-dimensional volume data of the simulation model of the target object after updating the boundary contour pixel point information.
[0074] The target input can be an input for modifying the boundary contour pixels of the simulation model. For example, changing the sparsity of the boundary contour pixels or deleting some boundary contour pixels, etc.
[0075] The computer can modify the boundary contour pixels of the simulation model of the target object according to the corresponding target input to obtain the modified boundary contour pixels of the simulation model of the target object.
[0076] Filling the simulation model of the target object can be filling the simulation model according to the boundary contour pixel point information of the modified simulation model of the target object to generate the three-dimensional volume data of the target object. Specifically, the computer can fill the closed structure formed by the boundary contour pixels of the modified target object.
[0077] Exemplarily, assuming that the method for obtaining the scanned image of the workpiece in the present application is applied to industrial manufacturing, the computer can obtain an input instruction for the simulation model of the target object, modify the boundary contour pixels of the target object according to the input instruction, and fill the closed structure formed by the modified boundary contour pixels of the target object to obtain the three-dimensional volume data of the target object.
[0078] In this embodiment, by responding to the input instruction, the computer can modify the boundary contour pixels of the simulation model of the target object, simulate the situation where there are holes or cracks in the target object or workpiece, and simulate and generate a CT scanned image of the defective workpiece. By manually modifying the boundary contour pixels of the simulation model of the target object, defects such as holes and cracks can be artificially created to achieve the non-destructive testing task of defect detection, and the resources consumed in actual testing can be saved through computer simulation.
[0079] In the embodiment of the present application, before obtaining the first simulated attenuation projection data of the target object according to the three-dimensional volume data of the target object, it further includes:
[0080] Obtaining the material information of each part of the simulation model of the target object and the physical parameters of the simulated rays;
[0081] Obtaining the first simulated attenuation projection data of the target object according to the three-dimensional volume data of the target object, including:
[0082] Obtain the first simulated attenuation projection data of the target object based on the material information of each part of the target object simulation model and the physical parameters of the simulated rays.
[0083] The simulated rays are the rays emitted by the ray source during the actual generation process of computer-simulated CT images, such as X-rays. The physical parameters of the simulated rays can refer to the relevant parameters of the actual rays. Specifically, the physical parameters of the simulated rays can include the energy spectrum information of the simulated rays.
[0084] The computer can obtain the materials and material properties corresponding to each part of the simulation model of the target object. The material properties can include the absorption coefficients of each material for different rays.
[0085] The materials corresponding to each part of the simulation model of the target object can be determined according to the design requirements of the target object or according to the information in the design document of the target object, or can be specified by the user input.
[0086] The computer can obtain the material information of each part of the target object from the design document of the target object, or can obtain the material information of the target object according to the information input by the user. Specifically, the computer can obtain the first simulated attenuation projection data of the target object according to the material of the target object and the actual acquisition process of the simulated CT image.
[0087] Exemplarily, assuming that the method for obtaining the scanned image of the workpiece in the present application is applied to industrial manufacturing, the computer can obtain the material information and parameter information of the simulated rays of the simulation model of the target object, and obtain the first simulated attenuation projection data of the target object by means of computer simulation according to the material information and parameter information of the simulated rays of the target object.
[0088] In this embodiment, by obtaining the material parameters of each part of the simulation model of the target object and the physical parameters of the simulated rays, the computer can simulate the CT image generation process to obtain the first simulated attenuation projection data of the target object. Obtaining the first simulated attenuation projection data of the target object by means of computer simulation avoids the actual scanning process required for obtaining CT images, and can save time and computer resources.
[0089] In the embodiment of the present application, obtaining the first simulated attenuation projection data of the target object based on the material information of each part of the target object simulation model and the physical parameters of the simulated rays includes:
[0090] Assign values to the three-dimensional volume data of the target object based on the material information and the physical parameters of the simulated rays to obtain the three-dimensional volume data of the assigned target object;
[0091] Obtain the path information of the preset ray source to the detector unit;
[0092] According to the path information, perform a forward projection process on the three-dimensional volume data of the target object after assignment to obtain the first simulated attenuation projection data of the target object.
[0093] Assigning values to the three-dimensional volume data of the target object can be to assign each part of the material of the three-dimensional volume data of the target object and the corresponding ray attenuation coefficient of the material to the corresponding parts of the three-dimensional volume data of the target object.
[0094] Linear attenuation coefficient: The linear attenuation coefficient μ represents the probability that a photon interacts with matter when passing through a unit path.
[0095] The computer can calculate the ray attenuation coefficient μ of different materials according to the ray energy spectrum f(E) and material information. i 。
[0096] The ray attenuation coefficient corresponding to the material of the target object is the sum of the products of the size of the unit pixel of the target object and the linear attenuation coefficient of the ray corresponding to the unit pixel.
[0097] The specific formula is as follows:
[0098]
[0099] Among them, K is the number of segments of the energy spectrum f(E), j is the energy segment index, and E j is the ray energy of the j-th energy segment, is the linear attenuation coefficient of the i-th material for the ray with energy E j and d is the size of the unit pixel in the three-dimensional volume data.
[0100] The ray attenuation coefficient corresponding to the material of the target object can be assigned to the corresponding materials of each part of the three-dimensional volume data of the target object.
[0101] The preset ray source and detector unit can be the ray source and detector unit in the computer simulation of the actual CT image acquisition process.
[0102] The computer can simulate the positional relationship between the detector unit and the ray source in the actual CT image acquisition process and obtain the path from the preset ray source to the detector unit according to the geometric parameters actually collected by the system.
[0103] The forward projection process is the process of collecting projection data using integral transformation during the CT scanning process.
[0104] The computer can obtain the first simulated attenuation projection data of the target object by calculating the line integral of the attenuation coefficient of the detected object passing through the path l n from the ray source to the detector unit.
[0105] Exemplarily, assuming that the method for obtaining a scanned image of a workpiece of the present application is applied to industrial manufacturing, a computer can obtain the linear attenuation coefficient of each part of the target object's material for the ray according to the material information of each part of the target object and the physical parameters of the simulated ray, and assign the linear attenuation coefficient of the corresponding material to the corresponding part of the three-dimensional volume data of the target object; the computer performs forward projection on the three-dimensional volume data of the target object according to the corresponding parameters of each part and the path from the simulated ray source to the detector unit to obtain the first simulated attenuation projection data of the target object.
[0106] In this embodiment, the computer can simulate the CT scanning process, and perform forward projection on the three-dimensional volume data of the target object according to the parameter information of each part of the three-dimensional volume data of the target object, the parameter information of the simulated ray, and the path of the simulated CT scanning, so as to obtain the first simulated attenuation projection data of the target object.
[0107] In the embodiment of the present application, reconstructing the first simulated attenuation projection data to obtain a three-dimensional simulated image of the target object includes:
[0108] Adding Poisson noise to the first simulated attenuation projection data to obtain a second simulated attenuation projection data;
[0109] Reconstructing the second simulated attenuation projection data according to the CT image reconstruction algorithm to obtain a three-dimensional simulated image of the target object.
[0110] In the embodiment of the present application, Poisson noise is a noise model that conforms to the Poisson distribution model. The second simulated attenuation projection data is the first simulated attenuation projection data after adding Poisson noise.
[0111] Exemplarily, the computer can preprocess the first simulated attenuation projection data, such as adding Poisson noise to the first simulated attenuation projection data to obtain a second simulated attenuation projection data. The computer reconstructs and generates a three-dimensional simulated image of the target object according to the second simulated attenuation projection data.
[0112] In this embodiment, by adding Poisson noise to the first simulated attenuation projection data of the target object, real projection data can be simulated, and the accuracy of the simulated image can be improved.
[0113] Regarding step 103, the computer can input the three-dimensional simulated image into the target prediction model, and use the image output by the target prediction model as the computed tomography (CT) image of the target object. The target prediction model is a neural network model trained by historical training samples, and the historical training samples include the three-dimensional simulated images and CT images of historical workpieces.
[0114] The target prediction model can be a neural network model, which can endow the features of the actual CT scan image to the simulation image to make the simulation data approximate the actual CT scan data. The image output by the target prediction model is the CT prediction image of the target object.
[0115] The neural network model can be a generative adversarial neural network, specifically Cycle GAN.
[0116] The historical training samples of the target prediction model can be the actual CT images and simulation CT images of historical workpieces.
[0117] The computer can use the Pytorch deep learning tool to train the Cycle-GAN network for style transfer. Two types of datasets, A and B, are required for training. After training, the model can transfer and transform the image styles in datasets A and B. Among them, the required dataset A for training is the set of images obtained by scanning with an actual CT system, and the required training set B is the set of simulation images generated by the method for generating scanned images of workpieces provided in the embodiments of the present application.
[0118] Exemplarily, assuming that the method for obtaining the scanned image of the workpiece in the present application is applied to industrial manufacturing, the computer can input the generated three-dimensional simulation image of the target object into the target prediction model, and use the target prediction model to endow the features of the actual CT image to the three-dimensional simulation image to obtain the computed tomography (CT) image of the target object.
[0119] The embodiments of the present application also provide a specific implementation method:
[0120] Step 1: According to the detection task and the characteristics of the detection object, use computer-aided design software to design the computer-aided design drawing of the object to be simulated. The simulation model of the object to be simulated is as Figure 2 shown
[0121] Step 2: Read the computer-aided design file of the object to be simulated in Matlab software to obtain the point and surface data of the object to be simulated.
[0122] As Figure 3 shown, according to the point and surface data of the object to be simulated, perform discretized sampling in Matlab software to obtain the pixel points of the boundary contour of the volume data of the object to be simulated.
[0123] Step 3: As Figure 4 shown, perform three-dimensional filling on the boundary contour pixel points of the object to be simulated obtained by the above method to obtain the three-dimensional volume data V1 of the object to be simulated. For non-destructive testing tasks focusing on defect detection, holes, cracks and other defects can be artificially created by changing the pixel values in the three-dimensional volume data of the object to be simulated.
[0124] Step 4: Assign values to the 3D volume data of the simulated object. The value of each pixel should be determined by the material type at that position and the energy spectrum of the radiation source used in the CT scan. Its value can be calculated by the following formula:
[0125]
[0126] where K is the number of segments of the energy spectrum f(E), j is the energy segment index, and E j is the ray energy of the j-th energy segment, is the linear attenuation coefficient of the i-th material for the ray with energy E j , and d is the size of a unit pixel in the volume data V.
[0127] Perform forward projection on the 3D volume data V1 according to the actual geometric parameters collected by the system to obtain the theoretical attenuation projection data The forward projection process is to calculate the line integral of the attenuation coefficient of the object being detected passing through the path l n from the ray source to the detector unit, as shown in the following formula:
[0128]
[0129] As Figure 5 shown, after adding Poisson noise to the theoretical attenuation projection data, use the FDK or iterative algorithm for 3D reconstruction to obtain the reconstructed volume data V2.
[0130] Step 5: Use the Pytorch deep learning tool to train the Cycle-GAN network for style transfer. Two types of datasets, A and B, are required for training. The trained model can transfer and transform the image styles in datasets A and B. Among them, the required dataset A for training is the set of images obtained by scanning with an actual CT system, and the required training set B is the set of simulated images V2 obtained in the above steps. The images obtained by scanning with the actual CT system in dataset A can be images such as Figure 6 shown.
[0131] Step 6: Input the tomographic images of the reconstructed volume data V2 obtained in the above steps into the Cycle-GAN network model obtained in Step 5 to obtain the simulated images I of the tomographic images, and combine the simulated images of all tomographic images to form the simulated volume data V3. The simulated images of the tomographic images output by Cycle-GAN are as Figure 7 shown.
[0132] Step 6: Repeat the above steps to obtain a large number of simulated volume data V3, and summarize them to obtain the final dataset S. The number of reconstructions is determined by the number of workpiece types required.
[0133] As Figure 8As shown in the figure, the present application further provides a scanning image generation device 800 for a workpiece, including:
[0134] An acquisition module 801, configured to acquire a computer-aided design file of a target object;
[0135] A reconstruction module 802, configured to perform three-dimensional simulation reconstruction on the computer-aided design file of the target object to obtain a three-dimensional simulation image of the target object;
[0136] A prediction module 803, configured to input the three-dimensional simulation image into a target prediction model, and use the image output by the target prediction model as a computed tomography (CT) image of the target object. The target prediction model is a neural network model trained by historical training samples, and the historical training samples include three-dimensional simulation images and CT images of historical workpieces.
[0137] The scanning image generation device for a workpiece according to the embodiments of the present application can obtain a simulated CT image of a target object according to the computer-aided design file of the target object, and endow the simulated image with the characteristics of an actual CT scan image by using a pre-trained neural network, so as to generate a CT scan image of the target object. The embodiments of the present application do not require actual CT detection. By means of computer simulation, the physical process of CT scanning is simulated, and a neural network is used to endow the simulated image with actual image characteristics to generate CT images of various workpieces, improving the efficiency of obtaining CT scan images and the economy of image acquisition.
[0138] In some embodiments of the present application, the reconstruction module 802 includes:
[0139] A first acquisition unit, configured to acquire boundary contour pixel point information of a simulation model of the target object through the computer-aided design file;
[0140] A filling unit, configured to fill the simulation model according to the boundary contour pixel point information of the simulation model of the target object to obtain three-dimensional volume data of the target object;
[0141] A second acquisition unit, configured to acquire first simulated attenuation projection data of the target object according to the three-dimensional volume data of the target object;
[0142] A reconstruction unit, configured to reconstruct the first simulated attenuation projection data to obtain a three-dimensional simulation image of the target object.
[0143] In some embodiments of the present application, the reconstruction module 802 further includes:
[0144] A third acquisition unit, configured to acquire a target input to the simulation model;
[0145] An update unit, configured to update the boundary contour pixel point information of the simulation model in response to a target input, so as to obtain updated boundary contour pixel point information;
[0146] The filling unit is specifically configured to:
[0147] Based on the updated boundary contour pixel point information, fill the simulation model of the target object to obtain three-dimensional volume data of the simulation model of the target object after updating the boundary contour pixel point information.
[0148] In some embodiments of the present application, the reconstruction module 802 further includes:
[0149] A fourth acquisition unit, configured to acquire the material information of each part of the simulation model of the target object and the physical parameters of the simulation ray;
[0150] The second acquisition unit is specifically configured to:
[0151] Obtain the first simulation attenuation projection data of the target object according to the material information of each part of the simulation model of the target object and the physical parameters of the simulation ray.
[0152] In some embodiments of the present application, the second acquisition unit is further specifically configured to:
[0153] Assign values to the three-dimensional volume data of the target object based on the material information and the physical parameters of the simulation ray, so as to obtain the three-dimensional volume data of the target object after assignment;
[0154] Obtain the path information from the preset ray source to the detector unit;
[0155] According to the path information, perform forward projection processing on the three-dimensional volume data of the target object after assignment, so as to obtain the first simulation attenuation projection data of the target object.
[0156] In some embodiments of the present application, the reconstruction unit is further specifically configured to:
[0157] Add Poisson noise to the first simulation attenuation projection data to obtain the second simulation attenuation projection data;
[0158] Reconstruct the second simulation attenuation projection data according to the CT image reconstruction algorithm to obtain the three-dimensional simulation image of the target object.
[0159] Figure 8 Each module / unit in the device shown has the functions of each step in the method embodiment and can achieve the corresponding technical effects. For the sake of brevity, they are not described herein again.
[0160] Figure 9 The hardware structure diagram of the electronic device 900 provided by the embodiment of the present application is shown.
[0161] The electronic device 900 may include a processor 901 and a memory 902 storing computer program instructions.
[0162] Specifically, the above-mentioned processor 901 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured as one or more integrated circuits for implementing the embodiments of the present application.
[0163] The memory 902 may include a mass storage for data or instructions. By way of example and not limitation, the memory 902 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. In a suitable case, the memory 902 may include a removable or non-removable (or fixed) medium. In a suitable case, the memory 902 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 902 is a non-volatile solid-state memory.
[0164] The memory may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage media device, an optical storage media device, a flash memory device, an electrical, optical, or other physical / tangible memory storage device. Thus, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of the present application.
[0165] The processor 901 reads and executes the computer program instructions stored in the memory 902 to implement the scanning image generation method of any one of the workpieces in the above embodiments.
[0166] In one example, the electronic device 900 may further include a communication interface 909 and a bus 910. Among them, as Figure 9 shown, the processor 901, the memory 902, and the communication interface 909 are connected through the bus 910 to complete communication with each other.
[0167] The communication interface 909 is mainly used to implement communication between each module, device, unit, and / or device in the embodiments of the present application.
[0168] The bus 910 includes hardware, software, or both, and couples the components of the online data flow metering device to each other. By way of example and not limitation, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable bus or a combination of two or more of these. Where appropriate, the bus 910 may include one or more buses. Although the embodiments of the present application describe and illustrate specific buses, the present application contemplates any suitable bus or interconnect.
[0169] The electronic device 900 can execute the method for generating a scanned image of a workpiece in the embodiments of the present application, thereby implementing the combination Figure 1 and Figure 8 the method and device for generating a scanned image of a workpiece described.
[0170] In addition, in combination with the method for generating a scanned image of a workpiece in the above embodiments, the embodiments of the present application can be implemented by providing a computer storage medium. Computer program instructions are stored on the computer storage medium; when the computer program instructions are executed by a processor, any one of the methods for generating a scanned image of a workpiece in the above embodiments is implemented.
[0171] It should be clear that the present application is not limited to the specific configurations and processes described above and illustrated in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and illustrated as examples. However, the method process of the present application is not limited to the specific steps described and illustrated, and those skilled in the art can make various changes, modifications, and additions, or change the order between steps after understanding the spirit of the present application.
[0172] The functional blocks shown in the above structural block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, and so on. When implemented in software, the elements of the present application are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted via a data signal carried in a carrier wave over a transmission medium or a communication link. A "machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical discs, hard disks, fiber optic media, radio frequency (RF) links, and so on. The code segment can be downloaded via a computer network such as the Internet, an intranet, and so on.
[0173] It should also be noted that in the exemplary embodiments mentioned in the present application, some methods or systems are described based on a series of steps or devices. However, the present application is not limited to the order of the above steps, that is, the steps can be executed in the order mentioned in the embodiments, or different from the order in the embodiments, or several steps can be executed simultaneously.
[0174] As described above with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present application. It should be understood that each block in the flowcharts and / or block diagrams, and the combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the functions / actions specified in one or more blocks of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each block in the block diagram and / or flowchart, and the combinations of blocks in the block diagram and / or flowchart, can also be implemented by dedicated hardware that performs the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0175] The above is only the specific implementation manner of the present application. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, modules, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein. It should be understood that the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of various equivalent modifications or substitutions within the technical scope disclosed in the present application, and these modifications or substitutions should all be covered within the protection scope of the present application.
Claims
1. A method for generating a scanned image of a workpiece, characterized in that, Including: Obtain the computer-aided design file of the target object; Obtain the boundary contour pixel point information of the simulation model of the target object through the computer-aided design file; Fill the simulation model according to the boundary contour pixel point information of the simulation model of the target object to obtain the three-dimensional volume data of the target object; wherein, the simulation model is filled with volume data pixels, and the formula for the pixel physical size of the volume data pixels is as follows: d x,y,z is the physical pixel size of the volume data pixel in the x, y, and z directions, S x,y,z is the actual physical size of the simulation model in the x, y, and z directions, N x,y,z is the number of sampling points in the x, y, and z directions; Obtain the material information of each part of the simulation model of the target object and the physical parameters of the simulation ray; Assign values to the three-dimensional volume data of the target object based on the material information and the physical parameters of the simulation ray to obtain the three-dimensional volume data of the assigned target object; Obtain the path information from the preset ray source to the detector unit; Perform forward projection processing on the three-dimensional volume data of the assigned target object according to the path information to obtain the first simulation attenuation projection data of the target object; Add Poisson noise to the first simulation attenuation projection data to obtain the second simulation attenuation projection data; Reconstruct the second simulation attenuation projection data according to the CT image reconstruction algorithm to obtain the three-dimensional simulation image of the target object; Input the three-dimensional simulation image into the target prediction model, and use the image output by the target prediction model as the computed tomography (CT) image of the target object. The target prediction model is a neural network model trained by historical training samples, and the historical training samples include the three-dimensional simulation images and CT images of historical workpieces; wherein, the neural network model has a style transfer function.
2. The method according to claim 1, wherein Before filling the simulation model according to the boundary contour pixel point information of the simulation model of the target object to obtain the three-dimensional volume data of the target object, it includes: Obtain the target input to the simulation model; In response to the target input, update the boundary contour pixel point information of the simulation model to obtain the updated boundary contour pixel point information; The filling the target object according to the boundary contour pixel point information of the simulation model of the target object to obtain the three-dimensional volume data of the target object includes: Based on the updated boundary contour pixel point information, fill the simulation model of the target object to obtain the three-dimensional volume data of the simulation model of the target object after updating the boundary contour pixel point information.
3. A scanning image generation device for a workpiece, characterized in that, The device includes: An acquisition module, configured to acquire the computer-aided design file of the target object; A reconstruction module, configured to obtain the boundary contour pixel point information of the simulation model of the target object through the computer-aided design file; fill the simulation model according to the boundary contour pixel point information of the simulation model of the target object to obtain the three-dimensional volume data of the target object; wherein, the simulation model is filled with volume data pixels, and the formula for the pixel physical size of the volume data pixels is as follows: d x,y,z is the physical pixel size of the volume data pixel in the x, y, and z directions, S x,y,z is the actual physical size of the simulation model in the x, y, and z directions, N x,y,z is the number of sampling points in the x, y, and z directions; obtaining the material information of each part of the simulation model of the target object and the physical parameters of the simulation ray; assigning values to the three-dimensional volume data of the target object based on the material information and the physical parameters of the simulation ray to obtain the three-dimensional volume data of the assigned target object; obtaining the path information from the preset ray source to the detector unit; according to the path information, performing forward projection processing on the three-dimensional volume data of the assigned target object to obtain the first simulated attenuation projection data of the target object; adding Poisson noise to the first simulated attenuation projection data to obtain the second simulated attenuation projection data; reconstructing the second simulated attenuation projection data according to the CT image reconstruction algorithm to obtain the three-dimensional simulation image of the target object; A prediction module, configured to input the three-dimensional simulation image into a target prediction model, and use the image output by the target prediction model as the computed tomography (CT) image of the target object, where the target prediction model is a neural network model trained by historical training samples, and the historical training samples include three-dimensional simulation images and CT images of historical workpieces; wherein, the neural network model has a style transfer function.
4. An electronic device, characterized in that, The device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the method for generating a scanned image of a workpiece according to any one of claims 1-2 is implemented.
5. A computer-readable storage medium, characterized in that, Computer program instructions are stored on the computer-readable storage medium, and when the computer program instructions are executed by a processor, the method for generating a scanned image of a workpiece according to any one of claims 1-2 is implemented.
6. A computer program product, characterized in that, When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device is caused to execute the method for generating a scanned image of a workpiece according to any one of claims 1-2.
Citation Information
Patent Citations
Incomplete scanning CT image reconstruction method based on CAD model
CN111583389A
Spiral CT image reconstruction method and device based on neural network and storage medium
CN112085829A