Volume rendering method and device of three-dimensional image, electronic equipment and storage medium

By distinguishing areas of interest and non-interest in the imaging plane, using ray casting calculations with different step lengths, and combining multi-stream processing and thread parallelism, the problem of low efficiency in 3D image rendering is solved, and efficient and high-definition 3D image generation is achieved.

CN120635284APending Publication Date: 2025-09-12BEIJING WANDONG MEDICAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510508494.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-22
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

The efficiency of rendering three-dimensional images in existing technologies is low and is limited by the computing power of the computer's central processing unit, resulting in slow progress during actual use.

Method used

By distinguishing the area of ​​interest and the area of ​​non-interest in the imaging plane, different step sizes are used for ray casting calculations, with smaller step sizes used in the area of ​​interest and larger step sizes used in the area of ​​non-interest. Combined with the multi-stream processing and thread parallel computing of the graphics processing unit, the allocation of computing resources is optimized.

Benefits of technology

The efficiency and quality of 3D image rendering are improved, ensuring accurate presentation of detailed information in areas of interest, while reducing the amount of calculation in areas of non-interest and improving overall computing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120635284A_ABST
    Figure CN120635284A_ABST
Patent Text Reader

Abstract

The invention relates to a volume rendering method and device for a three-dimensional image, electronic equipment and a storage medium, and the method comprises the steps: carrying out the sampling in an imaging plane corresponding to a plurality of organ scanning images according to a ray casting algorithm, and obtaining a sampled target pixel point; the target pixel points are subjected to ray casting analysis, a region of interest and a region of non-interest in an imaging plane are determined, and the region of interest comprises a target organ to be concerned; carrying out ray casting calculation after sampling a target pixel point in the region of interest according to a first step length; a target pixel point in the non-interested area is sampled according to a second step length and then ray casting calculation is carried out, and the second step length is larger than the first step length; and generating a three-dimensional image corresponding to the organ scanning image according to the ray casting calculation results of the region of interest and the non-region of interest. According to the method, the image quality is ensured, and the calculation efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a volume rendering method, device, electronic device, and storage medium for three-dimensional images. Background Art

[0002] In the medical field, 3D visualization adds three-dimensional structural information, overcoming the two-dimensional limitations of DICOM (Digital Imaging and Communications in Medicine) images. 3D images not only provide three-dimensional data but also allow for dynamic interactive operations such as rotation, scaling, translation, and shearing, enabling doctors to fully understand the characteristics of target tissues and their spatial relationships. By adjusting the rendering parameters, doctors can observe different tissues and organs in a variety of ways, including surface morphology and internal structure. This has irreplaceable advantages over 2D images and is of great significance for clinical learning and diagnosis.

[0003] 3D visualization rendering is generally divided into two categories: surface rendering and volume rendering. Compared to surface rendering, volume rendering is not limited to surface rendering but requires the participation of all voxels in the calculation. Generally, volume rendering requires a greater amount of calculation to obtain accurate results. However, due to the limited computing power of computer central processing units, the actual rendering of 3D images is very slow. Summary of the Invention

[0004] The present application provides a volume rendering method, apparatus, electronic device, and storage medium for three-dimensional images to solve the problem of low rendering efficiency of three-dimensional images.

[0005] In a first aspect, the present application provides a volume rendering method for a three-dimensional image, the method comprising:

[0006] Sampling is performed in the imaging plane corresponding to the plurality of organ scan images according to a ray casting algorithm to obtain the sampled target pixel points;

[0007] Determining a region of interest and a region of non-interest in the imaging plane by performing ray casting analysis on the target pixel point, wherein the region of interest includes a target organ to be focused on;

[0008] Perform ray casting calculation on the target pixel points in the region of interest according to the first step of sampling;

[0009] Performing ray casting calculation on the target pixel points in the non-interested area after sampling according to a second step length, wherein the second step length is greater than the first step length;

[0010] A three-dimensional image corresponding to the organ scan image is generated according to the ray casting calculation results of the region of interest and the non-region of interest.

[0011] Optionally, sampling is performed in imaging planes corresponding to the plurality of organ scan images according to a ray casting algorithm, and the sampled target pixel points obtained include:

[0012] dividing the imaging plane into a plurality of sub-regions;

[0013] Sampling the imaging plane according to a set method to obtain initial pixel points, wherein the set method is that the sampling density of the central sub-region of the imaging plane is greater than the sampling density of the peripheral sub-regions;

[0014] According to the ray casting algorithm, the initial pixel point is sampled according to a preset step size to obtain a sampled target pixel point, wherein the preset step size is greater than the second step size.

[0015] Optionally, determining the region of interest and the region of non-interest in the imaging plane by performing ray casting analysis on the target pixel point includes:

[0016] Analyzing the projection light of the target pixel point;

[0017] determining a propagation depth of the light in the volume data formed by the plurality of organ scan images based on the analysis result, and determining a complexity of the light traveling through the volume data based on a degree of change in properties of a plurality of voxels passed by the light or a degree of change in the number of sampling points passed by the light;

[0018] A region of interest and a region of non-interest in the imaging plane are determined according to the light propagation depth or the complexity of the light passing through the volume data.

[0019] Optionally, determining the region of interest and the region of non-interest in the imaging plane according to the light propagation depth or the complexity of the light passing through the volume data includes:

[0020] If the light propagation depth is less than a preset depth threshold, or the complexity is greater than a preset complexity threshold, determining that the light comes from the region of interest in the imaging plane;

[0021] If the light propagation depth is greater than or equal to the preset depth threshold, and the complexity is less than or equal to the preset complexity threshold, it is determined that the light comes from a non-interest region in the imaging plane.

[0022] Optionally, after generating the three-dimensional image, the method further includes:

[0023] When it is detected that the user is currently operating the three-dimensional image, a ray casting calculation result of edge pixels in the region of interest is used as a ray casting calculation result in the non-interest region; and a three-dimensional image during the user operation is generated based on the new ray casting calculation results of the region of interest and the non-interest region;

[0024] When it is detected that the user stops operating the three-dimensional image, the target pixel points in the non-interest area are sampled according to the second step size and then ray casting calculation is performed; and based on the new ray casting calculation results of the area of ​​interest and the non-interest area, a three-dimensional image after the user operation is completed is generated.

[0025] Optionally, the organ scan image is stored in a memory of a graphics processing unit;

[0026] During the ray casting calculation process, the method further includes: decomposing the ray casting calculation process into multiple independent streams in the graphics processing unit, and dividing each stream into multiple threads, wherein multi-stream processing is used to realize thread parallelism within a stream and thread operation between different streams; and using the multi-stream processing to perform thread parallelism within a sub-region and thread asynchronous calculation between sub-regions.

[0027] Optionally, determining the voxels that the ray passes through during the ray casting calculation includes:

[0028] Determine the three-dimensional voxel coordinates of the target voxel through which the ray passes;

[0029] determining a target first-level voxel block where the target voxel is located according to the three-dimensional voxel coordinates and the side length of the first-level voxel block, wherein the volume data is composed of a plurality of cube-shaped first-level voxel blocks;

[0030] Determining a target secondary voxel block where the target voxel is located based on an offset of the three-dimensional voxel coordinates in the target primary voxel block and a side length of the secondary voxel block, wherein each primary voxel block is composed of a plurality of cube-shaped secondary voxel blocks, and the offset refers to a relative position difference of the target voxel relative to a starting position of the target primary voxel block;

[0031] Repeat the above steps of determining the target lower-level voxel block where the target voxel is located according to the offset and the side length of the lower-level voxel block, wherein each lower-level voxel block is in a cube shape;

[0032] The target voxel block of the last level is taken as the voxel that the ray passes through.

[0033] In a second aspect, the present application provides a volume rendering device for a three-dimensional image, the device comprising:

[0034] A sampling module is used to sample in the imaging planes corresponding to the multiple organ scan images according to a ray casting algorithm to obtain the sampled target pixel points;

[0035] a determination module, configured to determine a region of interest and a region of no interest in the imaging plane by performing a ray casting analysis on the target pixel point, wherein the region of interest includes a target organ to be focused on;

[0036] A first calculation module is used to perform ray casting calculation on the target pixel points in the region of interest after sampling according to the first step;

[0037] a second calculation module, configured to perform ray casting calculation on the target pixel points in the non-interested region after sampling according to a second step length, wherein the second step length is greater than the first step length;

[0038] A generating module is used to generate a three-dimensional image corresponding to the organ scanning image according to the ray casting calculation results of the region of interest and the non-region of interest.

[0039] In a third aspect, the present application provides an electronic device comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus.

[0040] In a fourth aspect, the present application further provides a computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the volume rendering method of a three-dimensional image as described in any one of the above items of the present application.

[0041] The above technical solution provided by the embodiment of the present application has the following advantages compared with the existing technology: sampling is first performed on the imaging plane, and then ray casting calculations are performed on the sampled target pixel points to determine the areas of interest and non-interest. By sampling the area of ​​interest with a smaller step size and performing ray casting calculations, the detailed information of the target organ can be accurately obtained. By sampling the area of ​​non-interest with a larger step size and performing ray casting calculations, the computing efficiency can be improved while ensuring the clarity of the image of the non-important area. The present application quickly determines the area of ​​interest and the area of ​​non-interest, and reasonably allocates computing resources, so as to concentrate more computing resources on the area of ​​interest, and simplifies the processing of the area of ​​non-interest, thereby improving the computing efficiency while ensuring the image quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0043] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0044] One or more embodiments are exemplarily illustrated by pictures in the corresponding drawings. These exemplifications do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements. Unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0045] Figure 1 A schematic diagram of a system for three-dimensional volume rendering provided in an embodiment of the present application;

[0046] Figure 2 A flow chart of a volume rendering method for a three-dimensional image provided in an embodiment of the present application;

[0047] Figure 3 A schematic diagram of ray casting provided in an embodiment of the present application;

[0048] Figure 4 A comparison chart of the effects of different rendering parameters on the same part provided in the embodiment of the present application;

[0049] Figure 5 This is a comparison chart of the effects of the same CPU and GPU rendering parameters on the same part of the embodiment of the present application;

[0050] Figure 6 A schematic diagram of the overall process of volume rendering of a three-dimensional image provided in an embodiment of the present application;

[0051] Figure 7 A schematic structural diagram of a volume rendering device for three-dimensional images provided in an embodiment of the present application;

[0052] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0053] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0054] The disclosure below provides many different embodiments or examples for implementing different structures of the present application. In order to simplify the disclosure of the present application, the components and settings of specific examples are described below. Of course, these are merely examples and are not intended to limit the present application. In addition, the present application may repeat reference numbers and / or letters in different examples. Such repetition is for the purpose of simplicity and clarity and does not in itself indicate the relationship between the various embodiments and / or settings discussed.

[0055] In order to solve the problem of low efficiency in three-dimensional image rendering in the background technology, the embodiment of the present application distinguishes between areas of interest and non-interest on the imaging plane, densely emits light from the area of ​​interest to ensure image accuracy, and sparsely emits light from the area of ​​non-interest to solve the problem of low efficiency in three-dimensional image rendering.

[0056] The embodiments of the present application are applicable to the medical field, including CT imaging, magnetic resonance imaging or ultrasound imaging, etc.

[0057] Optionally, in the embodiment of the present application, the above-mentioned volume rendering method of three-dimensional image can be applied to Figure 1 In the hardware environment composed of the scanning device 101 and the processor 103 shown in FIG. Figure 1 As shown, processor 103 is connected to scanning device 101 via a network. After scanning a human body, scanning device 101 sends the organ scan image to processor 103. The processor can use a CPU or GPU (Graphics Processing Unit) to quickly convert multiple two-dimensional organ scan images into three-dimensional images. Database 105 can be set up on a server or independently of the server to provide data storage services for the processor. Scanning devices include but are not limited to CT scanners, magnetic resonance imaging scanners, or ultrasound scanners.

[0058] The following will describe in detail a volume rendering method for a three-dimensional image provided by an embodiment of the present application in conjunction with specific implementation methods, taking application to a CPU or a GPU as an example. Figure 2 The specific steps are as follows:

[0059] Step 201: Sampling is performed in imaging planes corresponding to a plurality of organ scan images according to a ray casting algorithm to obtain sampled target pixel points;

[0060] Step 202: performing ray casting analysis on the target pixel point to determine a region of interest and a region of non-interest in the imaging plane, wherein the region of interest includes a target organ to be focused on;

[0061] Step 203: Perform ray casting calculation on the target pixel points in the region of interest after sampling according to the first step;

[0062] Step 204: performing ray casting calculation on the target pixel points in the non-interested region after sampling according to the second step length, wherein the second step length is greater than the first step length;

[0063] Step 205: Generate a three-dimensional image corresponding to the organ scan image according to the ray casting calculation results of the region of interest and the region of no interest.

[0064] The basic principle of the ray casting algorithm is to send a virtual ray from any point on the imaging plane along a specific direction. When the ray intersects the volume data composed of voxels, two intersection points are generated: the incident point and the exit point. Between these two intersection points, the color value and opacity of the sampled points are obtained at a specific sampling step size. Starting from the incident point, the cumulative calculation is performed along the direction of the ray. The calculation ends when the opacity approaches 1 infinitely. The final cumulative result is the value of the point. Figure 3 Schematic diagram of ray casting.

[0065] The basic process of volume rendering is mainly divided into three steps: voxel resampling, classification and image synthesis.

[0066] Voxel resampling: Since 3D data is scanned by a scanning device, this data appears as discrete points. In reality, the points on a ray are a set of continuous points along a specified direction with a certain step size. Therefore, resampling is required to obtain the values ​​of the points on the ray to ensure the accuracy of subsequent calculations.

[0067] Voxel classification: This step is to assign different physical properties such as color and opacity to voxels, so that different effects are finally presented. This attribute assignment process can be achieved through segmentation algorithms or pre-set based on experience. In this application, the voxel drawing parameters can be set by technicians to meet personalized drawing effects. Figure 4 A comparison chart of the effects of different drawing parameters on the same part.

[0068] Image synthesis: The projection result of each ray is obtained according to the illumination model (such as the phong illumination model). The calculation formula of the illumination model is:

[0069]

[0070] Among them, the color value of the nth sampling point itself is Its own opacity is The color value of the light before it enters the nth sampling point is The opacity is The color value of the light after it passes through the nth sampling point is The opacity is

[0071] In step 201, the processor performs sampling in the imaging planes corresponding to multiple two-dimensional organ scan images based on a ray casting algorithm. The ray casting algorithm simulates light passing through an object and collects its information. In this step, pixels are selected as sampling objects according to specific rules. Through reasonable sampling, some pixels, namely target pixels, can be extracted from the large amount of two-dimensional image data. These pixels are used for subsequent region division.

[0072] In step 202, the processor performs a raycast analysis on the sampled target pixels. This process simulates light rays passing through the imaging plane from different directions and calculates the interaction between the rays and the pixels. Based on these calculations, the characteristics of each pixel in the imaging plane are analyzed to determine the region of interest (ROI) and region of non-interest (ROI). The ROI is the area containing the target organ of interest, while the ROI is the area outside the target organ in the imaging plane.

[0073] By clearly distinguishing between regions of interest and regions of no interest, the embodiments of the present application can more accurately identify the location and range of the target organ, which helps to concentrate subsequent processing resources in key areas, avoid wasting computing resources in irrelevant areas, and improve computing efficiency.

[0074] In step 203, the processor samples the target pixels in the region of interest using a smaller first step size, such as 1 pixel. Sampling with such a small step size allows for more dense pixel information to be obtained within the region of interest. After sampling, the ray casting calculation is performed again to more accurately calculate the voxel properties within the region, such as color and transparency.

[0075] Because the region of interest includes the target organ of interest, using a smaller first step size for sampling and ray casting calculations can more precisely capture the details of the target organ. A smaller step size allows for denser sampling points within the same area, thereby obtaining more accurate voxel information. When subsequently generating a 3D image, this rich detail enables the morphology, structure, and other characteristics of the target organ to be more clearly presented, helping doctors to more accurately observe and diagnose diseases.

[0076] In step 204, for the target pixels in the non-interested region, the processor samples them according to a second step size, which must be larger than the first step size. For example, the second step size can be set to 2 pixels. Similarly, after the sampling is completed, a ray casting calculation is performed to calculate the properties of the voxels in the region.

[0077] While non-regions of interest (ROIs) are not the primary focus, proper processing of them helps maintain the integrity and continuity of the 3D image. Using a second step size larger than the first step size for sampling and calculation is an effective strategy for balancing computational effort and image quality while maintaining overall image quality. Using a slightly larger step size for sampling ROIs than ROIs reduces computational effort and improves processing efficiency without significantly compromising image quality.

[0078] In step 204, the processor integrates the raycast calculation results for the region of interest and the raycast calculation results for the non-region of interest. Based on these calculation results, a 3D reconstruction algorithm is used to convert the information in the 2D imaging plane into a geometric model in 3D space, assigning corresponding attributes, and ultimately generating a 3D image corresponding to the organ scan image.

[0079] This step is the ultimate goal of the entire process. By combining the raycast calculation results from different regions, a detailed and realistic 3D image of the organ can be constructed. This 3D image is the initial image displayed on the terminal. This 3D image provides doctors with intuitive and comprehensive information about the organ's structure. Doctors can observe the organ's morphology, size, and internal structure from different angles, allowing them to more accurately determine the location, extent, and severity of the disease, providing strong support for diagnosis and treatment decisions.

[0080] For example, in a liver imaging plane, liver tissue is typically located in the central region. In step 201, the imaging plane corresponding to multiple CT scan images is sampled using a ray casting algorithm to obtain multiple target pixels. In step 202, a ray casting analysis is performed on these target pixels, determining that the area containing the liver is the region of interest (ROI), while other tissues and organs surrounding the liver are ROIs (regions of non-interest). In step 203, a first step length of 1 pixel is used to sample and perform ray casting calculations on the ROI, enabling details such as the liver's internal structures, such as intrahepatic vascular branches and minor lesions, to be clearly visualized. For ROIs surrounding the liver, such as abdominal fat and intestinal tract, a second step length of 2 pixels is used in step 204, ensuring the integrity of the overall image while reducing the amount of computation. Finally, in step 205, the generated three-dimensional liver image clearly displays the liver's overall morphology, internal structure, and relationship with surrounding tissues, helping doctors more accurately determine the presence and specificity of liver lesions, thereby improving diagnostic accuracy and efficiency.

[0081] In this application, sampling is first performed on the imaging plane, and then ray casting calculations are performed on the sampled target pixel points to determine the areas of interest and non-interest. By sampling the area of ​​interest with a smaller step size and performing ray casting calculations, the detailed information of the target organ can be accurately obtained. By using a larger step size to sample the area of ​​non-interest and performing ray casting calculations, the computing efficiency can be improved while ensuring the clarity of the image of non-important areas. This application quickly determines the areas of interest and non-interest and reasonably allocates computing resources, concentrates more computing resources on the areas of interest, and simplifies the processing of the areas of non-interest, thereby improving computing efficiency while ensuring image quality.

[0082] As an optional implementation, sampling is performed in imaging planes corresponding to multiple organ scan images according to a ray casting algorithm, and the sampled target pixel points obtained include the following:

[0083] Step S11: dividing the imaging plane into multiple sub-areas;

[0084] Step S12: sampling the imaging plane according to a set method to obtain initial pixel points, wherein the set method is that the sampling density of the central sub-region of the imaging plane is greater than the sampling density of the peripheral sub-regions;

[0085] Step S13: According to the ray casting algorithm, the initial pixel point is sampled according to a preset step size to obtain a sampled target pixel point, wherein the preset step size is larger than the second step size.

[0086] In step S11, at the initial stage of the solution, the processor divides the imaging plane into multiple sub-regions. Depending on the size of the imaging plane and processing requirements, this can be done using either a non-uniform or uniform division method, where the imaging plane is divided into multiple sub-regions of identical size and shape. For example, if the imaging plane is square, it can be divided into several small square sub-regions; if it is rectangular, it can be divided into rectangular sub-regions. During the division process, the boundaries of each sub-region must be precisely calculated to ensure seamless connection and non-overlap between sub-regions, ensuring complete coverage of the imaging plane information.

[0087] In step S12, the processor randomly samples the imaging plane according to a predetermined method to obtain initial pixel points. The predetermined method is to increase the sampling density of the central subregion of the imaging plane to a greater density than that of the peripheral subregions. In the central subregion, since it may contain key parts or detailed information of the target object, the number of sampling points is increased. For example, in the central subregion, a sampling point is selected every two pixels; in the peripheral subregion, the sampling interval is appropriately increased, such as selecting a sampling point every five pixels. In this way, while ensuring that rich information is obtained in the key area, the number of samples in the peripheral area is reasonably controlled to avoid excessive data redundancy and excessive computation caused by overly dense sampling points.

[0088] This differentiated sampling strategy prioritizes information acquisition in the center of the imaging plane. The higher sampling density in the center captures subtler features and variations in the target object, while the relatively lower sampling density in the peripheral areas reduces the amount of sampled data without sacrificing critical information. This reduces the burden on subsequent calculations and processing, improving overall efficiency.

[0089] In step S13, after completing the initial pixel sampling, the processor samples these initial pixels according to a preset step size to obtain the sampled target pixels. The preset step size must be larger than the second step size. A larger preset step size makes the target pixels more sparsely distributed on the imaging plane. This reduces the amount of data to be analyzed during subsequent raycast analysis of the target pixels, allowing for faster differentiation between regions of interest and non-regions of interest.

[0090] The embodiment of the present application performs sampling and ray casting calculations through a larger preset step size, which can quickly perform a global analysis of the imaging plane and preliminarily determine the approximate position and range of the target organ, making it easier to subsequently concentrate computing resources on areas that may contain the target organ, avoiding uniform and indiscriminate calculations on the entire imaging plane, and improving computing efficiency.

[0091] This application achieves efficient processing of imaging plane information through the synergistic effect of the above three steps. First, the imaging plane is divided into sub-regions. The sampling strategy of different densities in the central sub-region and the peripheral sub-region ensures the full acquisition of key information and the reasonable control of data volume. Based on the re-sampling of the larger step size of the ray casting algorithm, the area of ​​interest and the area of ​​non-interest are quickly distinguished by reducing the number of sampling points, which comprehensively improves the processing efficiency of the imaging plane information and reduces the consumption of computing resources.

[0092] Exemplarily, taking lung CT imaging as an example, the above steps are applied in the imaging plane processing of lung CT images. In step S11, the imaging plane of the lung CT image is divided into multiple small rectangular sub-regions. In step S12, considering that the important structures of the lungs (such as trachea, lung parenchyma, etc.) are mostly concentrated in the central area of ​​the imaging plane, the sampling density is increased in the central sub-region, and one sample point is sampled for every 2 pixels, which can more accurately obtain information on key parts of the lungs; the peripheral sub-regions are mainly some soft tissues and chest walls, etc., and the sampling density is reduced to one sample point for every 5 pixels. In step S13, according to the ray casting algorithm, the initial sampling points are sampled again with a preset step size of 10 pixels. Since the ray casting algorithm can simulate the propagation of light in lung tissue, even if the sampling points become sparser, it can still reflect the structural information of the lung tissue, thereby dividing the region of interest containing the lungs and the non-region of interest containing other organs.

[0093] Alternatively, after the image scanning device obtains multiple organ scan images, it sends the image data to and stores them in computer memory. The computer memory then copies the image data to a GPU device, which then performs all the functions of a CPU. Compared to a CPU, a GPU has the following advantages.

[0094] 1. The GPU has a multi-stream processor. In ray casting calculations, the multi-stream processing process is as follows: First, the overall task of the ray casting calculation is decomposed into multiple independent streams, and each stream is further subdivided into multiple threads, thereby realizing two parallel mechanisms: one is intra-stream parallelism, that is, multiple threads in the same stream run simultaneously, and the other is inter-stream parallelism, where threads between different streams can also run simultaneously. Therefore, the embodiment of the present application uses multi-stream calculation to achieve thread parallelism within a sub-region and asynchronous calculation of threads between sub-regions, which not only improves the efficiency of the ray casting calculation, but also does not lose any pixels on the imaging plane during this process, so that the final calculation result value truly reflects the three-dimensional image of the organ.

[0095] 2. Data reuse avoids repeated calculations of the same data, reduces global memory accesses, and reduces memory bandwidth pressure. Reused data is used in the following scenario where users operate 3D images. Reused data is described in detail below and is not described in detail here.

[0096] 3. GPU devices have multiple types of memory, including global memory, shared memory, texture memory, and constant memory. Texture memory has the characteristics of high-speed access and provides hardware-accelerated interpolation. In the ray casting calculation process, a necessary step is voxel resampling, which uses texture memory for hardware acceleration.

[0097] 4. Table 1 compares CPU and GPU rendering times for the same part. In Table 1, all imaging planes have a resolution of 1000 x 1000 and use the same rendering parameters. Data 1 has a size of 512 x 512 x 881 pixels, a 0.4 mm interslice spacing, and a 0.625 mm slice thickness. Data 2 has a size of 512 x 512 x 934 pixels, a 0.4 mm interslice spacing, and a 0.625 mm slice thickness.

[0098] Table 1

[0099] Drawing area CPU (ms) GPU (ms) Head and neck data 1 57 25 Head and neck data 2 78 31

[0100] As can be seen from Table 1, the parallel computing capability of GPU greatly improves the rendering speed.

[0101] 5. GPU ensures real-time rendering while ensuring high-definition images, and can also eliminate image blur caused by CPU. Figure 5 This is a comparison of the effects of the same drawing parameters on the CPU and GPU for the same part. It can be seen that the GPU draws the image more clearly.

[0102] Therefore, in the embodiments of this application, the functions that can only be implemented by the GPU include: multi-stream processing, hardware acceleration using texture memory during voxel resampling, and the use of global memory to store data so that users can reuse edge pixel data in areas of interest when operating 3D images. Other steps besides these specific functions have flexible hardware selection and can be implemented using either the CPU or the GPU. This diverse implementation allows for flexible selection of more appropriate hardware for calculations based on specific application scenarios and hardware resource availability, achieving optimal performance and resource utilization efficiency.

[0103] As an optional implementation, in step 202, determining the region of interest and the region of non-interest in the imaging plane by performing ray casting analysis on the target pixel point includes the following:

[0104] Step S21: analyzing the projection light of the target pixel;

[0105] Step S22: determining the propagation depth of the light in the volume data composed of the multiple organ scan images based on the analysis results, and determining the complexity of the light traveling through the volume data based on the degree of change in the properties of the multiple voxels passed by the light or the degree of change in the number of sampling points passed by the light;

[0106] Step S23: If the light propagation depth is less than a preset depth threshold, or the complexity is greater than a preset complexity threshold, it is determined that the light comes from the region of interest in the imaging plane;

[0107] Step S24: If the light propagation depth is greater than or equal to the preset depth threshold, and the complexity is less than or equal to the preset complexity threshold, it is determined that the light comes from a non-interested region in the imaging plane.

[0108] The processor uses a ray casting algorithm to calculate each ray emitted, and then analyzes the cast ray. The analysis results include the depth of ray propagation and the complexity of the ray passing through the volume data.

[0109] The processor first determines the ray's endpoint position and then, using a specific computational model, delineates the actual distance the ray traveled from its entry into the volume data until its exit. If the ray propagation depth is shallow, this indicates that the ray terminated after traveling a short distance within the volume data. This could be because the ray encountered a voxel with high opacity, preventing it from continuing deeper. Alternatively, the ray may have quickly reached the target object, where the internal structure or material properties of the target object altered its propagation behavior, leading to its termination. In either case, when a ray propagates shallowly, the corresponding imaging plane region is highly likely to contain a critical target object or important information. Therefore, the imaging plane region corresponding to this ray is captured and is likely to be designated as a region of interest. For example, in a CT image, when a ray encounters a dense object (such as a tumor or bone), it may terminate quickly, resulting in a shallow ray propagation depth corresponding to that object, making this region potentially designated as a region of interest.

[0110] The complexity of ray traversing volume data depends on two key factors: the degree of variation in the properties of the multiple voxels traversed by the ray and the degree of variation in the number of sampling points passed by the ray.

[0111] Voxels in volume data contain a wealth of information about the degree of property change across multiple voxels that light passes through, such as density, CT value, color, and opacity. As light travels through volume data, it sequentially passes through multiple voxels. If the property differences between adjacent voxels along the light's propagation path are minimal, such as density values ​​fluctuating only within a very small range, this indicates that the area traversed by the light is relatively uniform, and the complexity of the volume data for that portion of the light's passage is low. Conversely, if the properties of adjacent voxels change dramatically, such as a sudden transition from low-density tissue to high-density tissue, resulting in a significant jump in CT values, this indicates that the light encountered complex environmental changes during its propagation, increasing the complexity of the volume data for that area.

[0112] Regarding the degree of change in the number of sampling points that the light passes through, when the ray casting algorithm is running, in order to accurately obtain the information on the light propagation path, the sampling points will be set according to certain rules. If the number of sampling points remains stable during a certain period of light propagation, it means that the characteristics of the area through which the light passes are relatively stable, and there is no need for frequent sampling to obtain information. The complexity of the volume data of the light passing through this area is also low. However, when the light enters an area with complex structure and changing characteristics, in order to more accurately capture the information during the light propagation process, the number of sampling points will increase significantly. For example, when the light passes through an organ tissue with a fine structure, more sampling points need to be set within a smaller spatial range, which indicates that the complexity of the volume data of the light passing through this part is higher.

[0113] Combining these two aspects, when light passes through volume data with high complexity, the corresponding imaging plane area is also very likely to contain key target objects or important information, and is then delineated as a region of interest.

[0114] When the ray propagation depth is deep and the complexity of the volume data is low, the deep ray propagation depth indicates that the ray can propagate relatively smoothly over a long distance in the volume data without encountering too much strong obstruction or interference. At the same time, the low complexity of the volume data means that during the propagation process, the voxel properties through which the ray passes change relatively smoothly, the density, CT value and other attributes between adjacent voxels differ slightly, and the number of sampling points remains relatively stable without large fluctuations. This usually indicates that the volume data structure in this area is relatively simple and uniform, and is unlikely to contain key target objects or important information. Therefore, the imaging plane area corresponding to this type of ray is often classified as a non-region of interest.

[0115] In this application, by clearly distinguishing between regions of interest and regions of non-interest, computing resources can be rationally allocated based on the importance and computing requirements of different regions. For regions of interest, more computing resources are invested in fine-grained processing to ensure that key information is not lost; while for regions of non-interest, simplified calculation methods are used to reduce unnecessary operations and improve computing efficiency.

[0116] As an optional embodiment, after generating the three-dimensional image, the method further includes: when it is detected that the user is currently operating the three-dimensional image, using the ray casting calculation results of the edge pixels in the region of interest as the ray casting calculation results in the non-interest region; generating a three-dimensional image during the user operation process based on the new ray casting calculation results of the region of interest and the non-interest region; when it is detected that the user stops operating the three-dimensional image, performing ray casting calculation on the target pixels in the non-interest region after sampling according to the second step size; and generating a three-dimensional image after the user operation is completed based on the new ray casting calculation results of the region of interest and the non-interest region.

[0117] During medical image analysis, users (doctors) often interact with the generated 3D organ scans by performing operations such as rotation, scaling, and movement. After the 3D image is generated, the processor monitors the user's operational status in real time. It uses interaction signals from input devices (such as a mouse, keyboard, or touchscreen) to determine whether the user is actively manipulating the 3D image.

[0118] When the processor detects that the user is operating a three-dimensional image, in order to reduce the amount of calculation while maintaining the smoothness of the image display, the following strategy will be used to process the non-interest area. First, for the edge pixels of the area of ​​interest, it will be used as a reference to search for the adjacent pixels of the non-interest area in the three-dimensional space. The neighboring pixels can be defined by setting a suitable spatial range. For example, a cubic space with a side length of a certain value (such as 3 voxel units) is defined with the edge pixel as the center. The non-interest area pixels in this space are regarded as nearby pixels. After determining the nearby non-interest area pixels, the ray casting calculation results of the edge pixels of the interest area will be directly assigned to these non-interest area pixels. The ray casting calculation results usually cover optical property information such as color and transparency, which are crucial for constructing the visual effect of the image. In this way, non-interest areas no longer need to undergo complex ray casting calculations, thereby significantly reducing the amount of calculation, enabling the system to respond quickly to user operations and ensure that the target object is always clearly presented during the operation. This processing method not only meets the user's demand for image smoothness during operation, but also maintains the overall visual effect of the image to a certain extent, avoiding system lag problems caused by large-scale calculations in non-interest areas.

[0119] The assignment process uses the processor's shared memory, a function implemented by the GPU. In large-scale image computing, memory bandwidth is often a bottleneck. Frequent reading and writing of data from global memory can slow down computation. Reusing data through shared memory reduces global memory accesses, alleviating pressure on memory bandwidth and enabling more efficient processor operation.

[0120] When the processor detects that the user stops operating the three-dimensional image, it means that the user expects to obtain an accurate and clear image. At this time, accurate calculations need to be performed on the non-interested areas. The processor samples the target pixel points in the non-interested areas according to the second step length, and the second step length is greater than the first step length. After the sampling is completed, ray casting calculations are performed on these sampled points to obtain the true ray casting calculation values ​​of each point in the non-interested area, replacing the previously assigned values ​​of the edge pixels near the area of ​​interest. In this way, it can ensure that the entire three-dimensional image has high clarity and accuracy after the operation is completed, providing a reliable basis for subsequent analysis and diagnosis.

[0121] In this embodiment of the application, when the processor detects an operation signal, it immediately executes the simplified processing strategy for the non-interested areas. When the operation signal stops, it determines that the user has stopped the operation and then performs precise ray casting calculations on the non-interested areas. This dynamic adjustment processing method not only meets the efficiency requirements of the user during the operation, but also ensures the high quality of the final image.

[0122] As an optional method, the application of the ray casting algorithm runs through the entire process, including the calculation of the light emitted by the initial pixel point in the imaging plane, the calculation of the light emitted by the target pixel point in the area of ​​interest, and the calculation of the light emitted by the target pixel point in the non-interested area. In the process of using the ray casting algorithm, it is necessary to determine the voxels through which the light passes, so that the voxels can be assigned physical properties such as color and opacity. The embodiment of the present application uses data blocking to determine the voxels through which the light passes, and the data blocking includes the following content.

[0123] The volume data obtained from the CT scan is loaded into computer memory. The resolution of this volume data is assumed to be (512, 512, 600), which represents the number of voxels in the length, width, and height dimensions of the entire volume data. Next, the data in memory is copied to the texture memory of the GPU device. The texture memory's high-speed access and hardware-accelerated interpolation are used to store the data and prepare it for subsequent calculations.

[0124] The data was divided into three levels of voxel blocks according to established rules. The first-level voxel block size was (16, 16, 16). Based on the target voxel resolution (512, 512, 600), the number of first-level voxel blocks in the length, width, and height directions was calculated to be (512 ÷ 16 = 32), (512 ÷ 16 = 32), and (600 ÷ 16 ≈ 38), respectively. The second-level voxel block size was (8, 8, 8). Based on the first-level voxel block division, the number of second-level voxel blocks in the length, width, and height directions was calculated to be (512 ÷ 8 = 64), (512 ÷ 8 = 64), and (600 ÷ 8 = 75), respectively. The third-level voxel block size was (4, 4, 4). The number of third-level voxel blocks in the length, width, and height directions was calculated to be (512 ÷ 4 = 128), (512 ÷ 4 = 128), and (600 ÷ 4 = 150), respectively, thus constructing a complete data block hierarchy.

[0125] Determining which voxels a ray passes through involves the following:

[0126] Step S31: determining the three-dimensional voxel coordinates of the target voxel through which the light passes;

[0127] Step S32: determining the target first-level voxel block where the target voxel is located according to the three-dimensional voxel coordinates and the side length of the first-level voxel block, wherein the volume data is composed of a plurality of cube-shaped first-level voxel blocks;

[0128] Step S33: determining the target secondary voxel block where the target voxel is located based on the offset of the three-dimensional voxel coordinates in the target primary voxel block and the side length of the secondary voxel block, wherein each primary voxel block is composed of a plurality of cube-shaped secondary voxel blocks, and the offset refers to the relative position difference of the target voxel with respect to the starting position of the target primary voxel block;

[0129] Step S34: repeating the above step of determining the target lower-level voxel block where the target voxel is located according to the offset and the side length of the lower-level voxel block, wherein each lower-level voxel block is in a cube shape;

[0130] Step S35: The target voxel block at the last level is used as the voxel through which the light passes.

[0131] In step S31, as light propagates through the volume data, the 3D voxel coordinates of the target voxel it passes through must first be determined. These coordinates are analogous to precise positioning in 3D space. For example, in medical CT imaging volume data, each voxel corresponds to a tiny unit at a specific location within the human body. Ray casting algorithms can track the intersection of light rays with these voxels, thereby obtaining the 3D voxel coordinates (x, y, z) corresponding to the intersection. These coordinates detail the specific location of the target voxel within the entire 3D volume data space.

[0132] In step S32, the volume data is composed of a plurality of cube-shaped first-level voxel blocks arranged neatly, similar to a large structure built of many small cube blocks. When determining the target first-level voxel block where the target voxel is located, it is necessary to first determine the three coordinate values ​​x, y, and z in the three-dimensional voxel coordinates. Then, the quotient of each coordinate value and the side length of the first-level voxel block is calculated respectively. Assuming that the side length of the first-level voxel block is a, the quotient in the x direction is The quotient in the y direction is The quotient in the z direction is Here = represents a round-down operation, since the voxel block index is an integer. The three quotients obtained are used as the indices of the volume data in the corresponding length, width, and height directions, so that the target voxel in the target primary voxel block can be accurately determined. For example, if the calculated x-direction index is 3, the y-direction index is 5, and the z-direction index is 2, then the target voxel is located in the primary voxel block determined by the 3rd length direction, the 5th width direction, and the 2nd height direction in the volume data.

[0133] In step S33, after clarifying the target first-level voxel block where the target voxel is located, it is necessary to further determine its more precise position within the first-level voxel block, that is, the target second-level voxel block where it is located. First, take the remainder of the side length of the first-level voxel block by each coordinate value, and use the three remainders obtained as the offsets of the three-dimensional voxel coordinates in the target first-level voxel block. Continuing with the above example, if x=3a+r1, y=5a+r2, z=2a+r3 (where r1, r2, r3 are the results of taking the remainder of x, y, z with respect to a, respectively), then r1, r2, r3 are the offsets in the target first-level voxel block. This offset reflects the relative position difference of the target voxel relative to the starting position of the first-level voxel block. Each first-level voxel block is composed of a plurality of cube-shaped second-level voxel blocks. Let the side length of the second-level voxel block be b. Next, calculate the quotient of each remainder and the side length of the second-level voxel block, that is The three quotients are used as indices of the target primary voxel block in the corresponding length, width, and height directions, thereby determining the target secondary voxel block in which the target voxel is located. For example, if the quotients of r1, r2, r3, and b are 2, 3, and 1, respectively, then the target voxel is located in the secondary voxel block defined by the second length direction, the third width direction, and the first height direction within the primary voxel block.

[0134] In step S34, after the target secondary voxel block is determined, there may be a smaller level of voxel block division in the future, such as a tertiary voxel block. At this time, continue to repeat the above calculation steps based on the offset and the side length of the lower voxel block. Taking the determination of the tertiary voxel block from the secondary voxel block as an example, first calculate the offset of the target voxel in the secondary voxel block, that is, take the remainder of the side length of the secondary voxel block by the relative coordinate value of the target voxel in the secondary voxel block to obtain a new offset. Then, calculate the quotient of these offsets and the side length of the tertiary voxel block as the index to determine the position of the target voxel in the tertiary voxel block. This cycle is repeated until the last level voxel block where the target voxel is located is determined. Each lower voxel block here is in the shape of a cube, and this regular shape facilitates unified calculation and processing.

[0135] In step S35, after a series of progressive calculation steps, the final target voxel block is determined, representing the voxels that the light actually passed through. This gradual refinement allows the precise location of the voxels involved in the light's propagation path within the volume data, providing an accurate data foundation for subsequent analysis of various properties during light propagation, calculation of light projection results, and final volume rendering.

[0136] An example of the voxels that a ray passes through is shown below.

[0137] 1. Determine the location of the target voxel in the first-level voxel block: Assume that the coordinates of the target voxel to be found are (x, y, z). Calculate its index in the first-level voxel block using the formula: Long-direction index Width index High Directional Index These three indices determine that the target voxel is located in the (i1, j1, k1)th voxel block of the first level. At this time, the search range is narrowed from the entire volume data to a (16, 16, 16) voxel block.

[0138] 2. Find the second-level voxel block based on the first-level voxel block: Within the determined first-level voxel block, calculate the offset of the target voxel relative to the starting position of the first-level voxel block. Calculate the index in the second-level voxel block using the formula: long-direction index Width index High Directional Index It is thus determined that the target voxel is located in the (i2, j2, k2)th voxel block of the second level, and the search range is further narrowed to the (8, 8, 8) voxel block.

[0139] 3. Find the third-level voxel block based on the second-level voxel block: In the second-level voxel block, calculate the offset of the target voxel relative to the starting position of the second-level voxel block again. Calculate the index in the third-level voxel block by the formula: long-direction index Width index High Directional Index Through these three indexes, the target voxel is accurately located in the (4,4,4) voxel block, completing the search for the target voxel.

[0140] This application provides a schematic diagram of the overall process of volume rendering of a three-dimensional image, such as Figure 6 As shown, the following steps are included:

[0141] Step 601: Imaging plane sampling.

[0142] First, the imaging plane corresponding to multiple organ scan images is divided into multiple identical sub-regions. Then, the initial pixel points of the imaging plane are sampled according to a specific setting. That is, the sampling density of the sub-region at the center of the imaging plane is greater than the sampling density of the surrounding sub-regions, thereby highlighting the information of the central key area.

[0143] Step 602: Initially sample the imaging plane using a ray casting algorithm.

[0144] According to the ray casting algorithm, the initial pixel points are sampled according to the preset step size to obtain the sampled target pixel points.

[0145] Step 603: Determine regions of interest and non-regions of interest.

[0146] Analyze the projected light rays from the sampled target pixels. Based on the analysis results, determine the light propagation depth within the volume data composed of multiple organ scan images. Simultaneously, determine the complexity of the light rays' passage through the volume data based on the degree of change in the properties of the multiple voxels the light rays pass through or the degree of change in the number of sampling points the light rays pass through. If the light propagation depth is less than a preset depth threshold, or the complexity is greater than a preset complexity threshold, the light rays originate from a region of interest in the imaging plane. If the light propagation depth is greater than or equal to the preset depth threshold, and the complexity is less than or equal to the preset complexity threshold, the light rays originate from a non-region of interest in the imaging plane.

[0147] Step 604: Use a ray casting algorithm to perform ray casting calculations on different areas.

[0148] For target pixels in the region of interest, sampling is performed according to the first step length, and then ray casting calculations are performed. For target pixels in non-regions of interest, sampling is performed according to a second step length that is larger than the first step length, and ray casting calculations are performed.

[0149] Step 605: Generate a three-dimensional image.

[0150] According to the calculation results of ray projection of the region of interest and the region of non-interest, data integration and processing are performed to generate a three-dimensional image corresponding to the organ scan image.

[0151] Step 606: Dynamically process according to user operation.

[0152] After generating a 3D image, the system monitors the user's operating status in real time. If the user is actively manipulating the 3D image, the raycast calculation results for edge pixels in the region of interest are used as the raycast calculation results for regions of non-interest, reducing the amount of computation and ensuring smooth operation. If the user stops manipulating the 3D image, the target pixels in the non-interest region are resampled using the second step size and raycast calculations are performed, resulting in a precise and clear 3D image.

[0153] In the ray casting algorithm of steps 603 and 604, a GPU is used to implement thread parallelism within a sub-region and thread parallelism between sub-regions, thereby increasing the speed of ray casting calculation.

[0154] In the ray casting algorithm at steps 603 and 604, the ray passes through the voxel to locate the target voxel: the 3D voxel coordinates of the target voxel through which the ray passes are determined. Based on these coordinates and the side length of the first-level voxel block, the target first-level voxel block in which the target voxel is located is calculated. Then, based on the target voxel's offset in the first-level voxel block and the side length of the second-level voxel block, the target second-level voxel block is determined. This process is repeated until the final voxel block is found.

[0155] Based on the same technical concept, the present application provides a volume rendering device for a three-dimensional image, such as Figure 7 As shown, the device includes:

[0156] A sampling module 701 is configured to perform sampling in imaging planes corresponding to a plurality of organ scan images according to a ray casting algorithm to obtain sampled target pixel points;

[0157] A determination module 702 is configured to determine a region of interest and a region of non-interest in an imaging plane by performing a ray casting analysis on the target pixel point, wherein the region of interest includes a target organ to be focused on;

[0158] A first calculation module 703 is used to perform ray casting calculation on the target pixel points in the region of interest after sampling according to the first step;

[0159] A second calculation module 704 is configured to perform ray casting calculation on target pixels in the non-interested region after sampling according to a second step length, wherein the second step length is greater than the first step length;

[0160] The generating module 705 is configured to generate a three-dimensional image corresponding to the organ scanning image according to the ray casting calculation results of the region of interest and the region of non-interest.

[0161] Optionally, the sampling module 701 is used to:

[0162] dividing the imaging plane into a plurality of sub-regions;

[0163] Sampling the imaging plane according to a set method to obtain initial pixel points, wherein the set method is that the sampling density of the central sub-region of the imaging plane is greater than the sampling density of the peripheral sub-regions;

[0164] According to the ray casting algorithm, the initial pixel point is sampled according to the preset step size to obtain the sampled target pixel point, wherein the preset step size is larger than the second step size.

[0165] Optionally, the determining module 702 is configured to:

[0166] Analyze the projection light of the target pixel;

[0167] Determining the propagation depth of the light in the volume data composed of multiple organ scan images based on the analysis results, and determining the complexity of the light traveling through the volume data based on the degree of change in the properties of multiple voxels passed by the light or the degree of change in the number of sampling points passed by the light;

[0168] The regions of interest and non-regions of interest in the imaging plane are determined based on the ray propagation depth or the complexity of the ray traversing the volume data.

[0169] Optionally, the determining module 702 is configured to:

[0170] When it is detected that the user is currently operating the three-dimensional image, a ray casting calculation result of edge pixels in the region of interest is used as a ray casting calculation result in the non-interest region; and a three-dimensional image during the user operation is generated based on the new ray casting calculation results of the region of interest and the non-interest region;

[0171] When it is detected that the user stops operating the three-dimensional image, the target pixel points in the non-interest area are sampled according to the second step size and then ray casting calculation is performed; and based on the new ray casting calculation results of the area of ​​interest and the non-interest area, a three-dimensional image after the user operation is completed is generated.

[0172] Optionally, the device is further used to:

[0173] When it is detected that the user is currently operating the three-dimensional image, the ray casting calculation result of the edge pixel point in the area of ​​interest is used as the ray casting calculation result in the non-area of ​​interest;

[0174] When it is detected that the user stops operating the three-dimensional image, the target pixel points in the non-interested area are sampled according to the second step length and then the ray casting calculation is performed.

[0175] Optionally, the organ scan image is stored in a memory of the graphics processing unit;

[0176] The device is also used to: during the process of performing ray casting calculations, decompose the process of the ray casting calculations into multiple independent streams through the graphics processing unit, and divide each stream into multiple threads, wherein multi-stream processing is used to realize thread parallelism within a stream and thread operation between different streams; and use the multi-stream processing to perform thread parallelism within a sub-region and thread asynchronous calculations between sub-regions.

[0177] Optionally, the device is further used to:

[0178] Determine the three-dimensional voxel coordinates of the target voxel through which the ray passes;

[0179] determining a target first-level voxel block where the target voxel is located according to the three-dimensional voxel coordinates and the side length of the first-level voxel block, wherein the volume data is composed of a plurality of cube-shaped first-level voxel blocks;

[0180] Determine the target secondary voxel block where the target voxel is located based on the offset of the three-dimensional voxel coordinates in the target primary voxel block and the side length of the secondary voxel block, wherein each primary voxel block is composed of a plurality of cube-shaped secondary voxel blocks, and the offset refers to the relative position difference of the target voxel with respect to the starting position of the target primary voxel block;

[0181] Repeat the above steps of determining the target lower-level voxel block where the target voxel is located according to the offset and the side length of the lower-level voxel block, wherein each lower-level voxel block is in a cube shape;

[0182] The target voxel block of the last level is taken as the voxel that the ray passes through.

[0183] like Figure 8 As shown, an embodiment of the present application provides an electronic device, including a processor 801, a communication interface 802, a memory 803 and a communication bus 804, wherein the processor 801, the communication interface 802, and the memory 803 communicate with each other through the communication bus 804.

[0184] The memory 803 is used to store computer programs.

[0185] In one embodiment of the present application, the processor 801 is configured to implement the volume rendering method for a three-dimensional image provided by any one of the aforementioned method embodiments when executing a program stored in the memory 803 .

[0186] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the volume rendering method for a three-dimensional image provided in any of the aforementioned method embodiments are implemented.

[0187] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.

[0188] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, or of course, by hardware. Based on this understanding, the above technical solution, in essence, or the part that contributes to the relevant technology, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiment.

[0189] It should be understood that the terms used herein are for the purpose of describing specific example embodiments only and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "comprise", "include", "contain" and "have" are inclusive and therefore specify the presence of stated features, steps, operations, elements and / or parts, but do not exclude the presence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not to be construed as necessarily requiring them to be performed in the specific order described or illustrated, unless the order of execution is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0190] The foregoing is merely a list of specific embodiments of the present application, intended to enable those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the broadest scope consistent with the principles and novel features of the present application.

Claims

1. A volume rendering method for a three-dimensional image, characterized in that: The method comprises: Sampling is performed in the imaging plane corresponding to the plurality of organ scan images according to a ray casting algorithm to obtain the sampled target pixel points; Determining a region of interest and a region of non-interest in the imaging plane by performing ray casting analysis on the target pixel point, wherein the region of interest includes a target organ to be focused on; Perform ray casting calculation on the target pixel points in the region of interest according to the first step of sampling; Performing ray casting calculation on the target pixel points in the non-interested area after sampling according to a second step length, wherein the second step length is greater than the first step length; A three-dimensional image corresponding to the organ scan image is generated according to the ray casting calculation results of the region of interest and the non-region of interest.

2. The method according to claim 1, characterized in that According to the ray casting algorithm, sampling is performed in the imaging plane corresponding to multiple organ scan images, and the sampled target pixel points include: dividing the imaging plane into a plurality of sub-regions; Sampling the imaging plane according to a set method to obtain initial pixel points, wherein the set method is that the sampling density of the central sub-region of the imaging plane is greater than the sampling density of the peripheral sub-regions; According to the ray casting algorithm, the initial pixel point is sampled according to a preset step size to obtain a sampled target pixel point, wherein the preset step size is greater than the second step size.

3. The method according to claim 1, characterized in that By performing ray casting analysis on the target pixel point, determining the region of interest and the region of non-interest in the imaging plane includes: Analyzing the projection light of the target pixel point; determining a propagation depth of the light in the volume data formed by the plurality of organ scan images based on the analysis result, and determining a complexity of the light traveling through the volume data based on a degree of change in properties of a plurality of voxels passed by the light or a degree of change in the number of sampling points passed by the light; A region of interest and a region of non-interest in the imaging plane are determined according to the light propagation depth or the complexity of the light passing through the volume data.

4. The method according to claim 3, characterized in that Determining the region of interest and the non-region of interest in the imaging plane according to the light propagation depth or the complexity of the light passing through the volume data includes: If the light propagation depth is less than a preset depth threshold, or the complexity is greater than a preset complexity threshold, determining that the light comes from the region of interest in the imaging plane; If the light propagation depth is greater than or equal to the preset depth threshold, and the complexity is less than or equal to the preset complexity threshold, it is determined that the light comes from a non-interest region in the imaging plane.

5. The method according to claim 1, wherein After generating the three-dimensional image, the method further includes: When it is detected that the user is currently operating the three-dimensional image, a ray casting calculation result of edge pixels in the region of interest is used as a ray casting calculation result in the non-interest region; and a three-dimensional image during the user operation is generated based on the new ray casting calculation results of the region of interest and the non-interest region; When it is detected that the user stops operating the three-dimensional image, the target pixel points in the non-interest area are sampled according to the second step size and then ray casting calculation is performed; and based on the new ray casting calculation results of the area of ​​interest and the non-interest area, a three-dimensional image after the user operation is completed is generated.

6. The method according to claim 2, characterized in that The organ scan image is stored in a memory of a graphics processing unit; During the ray casting calculation process, the method further includes: decomposing the ray casting calculation process into multiple independent streams in the graphics processing unit, and dividing each stream into multiple threads, wherein multi-stream processing is used to realize thread parallelism within a stream and thread operation between different streams; and using the multi-stream processing to perform thread parallelism within a sub-region and thread asynchronous calculation between sub-regions.

7. The method according to claim 1 or 3, characterized in that The voxels that a ray passes through during the ray casting calculation include: Determine the three-dimensional voxel coordinates of the target voxel through which the ray passes; determining a target first-level voxel block where the target voxel is located according to the three-dimensional voxel coordinates and the side length of the first-level voxel block, wherein the volume data is composed of a plurality of cube-shaped first-level voxel blocks; Determining a target secondary voxel block where the target voxel is located based on an offset of the three-dimensional voxel coordinates in the target primary voxel block and a side length of the secondary voxel block, wherein each primary voxel block is composed of a plurality of cube-shaped secondary voxel blocks, and the offset refers to a relative position difference of the target voxel relative to a starting position of the target primary voxel block; Repeat the above steps of determining the target lower-level voxel block where the target voxel is located according to the offset and the side length of the lower-level voxel block, wherein each lower-level voxel block is in a cube shape; The target voxel block of the last level is taken as the voxel that the ray passes through.

8. A volume rendering device for a three-dimensional image, characterized in that: The device comprises: A sampling module is used to sample in the imaging planes corresponding to the multiple organ scan images according to a ray casting algorithm to obtain the sampled target pixel points; a determination module, configured to determine a region of interest and a region of no interest in the imaging plane by performing a ray casting analysis on the target pixel point, wherein the region of interest includes a target organ to be focused on; A first calculation module is used to perform ray casting calculation on the target pixel points in the region of interest after sampling according to the first step; a second calculation module, configured to perform ray casting calculation on the target pixel points in the non-interested region after sampling according to a second step length, wherein the second step length is greater than the first step length; A generating module is used to generate a three-dimensional image corresponding to the organ scanning image according to the ray casting calculation results of the region of interest and the non-region of interest.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory for storing computer programs; A processor, configured to implement the method according to any one of claims 1 to 7 when executing a program stored in a memory.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.