A ray tracing based medical volume data rendering method

CN117745921BActive Publication Date: 2026-09-29CHONGQING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311585759.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-24
Publication Date
2026-09-29
Estimated Expiration
2043-11-24

AI Technical Summary

Benefits of technology

[0040]本发明提出了一种基于光线追踪的医学体数据渲染方法,该方法将基于物理渲染中的路径追踪方法应用在医学体数据上,其中还对医学体数据进行vdb格式转换后才导入到渲染系统中并用压缩纹理存储,提高了渲染速度和渲染效率,并且使得渲染效果更加接近于现实的物理世界,从而实现比传统的医学体数据渲染方法更加真实的效果

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117745921B_ABST
    Figure CN117745921B_ABST
Patent Text Reader

Abstract

The application belongs to the field of computer graphics, and particularly relates to a medical body data rendering method based on ray tracing, which comprises the following steps: acquiring vdb format body data, compressing the vdb format body data, storing the compressed vdb format body data through a texture, and simultaneously establishing a cube according to a bounding box; emitting a ray from an imaging plane of a camera, if the ray intersects with a cube, performing distance sampling on the ray, and calculating a transmittance according to a distance sampling result; using a Monte Carlo method to calculate a body rendering equation, and updating radiosity of the ray; and performing importance sampling through a phase function to determine a next distance sampling direction of the ray; and the application can more realistically and efficiently render medical body data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer graphics, specifically relating to a medical body data rendering method based on ray tracing. Background Technology

[0002] Rendering, as a core discipline of computer graphics, ultimately aims to generate two-dimensional images from models in a three-dimensional scene according to predefined environment, lighting, materials, and rendering parameters. Over the past few decades, with continuous improvements in hardware and the development of software engineering, rendering technology has been increasingly applied to film special effects, medical imaging, and video games, and has become increasingly mature. With the development of graphics processing units (GPUs), it is now possible to render high-quality, highly realistic images in real time. After years of development, various rendering methods have emerged. Among these methods, ray tracing is considered the most realistic, often referred to as the holy grail of computer graphics.

[0003] Rendering itself can be broadly categorized into two methods based on the object being rendered: surface rendering and volume rendering. The former, currently more commonly used, renders various polygonal meshes or subdivided surfaces. Surface properties (such as color and roughness) are determined by various shading algorithms. This method only considers the interaction of light at the object's surface (e.g., reflection, transmission), but the light inside the object does not interact with the internal medium; that is, the light's path remains unchanged as it propagates within the object. In contrast to surface rendering, volume rendering describes various techniques for generating images from three-dimensional scalar data. These techniques were initially driven by scientific visualizations that obtained volumetric data through measurements or numerical simulations of natural phenomena. Typical examples include medical data of the human body obtained through computed tomography (CT) or magnetic resonance imaging (MRI). With the development of efficient volume rendering techniques, volumetric data has become increasingly important in visual arts and computer games. Volumetric data is well-suited for describing ambiguous objects such as fluids, gases, and natural phenomena such as clouds, fog, and fire.

[0004] With the development of medical technology, the acquisition and processing techniques for medical images are also constantly improving. To better observe and analyze medical images, high-quality rendering is required. Traditional medical image rendering methods are often based on direct voxel rendering, such as ray casting algorithms. However, when processing complex volumetric data, the results still differ significantly from the real physical world. Summary of the Invention

[0005] To address the problems existing in the prior art, this invention proposes a medical body data rendering method based on ray tracing. This method uses path tracing in ray tracing to render processed medical body data, thereby generating high-quality images.

[0006] The specific plan includes:

[0007] S1. Obtain medical body data, convert it to vdb format body data, compress the vdb format body data and store it through texture;

[0008] S2. Construct a cube based on the bounding box of the vdb format volume data, and then emit light rays from the camera's imaging plane;

[0009] S3. Determine whether the light rays intersect the cube according to the cube ray intersection method. If they intersect, proceed to step S4. If they do not intersect, return the background color directly.

[0010] S4. An improved Delta Tracking method is used to sample the distance of the light rays to obtain the distance traveled by the light rays in the direction of the camera's imaging plane, and the position of the light rays is updated according to the distance traveled.

[0011] S5. Based on the updated ray travel position, calculate the transmittance of that travel distance using the improved raymarching method; then use the Monte Carlo method to calculate the volume rendering equation and update the ray's radiance;

[0012] S6. The next distance sampling direction of the light ray is determined by importance sampling through the phase function. The light ray is then considered to have been ejected once, and distance sampling continues in the direction of the next distance sampling.

[0013] S7. If the number of bounces of the light ray inside the vdb format data exceeds the preset bounce threshold before it passes through, then the light ray is re-emitted along the current scattering direction of the light ray and the process returns to step S3; if the number of bounces of the light ray inside the vdb format data has reached the preset bounce threshold and it has not passed through, then the transmittance of the distance from the current position of the light ray to the position where it passes through the vdb format data is calculated using the improved raymarching method along the current scattering direction of the light ray. Then, after the light ray passes through the vdb format data, it is re-emitted along the current scattering direction of the light ray and the process returns to step S3; until the light ray hits the light source or the background.

[0014] Furthermore, step S1 compresses the vdb format volume data and stores it via texture, including:

[0015] S11. Set and initialize the sparse texture, indexed texture, and range texture;

[0016] S12. Divide the vdb format data into voxels, with each voxel containing 8x8x8 voxels;

[0017] S13. Calculate the maximum and minimum voxel values ​​for each unit voxel and store them in the range texture;

[0018] S14. Determine whether there are voxel values ​​of 0 or empty in the unit voxel. If so, do not store the voxel values ​​of each voxel in the unit voxel sequentially in the sparse texture. Instead, store a preset fixed value in the index texture to indicate skipping the index of this unit voxel. If not, store the voxel values ​​of each voxel in the unit voxel sequentially in the sparse texture and store the starting index position of the unit voxel in the index texture.

[0019] Furthermore, the index texture and range texture are the same size, and the sparse texture is the same size as the resolution of the medical body data.

[0020] Furthermore, step S4 employs an improved Delta Tracking method to sample the distance of the light rays, obtaining the travel distance of the light rays in the direction of the camera's imaging plane, including:

[0021] S41. Obtain a target unit voxel that intersects with the ray using the DDA method;

[0022] S42. Query the index position of the target unit voxel in the index texture, and determine whether the index position is a preset fixed value. If yes, skip the target unit voxel and return to step S41. If not, proceed to step S43.

[0023] S43. Query the maximum voxel value of the target unit voxel in the range texture, transform the maximum voxel value through the transfer function to obtain an absorption coefficient and a scattering coefficient, and use the sum of the absorption coefficient and the scattering coefficient as the total collision coefficient Majorant of the target unit voxel; then randomly generate a random number N1 in the range (0,1) to calculate the current travel distance of the ray and update the travel position of the ray.

[0024] S44. Calculate the collision coefficients of the target voxel under three types of collision events: absorption, scattering, and space collision, and calculate the proportion of each type of collision coefficient of the target voxel to the total collision coefficient Majorant; then calculate the probability P of the spontaneous emission event. a The probability of a scattering event P s The probability P of a collision event with an empty space n ;

[0025] S45. Generate another random number N2 within the range (0,1). If N2... <P aIf P..., a self-illumination event occurs, terminating the light ejection and adding the current vdb format data to the radiance calculation of the light source's internal color; if P... a <N2<P a +P s If the distance sampling is terminated, proceed to step S5; if N2 > P a +P s Then return to step S41.

[0026] Furthermore, in step S43, a random number N1 is randomly generated within the range (0,1), and the current travel distance of the ray is calculated as follows:

[0027]

[0028] Where t represents the current distance traveled by the light ray.

[0029] Further, step S44 calculates the probability P of the spontaneous emission event. a The probability of a scattering event P s The probability P of a collision event with an empty space n , represented as:

[0030]

[0031]

[0032]

[0033] Among them, u a U represents the absorption coefficient. s U represents the scattering coefficient. n This represents the empty collision coefficient.

[0034] Furthermore, step S5 calculates the transmittance using an improved raymarching method based on the updated ray travel position, including:

[0035] S51. Obtain the attenuation coefficients of all non-empty voxels within the travel distance;

[0036] S52. Calculate the transmittance over this travel distance using the following formula:

[0037]

[0038] Where T(x,y) represents the transmittance from position x to position y, u t This represents the attenuation coefficient.

[0039] The beneficial effects of this invention are:

[0040] This invention proposes a ray tracing-based rendering method for medical volume data. This method applies path tracing from physically based rendering to medical volume data. Furthermore, the medical volume data is converted to VDB format before being imported into the rendering system and stored using compressed textures. This improves rendering speed and efficiency, and makes the rendering effect closer to the real physical world, thus achieving a more realistic effect than traditional medical volume data rendering methods. Attached Figure Description

[0041] Figure 1 This is a flowchart of a medical body data rendering method based on ray tracing according to the present invention;

[0042] Figure 2 This is a logic diagram for a medical body data rendering method based on ray tracing according to the present invention. Detailed Implementation

[0043] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0044] This invention provides a medical body data rendering method based on ray tracing, such as... Figure 1 , Figure 2 As shown, it includes the following steps:

[0045] S1. Obtain medical body data, convert it to vdb format, compress the vdb format data, and then store it using textures.

[0046] Specifically, to accelerate data reading speed, this invention performs format conversion on medical body data. In addition, since medical body data is mostly sparse data, this invention further compresses the vdb format body data and uses a small number of textures for storage, which helps to further accelerate data reading and improve rendering speed.

[0047] Specifically, step S1 compresses the vdb format volume data and stores it via texture, including:

[0048] S11. Set and initialize the sparse texture, indexed texture, and range texture;

[0049] S12. Divide the vdb format data into voxels, with each voxel containing 8x8x8 voxels;

[0050] S13. Calculate the maximum and minimum voxel values ​​for each unit voxel and store them in the range texture;

[0051] S14. Determine if there are voxel values ​​of 0 or empty in the unit voxel. If so, do not store the voxel values ​​of each voxel in the unit voxel in the sparse texture. Instead, store a preset fixed value in the index texture to indicate skipping the index of this unit voxel. If not, store the voxel values ​​of each voxel in the unit voxel in the sparse texture sequentially and store the starting index position of the unit voxel in the index texture.

[0052] Specifically, the index texture and range texture are the same size, while the sparse texture is the same size as the resolution of the medical volume data.

[0053] S2. Construct a cube based on the bounding box of the vdb format volume data, and then emit light from the camera's imaging plane.

[0054] S3. Determine whether the light rays intersect the cube according to the cube ray intersection method. If they intersect, proceed to step S4. If they do not intersect, return the background color directly.

[0055] Specifically, existing ray tracing methods only have a built-in triangle ray intersection method, while this invention constructs a cube for the bounding box of the vdb format volume data, so an additional cube ray intersection method is added to determine whether the ray intersects with the cube.

[0056] S4. An improved Delta Tracking method is used to sample the distance of the light rays, obtain the travel distance of the light rays in the ray direction from the camera to each pixel on the imaging plane, and update the travel position of the light rays according to the travel distance.

[0057] Specifically, step S4 uses an improved Delta Tracking method to sample the distance of the light rays, obtaining the distance traveled by the light rays in the direction of the camera's imaging plane, including:

[0058] S41. Obtain a target unit voxel that intersects with the ray using the DDA method;

[0059] S42. Query the index position of the target voxel in the index texture and determine whether the index position is a preset fixed value. If it is, it means that the target voxel will not have any collision events. Let the light directly skip the range of the target voxel in world space along the current sampling direction. This allows the light to quickly skip the empty voxel. Then return to step S41. If not, it means that the light may collide within the target voxel. Proceed to step S43.

[0060] S43. Query the maximum voxel value of the target unit voxel in the range texture, transform the maximum voxel value through the transfer function to obtain an absorption coefficient and a scattering coefficient, and use the sum of the absorption coefficient and the scattering coefficient as the total collision coefficient Majorant of the target unit voxel; then randomly generate a random number N1 in the range (0,1) to calculate the current travel distance of the ray and update the travel position of the ray.

[0061] Specifically, in step S43, a random number N1 is randomly generated within the range (0,1), and the current travel distance of the light ray is calculated as follows:

[0062]

[0063] Where t represents the current distance traveled by the light ray.

[0064] S44. Calculate the collision coefficients of the target voxel under three types of collision events: absorption, scattering, and space collision, and calculate the proportion of each type of collision coefficient of the target voxel to the total collision coefficient Majorant; then calculate the probability P of the spontaneous emission event. a The probability of a scattering event P s The probability P of a collision event with an empty space n ;

[0065] Specifically, step S44 calculates the probability P of the spontaneous emission event. a The probability of a scattering event P s The probability P of a collision event with an empty space n , represented as:

[0066]

[0067]

[0068]

[0069] Among them, u a u represents the absorption coefficient obtained by transforming the maximum voxel value of the target unit voxel through a transfer function. s u represents the scattering coefficient obtained by transforming the maximum voxel value of the target unit voxel through the transfer function. n This represents the empty collision coefficient.

[0070] S45. Generate another random number N2 within the range (0,1). If N2... <P a This indicates a self-illuminating event has occurred, meaning there is self-illuminating radiance at this location, equivalent to light hitting a light source. At this point, the light bounce stops, and the radiance inside the light source is added to the current VDB format data to calculate the color; if P a <N2<P a+P s If N2 > P, it indicates a scattering event has occurred, and distance sampling is terminated to obtain the distance traveled by the light ray in the direction of the camera's imaging plane. Then, step S5 continues. Otherwise, it indicates a null collision event has occurred, i.e., when N2 > P. a +P s If a collision has occurred, it is determined that a collision has occurred and further steps are still required. At this point, the process returns to step S41.

[0071] S5. Based on the updated ray travel position, calculate the transmittance of that travel distance using the improved raymarching method; then use the Monte Carlo method to calculate the volume rendering equation and update the ray's radiance.

[0072] Specifically, step S5 calculates the transmittance using an improved raymarching method based on the updated ray travel position, including:

[0073] S51. Obtain the attenuation coefficients of all non-empty voxels within the travel distance;

[0074] S52. Based on the attenuation coefficient, the transmittance over this travel distance is calculated using the following formula:

[0075]

[0076] Where T(x, y) represents the transmittance from position x to position y, u t This represents the attenuation coefficient.

[0077] Specifically, the volume rendering equation calculated using the Monte Carlo method is expressed as follows:

[0078]

[0079] Where x represents a specific location, w represents a specific direction, and L(x, w) represents the radiance in the w direction at location x. e (x, w) represents the radiance of a self-emitting object located at position x in the w direction, L s (x, w) represents the radiance of internal scattering in the direction w at position x, μ a μ represents the absorption coefficient at point x in the medium. s μ represents the scattering coefficient at point x in the medium. t Let x represent the attenuation coefficient at point x in the medium, T(x, y) represent the transmittance from point x to point y, p(y) represent the probability density function of sampling point y on the path along the direction of light propagation in the medium, and P(z) represent the probability that light can reach point z on the surface of the object.

[0080] S6. The next distance sampling direction of the light ray is determined by importance sampling through the phase function. The light ray is then considered to have been ejected once, and distance sampling continues in the direction of the next distance sampling.

[0081] S7. If the number of bounces of the light within the vdb format data exceeds the preset bounce threshold before it passes through, then the light is re-emitted along the current scattering direction of the light and the process returns to step S3. If the number of bounces of the light within the vdb format data exceeds the preset bounce threshold and it does not pass through, then the transmittance of the distance from the current position of the light to the position where it passes through the vdb format data is calculated using the improved raymarching method along the current scattering direction of the light. Then, after the light passes through the vdb format data, it is re-emitted along the current scattering direction of the light and the process returns to step S3. This continues until the light hits a light source (if the vdb format data experiences a self-emission event, it is also considered a light source) or the background.

[0082] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "setting," "connection," "fixing," "rotation," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal connection of two components or the interaction between two components. Unless otherwise explicitly limited, those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0083] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for rendering medical body data based on ray tracing, characterized in that, Includes the following steps: S1. Obtain medical body data, convert it to vdb format body data, compress the vdb format body data and store it through texture; S2. Construct a cube based on the bounding box of the vdb format volume data, and then emit light rays from the camera's imaging plane; S3. Determine whether the light ray intersects with the cube. If they intersect, proceed to step S4. If they do not intersect, return the background color directly. S4. An improved Delta Tracking method is used to sample the distance of the light rays to obtain the distance traveled by the light rays in the direction of the camera's imaging plane, and the position of the light rays is updated according to the distance traveled. S5. Based on the updated ray travel position, calculate the transmittance of that travel distance using the improved raymarching method; then use the Monte Carlo method to calculate the volume rendering equation and update the ray's radiance; S6. The next distance sampling direction of the light ray is determined by importance sampling through the phase function. The light ray is then considered to have been ejected once, and distance sampling continues in the direction of the next distance sampling. S7. If the number of times the light ray bounces inside the vdb format data has passed through before reaching the preset bounce threshold, then the light ray is re-emitted along the current scattering direction of the light ray and the process returns to step S3. If the number of ejections of the light ray inside the vdb format data has reached the preset ejection threshold and has not passed through, then the transmittance of the distance from the current position of the light ray to the position where it passes through the vdb format data is calculated using the improved raymarching method along the current scattering direction of the light ray. Then, after the light ray passes through the vdb format data, the light ray is emitted again along the current scattering direction of the light ray, and the process returns to step S3; until the light ray hits the light source or the background.

2. The medical volume data rendering method based on ray tracing according to claim 1, characterized in that, Step S1 involves compressing the vdb format volume data and then storing it as a texture, including: S11. Set and initialize the sparse texture, indexed texture, and range texture; S12. Divide the vdb format data into voxels, with each voxel containing 8x8x8 voxels; S13. Calculate the maximum and minimum voxel values ​​for each unit voxel and store them in the range texture; S14. Determine if there are voxel values ​​of 0 or empty in the unit voxel. If so, do not store the voxel values ​​of each voxel in the unit voxel in the sparse texture, and store a preset fixed value in the index texture to indicate skipping the index of this unit voxel. If not, store the voxel values ​​of each voxel in the unit voxel in the sparse texture sequentially, and store the starting index position of the unit voxel in the index texture.

3. The medical volume data rendering method based on ray tracing according to claim 2, characterized in that, The indexed texture and range texture are the same size, while the sparse texture is the same size as the resolution of the medical volume data.

4. The medical volume data rendering method based on ray tracing according to claim 1, characterized in that, Step S4 uses an improved Delta Tracking method to sample the distance of the light rays, obtaining the distance traveled by the light rays in the direction of the camera's imaging plane, including: S41. Obtain a target unit voxel that intersects with the ray using the DDA method; S42. Query the index position of the target unit voxel in the index texture, and determine whether the index position is a preset fixed value. If yes, skip the target unit voxel and return to step S41. If not, proceed to step S43. S43. Query the maximum voxel value of the target unit voxel in the range texture, transform the maximum voxel value through the transfer function to obtain an absorption coefficient and a scattering coefficient, and use the sum of the absorption coefficient and the scattering coefficient as the total collision coefficient Majorant of the target unit voxel; then randomly generate a random number N1 in the range (0,1) to calculate the current travel distance of the ray and update the travel position of the ray. S44. Calculate the collision coefficients of the target voxel under three types of collision events: absorption, scattering, and space collision, and calculate the proportion of each type of collision coefficient of the target voxel to the total collision coefficient Majorant; then calculate the probability P of the spontaneous emission event. a The probability of a scattering event P s The probability P of a collision event with an empty space n ; S45. Generate another random number N2 within the range (0,1). If N2... <P a If P..., a self-illumination event occurs, terminating the light ejection and adding the current vdb format data to the radiance calculation of the light source's internal color; if P... a <N2<P a +P s If the distance sampling is terminated, proceed to step S5; if N2 > P a +P s Then return to step S41.

5. The medical volume data rendering method based on ray tracing according to claim 4, characterized in that, Step S43: Randomly generate a random number N1 within the range (0,1) and calculate the current travel distance of the light ray, represented as: Where t represents the current distance traveled by the light ray.

6. The medical volume data rendering method based on ray tracing according to claim 4, characterized in that, Step S44: Calculate the probability P of the spontaneous emission event. a The probability of a scattering event P s The probability P of a collision event with an empty space n , is represented as: Among them, u a U represents the absorption coefficient. s U represents the scattering coefficient. n This represents the empty collision coefficient.

7. The medical volume data rendering method based on ray tracing according to claim 1, characterized in that, Step S5 calculates the transmittance using an improved raymarching method based on the updated ray travel position, including: S51. Obtain the attenuation coefficients of all non-empty voxels within the travel distance; S52. Calculate the transmittance over this travel distance using the following formula: Where T(x,y) represents the transmittance from position x to position y, u t This represents the attenuation coefficient.

Citation Information

Patent Citations

  • Photon mapping accelerating method based on point cache

    CN104200509A

  • Visual perception driving mask rendering pixel path sampling number self-adaptive control method

    CN112419492A