Monte Carlo dose calculation method, device, equipment and medium for particles
By converting the target area into a geometric grid and using a ray tracing engine to calculate the collision information between particles and mesh, the problem of the goCMC engine being difficult to accelerate the calculation of particle dose deposition is solved, and efficient particle Monte Carlo dose calculation is achieved.
Patent Information
- Application Number
- CN202410396585.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-02
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2044-04-02
AI Technical Summary
In the prior art, it is difficult for the goCMC engine to accelerate the calculation of the reaction process of particles in matter, the transport and energy deposition of particles in the medium through hardware.
Monte Carlo dose deposition information of particles is calculated by converting the target area of electronic computed tomography into a geometric grid and using a ray tracing engine to traverse the collision information of particles with the geometric grid during transportation.
The calculation efficiency of particle Monte Carlo dose calculation is improved, and efficient accelerated calculation of particle transport process is achieved.
Smart Images

Figure CN118526727B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the fields of physics and computers, specifically to the application of physics and computer technology in the field of radiation medicine, and more specifically to a particle Monte Carlo dose calculation method, device, equipment, medium and program product based on ray tracing. Background Art
[0002] In the field of radiotherapy, the reaction process of particles in matter and the transport and energy deposition of particles in the medium are usually simulated based on the Monte Carlo method. In the prior art, the goCMC engine is used to track the deposition dose of particles by calculating the vertical distance from particles to voxels. However, it is difficult for the goCMC engine to accelerate the calculation process through hardware. Summary of the invention
[0003] In view of the above problems, the present disclosure provides a particle Monte Carlo dose calculation method, apparatus, device, medium and program product that improves calculation efficiency.
[0004] According to a first aspect of the present disclosure, a method for calculating a Monte Carlo dose of a particle is provided, comprising: converting a target area of a computed tomography scan into a geometric grid; simulating a particle transport process within the target area; and traversing collision information between the particle and the geometric grid during the transport process through a ray tracing engine to calculate the Monte Carlo dose deposition information of the particle.
[0005] According to an embodiment of the present disclosure, a ray tracing engine is used to traverse the collision information of particles with a geometric grid during transport, and the Monte Carlo dose deposition information of particles is calculated, including: determining a plurality of cube objects included in the geometric grid, each cube object including at least one voxel; traversing the collision information of particles with the plurality of cube objects during transport by a ray tracing engine to obtain a target cube object, the target cube object being a cube object that collides with the particle among the plurality of cube objects; and determining information required for the Monte Carlo dose deposition calculation process of the particle based on the chemical composition information of at least one voxel in the target cube object.
[0006] According to an embodiment of the present disclosure, a target cube object is obtained by traversing collision information between particles and multiple cube objects during transportation through a ray tracing engine, including: instantiating the attribute value of at least one voxel included in each of the multiple cube objects into a global coordinate system and storing them in an acceleration structure, and the multiple cube objects belong to the acceleration structure after being instantiated; obtaining collision information between particles and multiple voxel instantiation nodes by traversing multiple voxel instantiation nodes included in the acceleration structure; and determining the target cube object based on the collision information.
[0007] According to an embodiment of the present disclosure, the Monte Carlo dose deposition information of the particle is determined according to the chemical composition information of at least one voxel in the target cube object, including: calling the shader binding table bound to the target cube object according to the collision information, the shader binding table indicating the called shader; in the case where it is determined that the most recent hit shader is called, determining the target voxel associated with the most recent hit shader, and the particle collides with the target voxel during a step-length transport process; and calculating the Monte Carlo dose deposition information of the particle according to the state information of the particle and the chemical composition information of the target voxel; wherein the index number of the target voxel in the acceleration structure is recorded in the light data to which the particle belongs, and the chemical composition information can be obtained based on the index number.
[0008] According to an embodiment of the present disclosure, the Monte Carlo dose deposition information of the particle is calculated based on the chemical composition information of at least one voxel in the target cube object, and also includes: when it is determined that a miss shader is called, determining that the particle does not collide with all voxels in the acceleration structure during a step-length transport process.
[0009] According to an embodiment of the present disclosure, a target cube object is obtained by traversing the collision information of particles with multiple cube objects during transportation through a ray tracing engine, including: dividing the target area to obtain multiple areas, each of the multiple areas including at least one cube object; and constructing a tree data structure corresponding to the instance acceleration structure with each of the multiple areas as a node; determining the collision information of the particle with the multiple nodes by traversing the tree data structure; and determining the target cube object based on the collision information.
[0010] According to an embodiment of the present disclosure, each cube object includes multiple vertices and multiple triangular face primitives; by traversing a tree data structure, the collision information between a particle and multiple nodes is determined, including: setting an axis-aligned bounding box for each cube object of the multiple cube objects; and upon determining the information of the intersection of the particle with the axis-aligned bounding box in the area corresponding to any one of the multiple nodes, calculating the intersection of the triangular fragments included in the axis-aligned bounding box with the particle, and obtaining the collision information between the particle and the multiple vertices and multiple triangular face primitives.
[0011] A second aspect of the present disclosure provides a device for calculating a Monte Carlo dose of particles, comprising: a conversion module for converting a target area of an electronic computed tomography scan into a geometric grid; a simulation module for simulating a transport process of particles in the target area; and a calculation module for traversing collision information between particles and the geometric grid during the transport process through a ray tracing engine to calculate Monte Carlo dose deposition information of the particles.
[0012] A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the above-mentioned method for calculating the Monte Carlo dose of particles.
[0013] A fourth aspect of the present disclosure further provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the Monte Carlo dose calculation method of the above-mentioned particles.
[0014] A fifth aspect of the present disclosure further provides a computer program product, comprising a computer program, which implements the above-mentioned method for calculating the Monte Carlo dose of particles when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0016] Figure 1 A system architecture diagram schematically shows a particle Monte Carlo dose calculation method, apparatus, device, medium, and program product according to an embodiment of the present disclosure;
[0017] Figure 2A A flow chart schematically shows a method for calculating a particle Monte Carlo dose according to an embodiment of the present disclosure;
[0018] Figure 2B A schematic diagram schematically shows a geometric grid according to an embodiment of the present disclosure;
[0019] Figure 3A A flowchart of counting collisions between particles and voxels according to an embodiment of the present disclosure is schematically shown;
[0020] Figure 3B Schematically shows a schematic diagram of particle transport within a voxel according to an embodiment of the present disclosure;
[0021] Figure 4A A schematic diagram of a K-dimensional tree according to an embodiment of the present disclosure is schematically shown;
[0022] Figure 4B A schematic diagram of traversing a K-dimensional tree according to an embodiment of the present disclosure is schematically shown;
[0023] Figure 5 A block diagram schematically shows a structure of a device for calculating a particle Monte Carlo dose according to an embodiment of the present disclosure; and
[0024] Figure 6A block diagram of an electronic device suitable for implementing a particle Monte Carlo dose calculation method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0025] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0026] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0027] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0028] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0029] In the technical solutions disclosed in this disclosure, the collection, storage, use, processing, transmission, provision, disclosure and application of user personal information involved are in compliance with the relevant laws and regulations, necessary confidentiality measures are taken, and they do not violate public order and good morals. In the technical solutions disclosed in this disclosure, the user's authorization or consent is obtained before obtaining or collecting user personal information.
[0030] An embodiment of the present disclosure provides a method for calculating a particle Monte Carlo dose, comprising: converting a target area into a geometric grid, the geometric grid comprising a plurality of voxels; simulating a particle transport process within the target area; and counting collisions between particles and a plurality of voxels through a ray tracing model to calculate Monte Carlo dose deposition information of the particles.
[0031] Figure 1The system architecture diagram of the particle Monte Carlo dose calculation method, device, equipment, medium and program product according to the embodiment of the present disclosure is schematically shown. Figure 1 As shown, the application scenario 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0032] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as physical simulation applications, shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0033] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0034] The server 105 may be a server that provides various services, such as a background management server (only an example) that provides support for websites browsed by users using the terminal devices 101, 102, and 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0035] It should be noted that the particle Monte Carlo dose calculation method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the particle Monte Carlo dose calculation device provided in the embodiment of the present disclosure can generally be set in the server 105. The particle Monte Carlo dose calculation method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the particle Monte Carlo dose calculation device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105.
[0036] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.
[0037] The following will be based on Figure 1 The scene described by Figure 2A to Figure 2B , Figure 3A to Figure 3B , Figure 4A to Figure 4B The calculation method of the particle Monte Carlo dose of the disclosed embodiment is described in detail.
[0038] Figure 2A The flowchart of the method for calculating the Monte Carlo dose of particles according to an embodiment of the present disclosure is schematically shown.
[0039] like Figure 2A As shown, the method for calculating the Monte Carlo dose of particles in this embodiment includes operations S210 to S240.
[0040] In operation S210, a target region of computer tomography (CT) is converted into a geometric mesh.
[0041] In the disclosed embodiment, the target region may be a designated region where particles need to be deposited, for example, the target region may be a tumor region that needs to be treated, or may be a region of interest. The target region is a three-dimensional space.
[0042] In the disclosed embodiment, the conversion process may be to obtain a plurality of voxels of the target area and convert the plurality of voxels into a geometric mesh. The geometric mesh includes a plurality of cubic objects, each of which includes at least one voxel, and each of which includes a plurality of vertices and a plurality of triangular facet primitives. The chemical substance within the voxel is considered to be uniform and consistent.
[0043] Figure 2B A schematic diagram of a geometric grid according to an embodiment of the present disclosure is schematically shown.
[0044] like Figure 2B As shown, the geometric grid 200 includes a plurality of cube objects, which form a target region including a plurality of voxels. Each cube object may include at least one voxel.
[0045] Each cube object cube includes 8 vertices 201 and 12 triangles 202. Vertices and triangles can be used to describe various cube structures.
[0046] In operation S220, a transport process of particles is simulated in the target region.
[0047] In the disclosed embodiment, before simulating the transport process, it is necessary to obtain the initial state data of the particles. After obtaining the initial state data of the particles, the transport process of the particles can be executed by the GPU kernel. The particles for simulating the transport process can include multiple batches of particles, and each batch of particles includes multiple particles. Before simulating the transport process for multiple batches of particles, it is also necessary to initialize the GPU context, initialize the dose counter, initialize the primary particle stack and the secondary particle stack, etc.
[0048] In operation S230 , the collision information between the particles and the geometric grid during the transport process is traversed by a ray tracing engine to calculate the Monte Carlo dose deposition information of the particles.
[0049] In the disclosed embodiment, the collision information between particles and multiple vertices and multiple triangular facet primitives can be counted by a ray tracing model. Through the collision information, the position information of the particles in the target area during the transport process can be determined. The vertices and triangular facet primitives in the geometric mesh can be stored in the video memory. When the collision information between particles and multiple vertices and multiple triangular facet primitives is counted by a ray tracing model, the statistics process can be provided with a hardware acceleration effect by a graphics card. For example, the graphics card can be an NVIDIA graphics card or an AMD graphics card.
[0050] In the disclosed embodiment, the particle transport process in the target area is equivalent to the light propagation process, and the particle transport path in the target area is determined by tracing the light propagation path through the ray tracing engine. In addition, the target area is converted into several grids, and the position information of the particles in the transport process can be located, thereby determining the deposition information of the Monte Carlo dose of the particles.
[0051] Combination Figure 3A and 3B Schematic illustration of the transport of particles within a geometric grid.
[0052] Figure 3A The flowchart of counting collision situations between particles and voxels according to an embodiment of the present disclosure is schematically shown. Figure 3B The schematic diagram of particle transport within a voxel according to an embodiment of the present disclosure is schematically shown.
[0053] like Figure 3A As shown, the step of calculating the Monte Carlo dose deposition information of the particles by traversing the collision information of the particles with the geometric grid during the transport process through the ray tracing engine includes operations S310 to S340.
[0054] In operation S310, a plurality of cube objects included in a geometric mesh is determined.
[0055] In operation S320, collision information between the particle and multiple cubic objects during the transport process is traversed by a ray tracing engine to obtain a target cubic object, where the target cubic object is a cubic object among the multiple cubic objects that collides with the particle.
[0056] In operation S330 , Monte Carlo dose deposition information of particles is determined according to chemical composition information of at least one voxel in the target cubic object.
[0057] like Figure 3B As shown, the target area 301 is geometrically meshed to obtain a geometric mesh 302, which includes a plurality of cube objects. Figure 3B The schematic illustration is made using a two-dimensional plane. For example, the geometric grid 302 may be a cross section of a three-dimensional geometric grid.
[0058] The particle P is transported in the geometric grid 302, and the particle P collides with the cube object cube in the geometric grid 302. By counting the collision information between the particle P and the cube object cube in the geometric grid 302, the transport path of the particle P in the geometric grid 302 can be determined.
[0059] For example, during the transport process, the particle P only collides with some of the cube objects in the geometric grid 302, so the cube objects that collide with the particle P among the multiple cube objects included in the geometric grid 302 can be determined as the target cube objects. It can be understood that the particle P is transported in the target cube. Figure 3B The arrows shown exemplarily illustrate the transport path of particles P.
[0060] In the embodiment of the present disclosure, each cubic object includes at least one voxel, and it can be considered that the particle P has collided with at least one voxel in the target cubic object. The chemical composition information may be the chemical elements included in the voxels and the content of the chemical elements.
[0061] In the embodiment of the present disclosure, the type of light is the type of particle. The particle may include primary particles and secondary particles, for example, the particle may be a proton, helium ion, lithium ion, carbon ion, etc.
[0062] Through the implementation of the present disclosure, the transport path of the particles is approximated to the propagation path of the light, and the transport process of the particles is determined by the ray tracing model. In addition, the voxels in the target area are described by vertices and triangular facet primitives. When the collision information between particles and voxels is counted, the collision information between particles and vertices and triangular facet primitives can be counted. After the vertices and triangular facet primitives are stored in the video memory, the hardware acceleration effect can be provided by the graphics card, which is convenient for speeding up the calculation rate when counting the collision information between particles and vertices and triangular facet primitives.
[0063] In some embodiments, operation S320, traversing the collision information between the particle and multiple cube objects during the transport process through a ray tracing engine to obtain a target cube object, includes: instantiating the attribute value of at least one voxel included in each of the multiple cube objects into the global coordinate system and storing them in an acceleration structure, and the multiple cube objects belong to the acceleration structure after being instantiated; obtaining the collision information between the particle and the multiple voxel instantiation nodes by traversing the multiple voxel instantiation nodes included in the acceleration structure; and determining the target cube object based on the collision information.
[0064] In the disclosed embodiment, the attribute value may be a CT value corresponding to a voxel, and the CT value is used to describe the material of the voxel. The CT value of the voxel is stored in a geometry acceleration structure (GAS), which enables the threads in the GPU to quickly obtain the CT value when performing ray tracing.
[0065] For example, the geometric information of the voxel may also be stored in the GAS. The geometric information may be the position information of the cube object where the voxel is located in the global coordinate system.
[0066] In the embodiment of the present disclosure, the GAS may be established based on primitives, for example, triangular facet primitives included in a cube object. A geometric acceleration structure may be used to manage the triangular facet primitives of each cube object.
[0067] In the disclosed embodiment, by traversing the GAS using the GPU, the collision relationship between multiple triangular facet primitives managed by the GAS and particles can be determined. The triangular facet primitives managed by the GAS are positioned based on the global coordinate system, so the position information of the triangular facet primitives determined based on the collision information is also the position information under the global coordinate system. The global coordinate system can be considered to be established based on the entire geometric mesh, so the position information of the triangular facet primitives in the entire geometric mesh can be determined based on the collision information.
[0068] In the disclosed embodiment, a voxel instantiation node may represent a voxel, and collision information between a particle and each voxel may be determined by traversing multiple voxel instantiation nodes. The collision information may indicate whether a particle has collided with a voxel instantiation node. For example, whether a collision has occurred is determined based on a collision relationship between a particle and a triangular facet primitive corresponding to the voxel.
[0069] In the disclosed embodiment, the cube object is instantiated into GAS, and the triangular facet primitives included in the cube object are managed by GAS, so that the multiple voxels included in the target object can be managed by GAS. This can also make full use of the traversal capability of the ray tracing engine for GAS, determine the collision information between the particles and the voxels in the target area, and thus determine the target cube object from the multiple cube objects.
[0070] In some embodiments, operation S330 determines the Monte Carlo dose deposition information of the particle based on the chemical composition information of at least one voxel in the target cube object, including: calling the shader binding table bound to the target cube object based on the collision information, the shader binding table indicating the called shader; when it is determined that the most recent hit shader is called, determining the target voxel associated with the most recent hit shader, and the particle collides with the target voxel during a step-length transport process; and calculating the Monte Carlo dose deposition information of the particle based on the state information of the particle and the chemical composition information of the target voxel; wherein the index number of the target voxel in the acceleration structure is recorded in the light data to which the particle belongs.
[0071] In some embodiments, operation S330 determines the Monte Carlo dose deposition information of the particle based on the chemical composition information of at least one voxel in the target cube object, including: also including: when it is determined that a miss shader is called, determining that the second target voxel associated with the miss shader is the voxel instance recorded with the index number in the corresponding acceleration structure recorded in the ray data to which the particle belongs, and determining that the particle does not collide with all voxels in the acceleration structure during a step-length transport process; and calculating the Monte Carlo dose deposition information of the particle based on the chemical composition information of the voxel instance recorded with the index number in the corresponding acceleration structure recorded in the ray data to which the particle belongs.
[0072] In the disclosed embodiment, after the GPU context is initialized, a shader record is set. The shader binding table includes a plurality of shader records. The shader record is bound to the meshed voxel, and the bound shader record is used to confirm the type of particle and the response shader of the voxel after the particle passes a step calculation according to the collision information with the voxel.
[0073] For example, in the ray tracing engine, the type of light is set, the type of light corresponds to the type of particle, and then the light generation shader corresponding to each light is bound to the shader binding table. By traversing the geometric acceleration structure and the corresponding shader binding table, the particle collision information and the corresponding response shader are obtained.
[0074] In the disclosed embodiment, the shader binding table includes a plurality of shader records, including a shader record that may include a ray gengeneration shader, a closest hit shader, and a miss shader, etc. A corresponding shader record in the shader binding table is bound to each voxel, and each voxel is bound to at least one closest hit shader and a miss shader in the shader binding table. Through the plurality of shader records, the shader corresponding to the collision response of the particle with the voxel after a step transport is determined.
[0075] For example, whether the particle collides with the target voxel associated with the nearest hit shader after one step of transport can be determined by whether the corresponding nearest hit shader indicated by the nearest hit shader record responds. If the nearest hit shader record indicates that the corresponding nearest hit shader responds, the particle collides with the target voxel associated with the nearest hit shader after one step of transport. The target voxel is a voxel in the target cube object.
[0076] In the disclosed embodiment, the light generating shader bound to each voxel records the state parameters of the particle. The state parameters of the particle are generated by the light generating shader bound to each voxel, and the initial state information of the particle during the transport process is calculated according to the state parameters. For example, the information includes energy, starting position, emission direction, etc.
[0077] After each particle is transported for a step, the geometric acceleration structure GAS is traversed to determine whether the particle collides with a voxel in the geometric acceleration structure GAS. When it is determined that the particle collides with a voxel, the nearest hit shader bound to the voxel and the type of particle is called. The particle transport process is calculated by threads, and the transport process is completed by step-by-step iterative calculation. When the particle energy is completely attenuated through dose deposition during the transport process, the thread corresponding to the particle terminates the calculation.
[0078] In the embodiment of the present disclosure, when the target area is an area of interest, the thread may terminate the calculation after the particle leaves the area of interest.
[0079] The multiple voxels managed by the geometric acceleration structure GAS each have their own index number in the geometric acceleration structure GAS. When it is determined that a particle collides with a target voxel, the index number record of the target voxel can be recorded in the light data to which the particle belongs. The chemical composition information of the voxel can be obtained through the index number. Therefore, after the particle transport is completed, the index number of the target voxel that collided can be determined through the light data to which the particle belongs, thereby determining the chemical composition information of the target voxel based on the index number. Multiple index numbers can be included in the light data.
[0080] For example, the index number and the corresponding chemical composition information can be pre-recorded in a related information table. The chemical composition information can be obtained by pre-testing. In the information table, the chemical composition information of the corresponding voxel can be queried by the index number.
[0081] In the disclosed embodiment, if the particle does not collide with any voxel during the transport process, the miss shader bound to the voxel will be called. Therefore, when it is determined that the miss shader is called, it is determined that the particle does not collide with all voxels in the acceleration structure during the transport process of one step. For example, the step transport of the particle may occur inside a voxel, so the particle does not collide with all voxels.
[0082] In some embodiments, operation S320 uses a ray tracing engine to traverse the collision information between the particle and multiple cube objects during the transport process to obtain a target cube object, including: dividing the target area to obtain multiple areas, each of the multiple areas includes at least one cube object; and constructing a tree data structure corresponding to the instance acceleration structure with each of the multiple areas as a node; determining the collision information between the particle and the multiple nodes by traversing the tree data structure; and determining the target cube object based on the collision information.
[0083] In the embodiment of the present disclosure, the tree data structure may be a K-dimensional tree (KD-Tree), an octree, a binary tree, etc. The division method may be a binary method, in which the target area is divided into multiple areas.
[0084] Combination Figure 4A and Figure 4B Taking the K-dimensional tree as an example, the process of determining the target cube object is schematically explained. Figure 4A A schematic diagram of a K-dimensional tree according to an embodiment of the present disclosure is schematically shown. Figure 4B The figure schematically shows a schematic diagram of traversing a K-dimensional tree according to an embodiment of the present disclosure.
[0085] like Figure 4A As shown, the target area of geometric meshing is area A, which includes multiple cube objects. Area A is divided by binary division to obtain area 1 and area B. Area B is divided by binary division to obtain area 2 and area C. Area C is divided by binary division to obtain area 3 and area D. Area D is divided by binary division to obtain area 4 and area 5. Each area includes at least one cube object.
[0086] In the embodiment of the present disclosure, a K-dimensional tree is constructed with region A, region 1, region B, region 2, region C, region 3, region D, region 4 and region 5 respectively being a node.
[0087] like Figure 4B As shown, the particle is transported in the target area A. First, the KD-Tree is traversed to determine that the particle collides with area A. Area A is traversed to determine that the particle collides with both area 1 and area B. Area B is traversed to determine that the particle collides with area 2 and area C. Area C is traversed to determine that the particle collides with area 3. Area 3 is traversed to determine the primitive that the particle collides with last in area 3. The primitive that the particle collides with last in area 3 can be the primitive where the particle is deposited when the particle stops transporting in the target area, or the primitive that the particle passes last when the particle leaves the target area.
[0088] In some embodiments, collision information between a particle and multiple nodes is determined by traversing a tree data structure, including: setting an axis-aligned bounding box for each cube object of a plurality of cube objects; and upon determining the information of the intersection of the particle with the axis-aligned bounding box in the area corresponding to any one of the multiple nodes, calculating the intersection of the triangle fragments included in the axis-aligned bounding box with the particle, and obtaining collision information between the particle and multiple vertices and multiple triangle facet primitives.
[0089] In the disclosed embodiment, the axis-aligned bounding box (AABB) can be composed of three pairs of three faces parallel to the x, y, and z axes in the conventional coordinate system. An AABB box is set for the area corresponding to each node in the KD-Tree. The AABB box is used to wrap the triangular face primitives in the area. By determining the axis-aligned bounding box that intersects with the light (particle transport path), the process of determining the triangular face primitives that intersect with the light is simplified. When it is determined that the light hits the AABB box, all the triangular face primitives in the AABB box are traversed, otherwise the traversal is omitted.
[0090] For example, you can The Trumbore algorithm calculates whether the light and the triangle surface primitive intersect to determine whether the particle and the triangle surface primitive collide.
[0091] For example, by using equations (1) and (2), it is calculated whether the light ray intersects with the triangle patch primitive.
[0092]
[0093]
[0094] in, Respectively represent the coordinates of the three vertices of the triangle patch in the Cartesian coordinate system, Indicates the starting point of the light source, represents the direction of the light, t represents the propagation time of the light, and b1 and b2 represent two coordinates in the Cartesian coordinate system. t, b1, and b2 are unknown quantities.
[0095] Solve equation (2) according to equation (1) to determine the three unknown quantities t, b1, and b2. If the solved t>0 and b1 and b2 are both between 0 and 1, it can be considered that the ray intersects with the triangle. On this basis, it can be calculated whether the ray intersects with the AABB box.
[0096] In some embodiments, different shaders are respectively responded to according to the collision detection results through multiple shader records. The collision information between particles and each voxel is confirmed by traversing the geometric acceleration structure. For example, by traversing the geometric acceleration structure and the corresponding shader binding table, the particle collision information and the corresponding response shader are obtained.
[0097] In the disclosed embodiment, the state parameters of the particle are generated by the light generating shader bound to each voxel in the plurality of voxels. The state parameters may include particle speed, position, direction, energy, and mass, etc. According to the state parameters, the position of the particle after each step iteration of the transport process is calculated. For example, the state parameters of the particle can be queried by calling the OptixTrace API.
[0098] For example, the step length ΔZ of the current particle can be calculated by formula (3).
[0099]
[0100] ΔS max represents the distance required for the current particle to lose 25% of its current energy, σ tot represents the total reaction cross section, and r represents a random number between 0 and 1.
[0101] In the disclosed embodiment, in the case of the most recent hit shader response, the departure time of the particle leaving the target voxel and entering the next voxel and the attribute value corresponding to the next voxel are obtained. According to the departure time, the starting position information of the particle at the next voxel after completing the current step iteration is calculated. According to the attribute value corresponding to the next voxel and the starting position information at the next voxel, the transport process of the next step can be determined.
[0102] For example, the position information of the particle at the next voxel can be calculated by equation (4).
[0103] P New =P Origin +R Direct ×Tmax (4)
[0104] P NewIndicates the position of the particle at the next voxel after completing the current step iteration, P Origin Represents the position of the particle before the current step iteration, R Direct It represents the transport speed of particles in the transport direction, and Tmax represents the transport time to complete the current step iteration.
[0105] If it is determined that the particle does not move out of the voxel boundary (target region boundary), the current iteration determines that the particle will undergo a nuclear reaction, otherwise the particle will not undergo a nuclear reaction. Subsequently, the average energy loss and scattering angle of the electromagnetic reaction of the particle are calculated.
[0106] The electromagnetic response process of the particle is calculated to obtain the average energy loss of the electromagnetic response of the particle in the current step. The average energy loss of the electromagnetic response within a step is calculated by the equivalent step of the particle in water. The equivalent step in water ΔZ w , which can be calculated by formula (5).
[0107]
[0108] ρ w represents water density, f s (ρ,T p ) represents the mass stopping power ratio of the current voxel material relative to water, and ρ represents the voxel density.
[0109] The average energy loss of the particle is calculated by formula (6): The average energy loss is stored in the dose counter.
[0110]
[0111] L(E) represents the limited stopping power in water.
[0112] The scattering angle θ of the carbon particles is calculated by equation (7).
[0113]
[0114] E s Represents a constant, E s =19.8+0.0023*13.6MeV, p is the momentum of the particle, X0 is the radiation length of the material, and β represents the speed of the particle relative to the speed of light c.
[0115] In the disclosed embodiment, the particle transport process is calculated by threads, and the transport process is completed by step-length iterative calculation. When the particle energy is completely decayed by dose deposition during the transport process, the thread corresponding to the particle terminates the calculation. For example, the position of the particle after each step-length iteration of the transport process can be calculated again by the ray generation shader and the OptixTrace API until the particle energy is less than a specific threshold and then stops.
[0116] In the disclosed embodiment, after the particles complete each step transport iteration, the particles deposited in the target area after the transport is completed are obtained, and the average loss energy of the particles deposited in the target area is stored in a dose counter to count the deposition dose of the particles. The dose counter can be a continuous video memory space on the GPU that corresponds to the grid divided by resolution of the three-dimensional CT voxels.
[0117] In the embodiment of the present disclosure, the nuclear reaction data generated by the inelastic reaction can be calculated according to the inelastic reaction between the particles and the various elements during the transport process to determine whether the primary particles generate secondary particles during the transport process.
[0118] Inelastic reactions include CC, CH, CO and C-Ca reactions. The energy range of the particles is 10MeV to 450MeV. For example, the energy interval of the particles can be 10MeV, and the energy of the particles can be 10MeV, 20MeV, 30MeV, ..., 450MeV. The secondary particle generation data of the four nuclear reactions CC, CH, CO and C-Ca in the particle transport process with various energies are calculated by the simulation software Geant 4. The secondary particle generation data includes the type, probability, mass, energy, charge information, scattering angle, etc. of the secondary particles generated at the current particle energy in this nuclear reaction process.
[0119] After completing the statistics of primary particles, the motion state and energy deposition of secondary particles can also be tracked through the ray tracing model. The process of statistically analyzing the collision information of secondary particles is similar to that of statistically analyzing the collision information of primary particles, and will not be repeated here. It should be noted that secondary particles do not have a nuclear reaction process.
[0120] Based on the Monte Carlo dose calculation method of the above particles, the present disclosure also provides a particle Monte Carlo dose calculation device. Figure 5 The device is described in detail.
[0121] Figure 5 The structure block diagram of the particle Monte Carlo dose calculation device according to an embodiment of the present disclosure is schematically shown.
[0122] like Figure 5As shown, the particle Monte Carlo dose calculation device 500 of this embodiment includes a conversion module 510 , a simulation module 520 and a calculation module 530 .
[0123] The conversion module 510 is used to convert the target area of the electronic computer tomography into a geometric grid. In one embodiment, the conversion module 510 can be used to perform the operation S210 described above, which will not be repeated here.
[0124] The simulation module 520 is used to simulate the transport process of particles in the target area. In one embodiment, the simulation module 520 can be used to perform the operation S220 described above, which will not be described in detail here.
[0125] The calculation module 530 is used to traverse the collision information of the particles and the geometric grid during the transport process through the ray tracing engine, and calculate the Monte Carlo dose deposition information of the particles. In one embodiment, the calculation module 530 can be used to perform the operation S230 described above, which will not be repeated here.
[0126] According to an embodiment of the present disclosure, the calculation module 530 includes a first determination unit, a traversal unit, and a second determination unit. The first determination unit is used to determine a plurality of cubic objects included in the geometric grid, each of which includes at least one voxel. The traversal unit is used to traverse the collision information of the particle with the plurality of cubic objects during the transport process through a ray tracing engine to obtain a target cubic object, which is a cubic object among the plurality of cubic objects that collides with the particle. The second determination unit is used to determine the Monte Carlo dose deposition information of the particle based on the chemical composition information of at least one voxel in the target cubic object.
[0127] According to an embodiment of the present disclosure, the traversal unit is also used to instantiate the attribute value of at least one voxel included in each of the multiple cube objects into the global coordinate system and store them in the acceleration structure. After the multiple cube objects are instantiated, they belong to the acceleration structure; by traversing the multiple voxel instantiation nodes included in the acceleration structure, the collision information between the particle and the multiple voxel instantiation nodes is obtained; and according to the collision information, the target cube object is determined.
[0128] According to an embodiment of the present disclosure, the second determination unit is used to call a shader binding table bound to a target cube object according to collision information, wherein the shader binding table indicates the shader being called; when it is determined that a most recent hit shader is called, the target voxel associated with the most recent hit shader is determined, and the particle collides with the target voxel during a step-length transport process; and based on the state information of the particle and the chemical composition information of the target voxel, the Monte Carlo dose deposition information of the particle is calculated; wherein the index number of the target voxel in the acceleration structure is recorded in the light data to which the particle belongs, and the chemical composition information can be obtained based on the index number.
[0129] According to an embodiment of the present disclosure, the second determining unit is further configured to determine that the particle does not collide with all voxels in the acceleration structure during a step-length transport process when it is determined that the miss shader is called.
[0130] According to an embodiment of the present disclosure, the traversal unit is also used to divide the target area into multiple areas, each of the multiple areas includes at least one cube object; and construct a tree data structure corresponding to the instance acceleration structure with each of the multiple areas as a node; determine the collision information between the particle and the multiple nodes by traversing the tree data structure; and determine the target cube object based on the collision information.
[0131] According to an embodiment of the present disclosure, each cube object includes multiple vertices and multiple triangular facet primitives. The traversal unit is further used to set a coordinate axis-aligned bounding box for each of the multiple cube objects; and, upon determining the information that the particle intersects with the coordinate axis-aligned bounding box in the region corresponding to any of the multiple nodes, calculate the intersection of the triangular fragments included in the coordinate axis-aligned bounding box with the particle, and obtain collision information between the particle and the multiple vertices and the multiple triangular facet primitives.
[0132] According to an embodiment of the present disclosure, any multiple modules of the conversion module 510, the simulation module 520 and the calculation module 530 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the conversion module 510, the simulation module 520 and the calculation module 530 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in any appropriate combination of any of them. Alternatively, at least one of the conversion module 510, the simulation module 520 and the calculation module 530 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be performed.
[0133] Figure 6 A block diagram of an electronic device suitable for implementing a method for calculating a Monte Carlo dose of particles according to an embodiment of the present disclosure is schematically shown.
[0134] like Figure 6As shown, the electronic device 600 according to an embodiment of the present disclosure includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include an onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0135] In RAM 603, various programs and data required for the operation of electronic device 600 are stored. Processor 601, ROM 602 and RAM 603 are connected to each other via bus 604. Processor 601 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 602 and / or RAM 603. It should be noted that the program can also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0136] According to an embodiment of the present disclosure, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to the bus 604. The electronic device 600 may further include one or more of the following components connected to the I / O interface 605: an input portion 606 including a keyboard, a mouse, etc.; an output portion 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 608 including a hard disk, etc.; and a communication portion 609 including a network interface card such as a LAN card, a modem, etc. The communication portion 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage portion 608 as needed.
[0137] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0138] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 602 and / or RAM 603 described above and / or one or more memories other than ROM 602 and RAM 603.
[0139] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the particle Monte Carlo dose calculation method provided by the embodiment of the present disclosure.
[0140] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 601. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0141] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 609, and / or installed from a removable medium 611. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0142] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, apparatus, module, unit, etc. described above can be implemented by a computer program module.
[0143] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0144] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0145] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0146] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A method for calculating a particle Monte Carlo dose, comprising: converting a target region of a computed tomography scan into a geometric mesh; simulating a particle transport process within the target region; as well as Traversing the collision information between the particle and the geometric grid during the transport process by a ray tracing engine, and calculating the Monte Carlo dose deposition information of the particle; The step of traversing the collision information between the particle and the geometric grid during the transport process by using a ray tracing engine to calculate the Monte Carlo dose deposition information of the particle includes: Determine a plurality of cubic objects included in the geometric grid, each of the cubic objects including at least one voxel; Instantiating the attribute value of the at least one voxel included in each of the plurality of cube objects into a global coordinate system and storing the attribute value in an acceleration structure, wherein the plurality of cube objects belong to the acceleration structure after being instantiated; Obtaining collision information between the particle and the multiple voxel instantiation nodes by traversing the multiple voxel instantiation nodes included in the acceleration structure; Determining the target cube object according to the collision information; and The Monte Carlo dose deposition information of the particles is determined according to the chemical composition information of the at least one voxel in the target cubic object.
2. The calculation method according to claim 1, wherein: The step of determining the Monte Carlo dose deposition information of the particle according to the chemical composition information of the at least one voxel in the target cube object comprises: Calling a shader binding table bound to the target cube object according to the collision information, wherein the shader binding table indicates the shader to be called; In the case where it is determined that the nearest hit shader is called, determining a target voxel associated with the nearest hit shader, and the particle collides with the target voxel during a one-step transport process; and Calculating Monte Carlo dose deposition information of the particle according to the state information of the particle and the chemical composition information of the target voxel; The index number of the target voxel in the acceleration structure is recorded in the light data to which the particle belongs, and the chemical composition information can be obtained based on the index number.
3. The calculation method according to claim 2, wherein: The calculating the Monte Carlo dose deposition information of the particle according to the chemical composition information of the at least one voxel in the target cube object further includes: In the case where it is determined that the miss shader is called, it is determined that the particle has not collided with any voxels in the acceleration structure during the transport process of one step.
4. The calculation method according to claim 1, wherein: The step of traversing the collision information between the particles and the plurality of cube objects during the transport process by using a ray tracing engine to obtain a target cube object includes: Dividing the target area into a plurality of areas, each of the plurality of areas including at least one of the cube objects; and Taking each of the multiple regions as a node, constructing a tree data structure corresponding to the instance acceleration structure; Determine collision information between the particle and the plurality of nodes by traversing the tree data structure; and The target cube object is determined according to the collision information.
5. The calculation method according to claim 4, wherein: Each of the cube objects includes a plurality of vertices and a plurality of triangular facet primitives; The step of determining collision information between the particle and the plurality of nodes by traversing the tree data structure includes: Setting a coordinate axis-aligned bounding box for each cube object of the plurality of cube objects; as well as After determining the information of the intersection of the particle with the axis-aligned bounding box in the area corresponding to any one of the multiple nodes, the intersection of the triangle fragments included in the axis-aligned bounding box and the particle is calculated to obtain the collision information of the particle with the multiple vertices and the multiple triangle facet primitives.
6. A device for calculating a Monte Carlo dose of particles, comprising: a conversion module for converting a target region of the electronic computed tomography scan into a geometric mesh; A simulation module, used for simulating the transport process of particles in the target area; as well as A calculation module, used for traversing the collision information between the particle and the geometric grid during the transport process through a ray tracing engine, and calculating the Monte Carlo dose deposition information of the particle; Wherein, the calculation module is used for: Determine a plurality of cubic objects included in the geometric grid, each of the cubic objects including at least one voxel; Instantiating the attribute value of the at least one voxel included in each of the plurality of cube objects into a global coordinate system and storing the attribute value in an acceleration structure, wherein the plurality of cube objects belong to the acceleration structure after being instantiated; Obtaining collision information between the particle and the multiple voxel instantiation nodes by traversing the multiple voxel instantiation nodes included in the acceleration structure; Determining the target cube object according to the collision information; and The Monte Carlo dose deposition information of the particles is determined according to the chemical composition information of the at least one voxel in the target cubic object.
7. An electronic device comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors execute the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the method according to any one of claims 1 to 5.
9. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Data preprocessing method and device suitable for deep learning dose calculation
CN114300142A
Monte Carlo dose calculation method and device based on kernel density estimation, equipment and medium
CN116936029A