Medical image rendering method and device, computer equipment and readable storage medium
By rendering the mesh data and volume data on medical images, and combining the depth stripping and half-width slice algorithms, the problem of poor rendering of volume data and mesh data in the existing technology is solved, and better Medical image rendering effect.
Patent Information
- Application Number
- CN202411053519.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-12-27
AI Technical Summary
Existing medical image rendering methods have poor rendering effects on volume and mesh data, resulting in poor rendering effects.
By rendering the slice data of mesh data and volume data separately, and fusing the rendered mesh rendered image with the slice rendered image, the combination of the depth stripping algorithm and the half-width slice algorithm is used to realize the volume data and mesh data Mixed rendering.
It improves the rendering effect of medical images, makes the mixed rendering of volume data and mesh data clearer, and solves the problem of poor rendering effect in the original technology.
Smart Images

Figure CN119206023A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of visualization technology, and in particular to a medical image rendering method, apparatus, computer equipment and readable storage medium. Background Art
[0002] Using technologies such as computer graphics to convert medical data into a visual form helps doctors and medical researchers better understand, analyze and diagnose diseases.
[0003] Medical data includes volume data and mesh data. Volume data is usually data of target parts determined by medical images, and mesh data is usually data of medical instruments, such as data corresponding to catheters. At present, different methods are used to render volume data and mesh data respectively to obtain rendered images during visualization.
[0004] However, current medical image rendering methods for volume data and mesh data suffer from poor rendering effects. Summary of the invention
[0005] Based on this, it is necessary to provide a medical image rendering method, apparatus, computer device and readable storage medium that can improve the rendering effect in response to the above technical problems.
[0006] In a first aspect, the present application provides a medical image rendering method, comprising:
[0007] Rendering the mesh data to obtain a mesh rendering image;
[0008] Rendering each slice data corresponding to the volume data to obtain a slice rendering image of each slice data;
[0009] The grid rendering image and the slice rendering images of each slice data are fused and rendered to obtain a target rendering image.
[0010] In one of the embodiments, the grid rendering image includes an internal grid rendering image and an external grid rendering image; and the grid rendering image and the slice rendering images of each slice data are fused and rendered to obtain a target rendering image, including:
[0011] The internal mesh rendering image and each slice rendering image are fused and rendered to obtain an initial rendering image; the depth of the internal mesh rendering image is within the depth range of the volume data;
[0012] The initial rendering image and the external mesh rendering image are fused and rendered to obtain the target rendering image.
[0013] In one embodiment, the internal grid rendering image and each slice rendering image are fused and rendered to obtain an initial rendering image, including:
[0014] The internal grid rendering image and each slice rendering image are fused and rendered to obtain an intermediate rendering image;
[0015] The intermediate rendered image is processed to obtain an initial rendered image.
[0016] In one embodiment, the internal grid rendering image and each slice rendering image are fused and rendered to obtain an intermediate rendering image, including:
[0017] The first slice rendering image and the internal grid rendering sub-image are merged into the second slice rendering image to obtain an updated second slice rendering image; the first slice rendering image and the second slice rendering image are two adjacent slice rendering images in a preset direction, and the internal grid rendering sub-image is an internal grid rendering image between the first slice rendering image and the second slice rendering image;
[0018] The updated second slice rendering images and the first slice rendering image in the preset direction are fused to obtain an intermediate rendering image.
[0019] In one embodiment, the mesh rendering image includes a first rendering image and a first depth map corresponding to the first rendering image; the first slice rendering image and the internal mesh rendering sub-image are fused into the second slice rendering image to obtain an updated second slice rendering image, including:
[0020] Determining a first depth of a first sampling point in the first slice rendering image and a second depth of a second sampling point in the second slice rendering image, the first sampling point corresponding to the second sampling point in a preset direction;
[0021] According to the first depth map, determining an internal mesh rendering sub-image from the first rendering image; the depth corresponding to the internal mesh rendering sub-image is between the first depth and the second depth;
[0022] The first slice rendering image and the internal mesh rendering sub-image are merged into the second slice rendering image to obtain an updated second slice rendering image.
[0023] In one embodiment, the initial rendering image and the external mesh rendering image are fused and rendered to obtain a target rendering image, including:
[0024] The initial rendered image, the external mesh rendered image, and the reference depth information corresponding to the slice data closest to the screen are fused and rendered to obtain the target rendered image.
[0025] In one embodiment, the initial rendered image, the external mesh rendered image, and the reference depth information corresponding to the slice data closest to the screen are fused and rendered to obtain a target rendered image, including:
[0026] Rendering the initial rendered image, the external mesh rendered image, and the reference depth information to obtain a second rendered image and a second depth map corresponding to the second rendered image;
[0027] According to the second depth map, the second rendered image is fused in directions from far to near from the screen to obtain a target rendered image.
[0028] In one embodiment, rendering each slice data corresponding to the volume data to obtain a slice rendering image of each slice data includes:
[0029] Slice the volume data to obtain slice data corresponding to the volume data;
[0030] If the slice data passes through a plurality of volume data, a slice rendering image of the slice data is obtained according to a slice rendering image corresponding to at least one of the passed volume data.
[0031] In one embodiment, obtaining a slice rendered image of slice data according to a slice rendered image corresponding to at least one volume data passed through includes:
[0032] According to the priority order of at least one volume data passed, the slice rendering image corresponding to each volume data is fused to determine the slice rendering image of the slice data.
[0033] In one embodiment, rendering each slice data corresponding to the volume data to obtain a slice rendering image of each slice data includes:
[0034] For each slice data, determine the color information of the slice data according to the gray value corresponding to the slice data;
[0035] Sample the preset shadow map to obtain the lighting information corresponding to the slice data;
[0036] A slice rendering image of the slice data is determined according to the color information and the illumination information of each slice data.
[0037] In a second aspect, the present application also provides a medical image rendering device, comprising:
[0038] A first rendering module, used for rendering the mesh data to obtain a mesh rendering image;
[0039] A second rendering module is used to render each slice data corresponding to the volume data to obtain a slice rendering image of each slice data;
[0040] The third rendering module is used to perform fusion rendering on the grid rendering image and the slice rendering images of each slice data to obtain a target rendering image.
[0041] In a third aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any of the above methods when executing the computer program.
[0042] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of any of the above methods when executed by a processor.
[0043] In a fifth aspect, the present application also provides a computer program product, including a computer program, which implements the steps of any of the above methods when executed by a processor.
[0044] The medical image rendering method, device, computer equipment and readable storage medium render the mesh data to obtain a mesh rendering image, and render each slice data corresponding to the volume data to obtain a slice rendering image of each slice data. After obtaining the mesh rendering image and the slice rendering image of each slice data, the mesh rendering image and the slice rendering image can be fused and rendered to obtain a target rendering image, thus achieving the rendering of the volume data and the mesh data together, thereby improving the rendering effect obtained by rendering the volume data and the mesh data using different methods in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0046] FIG1 is a diagram of an application environment of a medical image rendering method according to an embodiment;
[0047] Figure 2 is a schematic flow chart of a medical image rendering method in one embodiment;
[0048] Figure 3 A schematic diagram of a process of a depth peeling algorithm in one embodiment;
[0049] Figure 4 A schematic diagram of a process for obtaining a target rendered image in one embodiment;
[0050] Figure 5 A schematic diagram of a process for obtaining an initial rendered image in one embodiment;
[0051] Figure 6 A schematic diagram of a process for obtaining an intermediate rendering image in one embodiment;
[0052] Figure 7 A schematic diagram of a process of obtaining an updated second slice rendering image in one embodiment;
[0053] Figure 8 A schematic diagram of a process of obtaining an updated second slice rendering image in one embodiment;
[0054] Fig. 9 A schematic diagram of another process of obtaining a target rendered image in an embodiment;
[0055] Fig.10 A schematic diagram of a process for obtaining a slice rendering image in one embodiment;
[0056] Fig.11 A schematic diagram of a slicing process in implementation;
[0057] Fig.12 is a schematic diagram of a bounding box in one embodiment;
[0058] Fig.13 A schematic diagram of a process of a medical image rendering method in one embodiment;
[0059] Fig.14 is a process schematic diagram of yet another medical image rendering method in an embodiment;
[0060] Fig.15 FIG. 4 is a structural block diagram of a medical image rendering device in one embodiment. DETAILED DESCRIPTION
[0061] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0062] In the related art, volume data is usually rendered using a half-angle slicing algorithm, and mesh data is rendered using a depth peeling algorithm, wherein the half-angle slicing algorithm can also be called a texture mapping algorithm. In actual clinical diagnostic applications, more and more application scenarios require the simultaneous rendering of volume data and mesh data, so that semi-transparent mesh data can be seen through semi-transparent human tissue, or human tissue can be seen through semi-transparent mesh data. It can be understood that human tissue is the tissue corresponding to the volume data. However, the half-angle slicing algorithm and the depth peeling algorithm are two independent algorithms, and the half-angle slicing algorithm does not support the mixed rendering of volume data and mesh data. Therefore, the rendered image obtained after rendering the volume data and mesh data separately has occlusion, resulting in poor rendering effect. Based on this, it is necessary to provide a medical image rendering method, which will be introduced below.
[0063] FIG. 1 is an application environment diagram of a medical image rendering method in an embodiment. In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG. 1. The computer device includes a processor, a memory, an input / output interface (I / O for short) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store relevant data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a medical image rendering method is implemented.
[0064] Those skilled in the art will understand that the structure shown in FIG. 1 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0065] This embodiment uses the method applied to a server as an example for illustration. It is understandable that the method can also be applied to a terminal, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. The terminal can be, but is not limited to, various personal computers, laptops, smart phones, and tablet computers. The server can be implemented as an independent server or a server cluster consisting of multiple servers.
[0066] Figure 2 FIG. 1 is a flow chart of a medical image rendering method in an embodiment. In an exemplary embodiment, Figure 2 As shown, a medical image rendering method is provided, which is described by taking the method applied to the computer device in FIG. 1 as an example, and includes the following S201 to S203.
[0067] S201, rendering the mesh data to obtain a mesh rendering image.
[0068] In this embodiment, the grid data includes information of each surface point on the object, wherein the information of the surface point may be the position, color, etc. of the surface point, and the object may include but is not limited to a medical device. For example, the grid data may be data corresponding to the medical device, and the medical device may be a catheter during surgery, etc.
[0069] Optionally, the computer device may obtain grid data sent by other devices or input by a user, and the computer device may also analyze the image of the object to obtain the grid data.
[0070] Further optionally, the grid data includes semi-transparent grid data, which is data that is not opaque grid data.
[0071] The mesh rendering image refers to an image obtained by rendering the mesh data. The computer device may render the mesh data based on a rasterization algorithm to obtain the mesh rendering image, or may render the mesh data based on a depth peeling algorithm to obtain the mesh rendering image, but the present embodiment is not limited thereto.
[0072] The following is an example of rendering mesh data based on the depth peeling algorithm. The depth peeling algorithm is an order-independent semi-transparent OIT (Order Independent Transparency) algorithm, which requires rendering the entire scene n times (n is an integer greater than 0).
[0073] Figure 3 FIG. 1 is a schematic diagram of a process of a depth peeling algorithm in an embodiment. Figure 2As shown, taking n=3 as an example, the first rendering obtains rendered image 1 and depth map 1 corresponding to rendered image 1. The second rendering uses depth map 1 obtained in the first rendering to obtain rendered image 2 and depth map corresponding to rendered image 2. The third rendering uses depth map 1 obtained in the second rendering to obtain depth map 2 corresponding to rendered image 2. Figure 2 To obtain the rendered image 3 and the depth map corresponding to the rendered image 3. Figure 2 The 0~1 in represents the depth of the scene, 0 represents the closest distance to the screen, and 1 represents the farthest distance to the screen. It can be seen that the depth of rendered image 1 is less than the depth of rendered image 2 and less than the depth of rendered image 3. After that, the computer device can sequentially mix rendered image 3, rendered image 2 and rendered image 1 according to the distance from the screen from far to near to obtain a grid rendered image. In this way, based on the depth peeling algorithm, the depth is sorted by distance, which speeds up the sorting speed, and then a more accurate semi-transparent color can be obtained to present the effect of semi-transparent grid data.
[0074] Based on this, the computer device renders the mesh data based on the depth peeling algorithm, and the obtained mesh rendering image may include n first rendering images and first depth maps corresponding to the n first rendering images. Among them, the first rendering image is used to indicate the rendering result of the mesh data, and the first depth map can be used to indicate the depth of each pixel in the first rendering image. n is an integer greater than 0, and generally can be taken between 4 and 6.
[0075] It should be noted that the above takes a unidirectional depth peeling algorithm as an example. In the unidirectional depth peeling algorithm, peeling is performed from a fixed direction from front to back to obtain a grid rendering image. In the present application, the computer device can also use a bidirectional depth peeling algorithm. If a bidirectional depth peeling (Daul Depth Peeling) algorithm is used, peeling is performed based on two directions from front to back and from back to front. In some embodiments, if a bidirectional depth peeling algorithm is used, the computer device needs to be implemented by a double depth buffer.
[0076] S202, rendering each slice data corresponding to the volume data to obtain a slice rendering image of each slice data.
[0077] In this embodiment, the volume data includes information corresponding to each voxel in the target part, and the target part may be a heart, a head, etc. The information corresponding to the voxel may be a gray value of the voxel, etc.
[0078] Optionally, the computer device may obtain volume data sent by other devices (such as medical scanning devices) or input by users, and then the computer device slices the volume data to obtain each slice data. The computer device may also obtain each slice data sent by other devices or stored by itself.
[0079] The slice rendering image refers to an image obtained by rendering the slice data. For example, if the volume data includes three slice data A to C, the slice data A is rendered to obtain the slice rendering image A, the slice data B is rendered to obtain the slice rendering image B, and the slice data C is rendered to obtain the slice rendering image C.
[0080] In some embodiments, the computer device may input each slice data into a shader to obtain a slice rendering image of each slice data. When the computer device uses the shader to draw each slice data, it may also use a preset global illumination model to obtain a more realistic slice rendering image.
[0081] The global illumination model may include at least one of different light source types, soft shadows, hard shadows, specular highlights, color bleeding, and ambient light.
[0082] S203 , performing fusion rendering on the grid rendering image and the slice rendering images of each slice data to obtain a target rendering image.
[0083] Furthermore, after the computer device obtains the grid rendering image and the slice rendering images of each slice data, it can perform fusion rendering on the grid rendering image and the slice rendering images of each slice data to obtain a target rendering image. Fusion rendering is a rendering method that mixes rendering images obtained by different methods.
[0084] Optionally, the computer device may perform weighted calculation on the grid rendering image and the slice rendering images of each slice data and then render them to obtain a target rendering image. The computer device may also render the grid rendering image and the slice rendering images in sequence according to the depth of the grid rendering image and each slice rendering image to obtain the target rendering image. This embodiment does not impose any limitation.
[0085] In the above-mentioned medical image rendering method, the mesh data is rendered to obtain a mesh rendering image, and each slice data corresponding to the volume data is rendered to obtain a slice rendering image of each slice data. Since after obtaining the mesh rendering image and the slice rendering image of each slice data, the mesh rendering image and the slice rendering image can be fused and rendered to obtain a target rendering image, thus achieving the rendering of the volume data and the mesh data together, thereby improving the rendering effect obtained by rendering the volume data and the mesh data using different methods in the related art.
[0086] Figure 4 FIG. 1 is a flow chart of obtaining a target rendered image in an embodiment. In an exemplary embodiment, the grid rendered image includes an internal grid rendered image and an external grid rendered image. Figure 4As shown, S203 includes S401 to S402.
[0087] S401 , performing fusion rendering on the internal mesh rendering image and each slice rendering image to obtain an initial rendering image; the depth of the internal mesh rendering image is within the depth range of the volume data.
[0088] In this embodiment, the mesh rendering image includes an internal mesh rendering image and an external mesh rendering image. The depth of the internal mesh rendering image is within the depth range of the volume data, that is, the depth of the internal mesh rendering image is less than or equal to the depth corresponding to the volume data. The depth of the external mesh rendering image is outside the depth range of the volume data, that is, the depth of the external mesh rendering image is less than or equal to the depth corresponding to the volume data.
[0089] Then, the computer device will fuse and render the internal grid rendering image and each slice rendering image to obtain an initial rendering image. Optionally, the computer device can perform weighted calculation on the grid rendering image and the slice rendering image of each slice data and then render to obtain the initial rendering image.
[0090] Optionally, the computer device may also fuse the first slice rendering image and the internal grid rendering sub-image into the second slice rendering image to obtain an updated second slice rendering image, and then fuse each updated second slice rendering image with the first slice rendering image in a preset direction to obtain an intermediate rendering image. The first slice rendering image and the second slice rendering image are two adjacent slice rendering images in the preset direction, and the internal grid rendering sub-image is an internal grid rendering image between the first slice rendering image and the second slice rendering image.
[0091] For example, assuming that there are four slice rendering images A to D in sequence along a preset direction, the computer device can fuse the slice rendering image A with the internal grid rendering image in the slice rendering image B and the slice rendering image A onto the slice rendering image B to obtain the slice rendering image B. * Then, the slice rendering image B is merged with the internal mesh rendering image in the slice rendering image C and the slice rendering image B to obtain the slice rendering image C. * , the slice rendering image C is merged with the internal mesh rendering image in the slice rendering image D and the slice rendering image C to obtain the slice rendering image D * Finally, the computer device fuses the slice rendering image A and the slice rendering image B. * , slice rendering image C * and slice rendered image D * , and get the initial rendered image.
[0092] S402: fusion rendering of the initial rendering image and the external mesh rendering image to obtain a target rendering image.
[0093] Further, after obtaining the initial rendering image, the computer device can fuse the initial rendering image and the external mesh rendering image to obtain the target rendering image. Optionally, the computer device can fuse the initial rendering image and the external mesh rendering image based on a depth peeling algorithm to obtain the target rendering image.
[0094] In the above embodiment, since the depth of the internal grid rendering image is within the depth range of the volume data and the depth of the external grid rendering image is outside the depth range of the volume data, after the internal grid rendering image and each slice rendering image are fused and rendered to obtain the initial rendering image, and the initial rendering image and the external grid rendering image are fused and rendered to obtain the target rendering image, the grid data between the slice data can be mixed first, and then the grid data outside the slice data can be mixed, which is conducive to obtaining a mixed rendering effect of the half-angle slicing algorithm and the depth peeling algorithm of the semi-transparent grid, and then, the semi-transparent grid data can be seen through the semi-transparent human tissue, or the human tissue can be seen through the semi-transparent grid data, thereby improving the rendering effect.
[0095] Figure 5 FIG. 1 is a flow chart of obtaining an initial rendered image in an embodiment. In an exemplary embodiment, as shown in FIG. Figure 5 As shown, S401 includes S501 to S502. Among them:
[0096] S501 , performing fusion rendering on the internal grid rendering image and each slice rendering image to obtain an intermediate rendering image.
[0097] In this embodiment, for example, the computer device may perform weighted calculation on the grid rendering image and the slice rendering images of each slice data and then render to obtain an intermediate rendering image, but this embodiment is not limited thereto.
[0098] S502: Process the intermediate rendering image to obtain an initial rendering image.
[0099] In this embodiment, after obtaining the intermediate rendering image, the computer device can process the intermediate rendering image to improve the quality of the obtained initial rendering image. The processing of the intermediate rendering image includes but is not limited to tone processing, noise reduction processing, etc.
[0100] Exemplarily, the computer device may convert the intermediate rendered image from HDR (High Dynamic Range) to LDR (Low Dynamic Range) to obtain an initial rendered image.
[0101] In the above embodiment, since the internal grid rendering image and each slice rendering image are fused and rendered to obtain an intermediate rendering image, the intermediate rendering image is processed, so that an initial rendering image with good quality can be obtained, which is beneficial to subsequent hybrid rendering.
[0102] Figure 6 FIG. 1 is a flow chart of obtaining an intermediate rendering image in an embodiment. In an exemplary embodiment, as shown in FIG. Figure 6 As shown, S501 includes S601 to S602. Among them:
[0103] S601, merging a first slice rendering image and an internal grid rendering sub-image into a second slice rendering image to obtain an updated second slice rendering image; the first slice rendering image and the second slice rendering image are two adjacent slice rendering images in a preset direction, and the internal grid rendering sub-image is an internal grid rendering image between the first slice rendering image and the second slice rendering image.
[0104] In this embodiment, the preset direction is usually a determined direction, for example, it can be a line of sight direction. The first slice rendering image and the second slice rendering image are two adjacent slice rendering images in the preset direction. Assuming that there are 4 slice rendering images A to D in sequence along the preset direction, there are 3 pairs of adjacent slice rendering images. The internal grid rendering sub-image is an internal grid rendering image between the first slice rendering image and the second slice rendering image, that is, the depth of the internal grid rendering sub-image is between the depth corresponding to the first slice rendering image and the depth corresponding to the second slice rendering image.
[0105] Taking the first slice rendering image as slice rendering image A and the second slice rendering image as slice rendering image B as an example, the internal grid rendering sub-image at this time is the internal grid rendering image AB between the slice rendering image A and the slice rendering image B. Then, the computer device fuses the slice rendering image A and the internal grid rendering image AB onto the slice rendering image B, and the slice rendering image B is obtained. * .
[0106] Similarly, when the first slice rendering image is slice rendering image B and the second slice rendering image is slice rendering image C, the computer device will fuse the slice rendering image B and the internal grid rendering image BC onto the slice rendering image C to obtain the slice rendering image C. * When the first slice rendering image is slice rendering image C and the second slice rendering image is slice rendering image D, the computer device will fuse the slice rendering image C and the internal mesh rendering image CD onto the slice rendering image D, and the slice rendering image D will be obtained. * , I will not go into details here.
[0107] Among them, further optionally, the computer device may perform weighted calculation on the first slice rendering image, the internal grid rendering sub-image, and the second slice rendering image to obtain an updated second slice rendering image. In some embodiments, the computer device may also input the first slice rendering image, the internal grid rendering sub-image, and the second slice rendering image through a preset model to fuse the first slice rendering image and the internal grid rendering sub-image into the second slice rendering image to obtain an updated second slice rendering image, but this embodiment is not limited to this.
[0108] S602: Fusing the updated second slice rendering images and the first slice rendering image in a preset direction to obtain an intermediate rendering image.
[0109] In this embodiment, each updated second slice rendering image can be obtained based on step S601, for example, a slice rendering image B is obtained. * , slice rendering image C * and slice rendered image D * Continuing with the above example, the first slice rendering image in the preset direction is slice rendering image A, and the computer device can fuse slice rendering image A and slice rendering image B. * , slice rendering image C * and slice rendered image D * , and get the intermediate rendered image.
[0110] Optionally, the computer device may perform weighted calculation on each updated second slice rendering image and the first slice rendering image in a preset direction to obtain an intermediate rendering image. In some embodiments, the computer device may also fuse each updated second slice rendering image and the first slice rendering image in a preset direction according to the direction from far to near or from near to far from the screen to obtain an intermediate rendering image. For example, based on a preset formula, the computer device fuses each updated second slice rendering image and the first slice rendering image in a preset direction according to the direction from far to near or from near to far from the screen to obtain an intermediate rendering image.
[0111] The preset formula may be a half-angle slice rendering equation. Further optionally, the preset formula may include a first preset formula and a second preset formula. If the vector dot product between the illumination direction and the sight direction is positive, the computer device fuses each updated second slice rendering image and the first slice rendering image in the preset direction according to the direction from near to far from the screen based on the first preset formula of the following formula (1) to obtain an intermediate rendering image.
[0112] (1)
[0113] If the vector dot product between the illumination direction and the sight direction is negative, the computer device fuses the updated second slice rendering images and the first slice rendering image in the preset direction according to the direction from far to near the screen based on the second preset formula of the following formula (2) to obtain an intermediate rendering image.
[0114] (2)
[0115] Among them, formula (1) can also be called the under operator, and formula (2) can also be called the over operator. In formula (1) and formula (2), Indicates the color of the current fusion result. Indicates the color of the last fusion result. Indicates the opacity of the current fusion result. Indicates the opacity of the last fusion result. represents the i-th slice rendered image, Indicates the color corresponding to the i-th slice rendered image, Indicates the opacity corresponding to the i-th slice rendering image. The current fusion result is the fusion result of the 1st slice rendering image to the i-th slice rendering image, and the previous fusion result is the fusion result of the 1st slice rendering image to the i-1th slice rendering image. It can be understood that after fusion to the last slice rendering image, the current fusion result obtained is also the intermediate rendering image.
[0116] Continuing with the above example, the computer device can render image A according to the slices and equation (1) in the direction from near to far from the screen to obtain the first fusion result, and then render image B based on the slices. * , the first fusion result and formula (1) are used to obtain the second fusion result, and then the image C is rendered based on the slices * , the second fusion result and formula (1) to get the third fusion result, and finally render the image D based on the slice * , the third fusion result and formula (1) to obtain the third fusion result, which is the intermediate rendering image.
[0117] In the above embodiment, since the first slice rendering image and the second slice rendering image are two adjacent slice rendering images in a preset direction, and the internal grid rendering sub-image is an internal grid rendering image between the first slice rendering image and the second slice rendering image, the first slice rendering image and the internal grid rendering sub-image are fused into the second slice rendering image to obtain an updated second slice rendering image; after fusion of each updated second slice rendering image and the first slice rendering image in the preset direction to obtain an intermediate rendering image, the process of fusion rendering of the internal grid rendering image and each slice rendering image is realized.
[0118] Figure 7 FIG. 1 is a flow chart of obtaining an updated second slice rendering image in an embodiment. In an exemplary embodiment, the grid rendering image includes a first rendering image and a first depth map corresponding to the first rendering image; Figure 7 As shown, S601 includes S701 to S703. Among them:
[0119] S701, determining a first depth of a first sampling point in a first slice rendering image and a second depth of a second sampling point in a second slice rendering image, the first sampling point corresponding to the second sampling point in a preset direction.
[0120] In this embodiment, the first sampling point is any pixel point in the first slice rendering image. The second sampling point is a pixel point in the second slice rendering image that corresponds to the first sampling point in a preset direction.
[0121] Figure 8 FIG. 4 is a schematic diagram of a process of obtaining an updated second slice rendering image in one embodiment. Figure 8 As shown, after the first sampling point in the first slice rendering image is determined, the corresponding second sampling point in the second slice rendering image can be determined along a preset direction.
[0122] The slice rendering image includes the depth corresponding to each pixel point. In this way, after determining the first sampling point and the second sampling point, the first depth of the first sampling point and the second depth of the second sampling point can be determined.
[0123] S702: Determine an internal mesh rendering sub-image from the first rendering image according to the first depth map; the depth corresponding to the internal mesh rendering sub-image is between the first depth and the second depth.
[0124] For further information, please refer to Figure 8 Since the first depth map can indicate the depth of the first rendered image, the internal mesh rendering sub-image whose depth is between the first depth and the second depth can be determined from the first rendered image according to the first depth map.
[0125] S703: Merge the first slice rendering image and the internal grid rendering sub-image into the second slice rendering image to obtain an updated second slice rendering image.
[0126] In this embodiment, for each first sampling point in the first slice rendering image and the second sampling point in the second slice rendering image, a corresponding internal grid rendering sub-image can be determined. Then, after the first slice rendering image and the internal grid rendering sub-image are merged into the second slice rendering image, an updated second slice rendering image can be obtained.
[0127] Optionally, the computer device fuses the first slice rendering image and the internal grid rendering sub-image into the second slice rendering image based on a preset formula and in a direction from far to near or from near to far from the screen, and inputs the image into the image buffer to obtain an updated second slice rendering image. The above process can be referred to S601 and will not be described in detail here.
[0128] In the above embodiment, since the first depth of the first sampling point in the first slice rendering image and the second depth of the second sampling point in the second slice rendering image can be determined, and the first sampling point corresponds to the second sampling point in a preset direction, the internal grid rendering sub-image can be determined from the first rendering image according to the first depth map, and the depth corresponding to the internal grid rendering sub-image is between the first depth and the second depth. Afterwards, the first slice rendering image and the internal grid rendering sub-image are fused into the second slice rendering image to obtain an updated second slice rendering image, which is conducive to realizing the fusion rendering of the internal grid rendering image and each slice rendering image.
[0129] In an exemplary embodiment, optionally, the above S302 may be implemented in the following manner:
[0130] The initial rendered image, the external mesh rendered image, and the reference depth information corresponding to the slice data closest to the screen are fused and rendered to obtain the target rendered image.
[0131] In this embodiment, the reference depth information corresponding to the slice data closest to the screen may be acquired in advance by the computer device, or may be determined based on each slice rendering image after the computer device obtains each slice rendering image. For example, assuming that the slice closest to the screen is slice A, the reference depth information may be determined based on slice rendering image A. The reference depth information includes, but is not limited to, depth texture.
[0132] Furthermore, the computer device can fuse and render the initial rendering image, the external mesh rendering image, and the reference depth information corresponding to the slice data closest to the screen to obtain the target rendering image. For example, the computer device can fuse and render the initial rendering image, the external mesh rendering image, and the reference depth information corresponding to the slice data closest to the screen based on the depth peeling algorithm to obtain the target rendering image. In some embodiments, the computer device can also fuse and render the initial rendering image, the external mesh rendering image, and the reference depth information corresponding to the slice data closest to the screen based on other rendering algorithms, and the present embodiment is not limited thereto.
[0133] In the above embodiment, since the initial rendering image, the external grid rendering image and the reference depth information corresponding to the slice data closest to the screen are fused and rendered to obtain the target rendering image, the reference depth information corresponding to the slice data closest to the screen can be used when obtaining the target rendering image, thereby improving the rendering effect of the obtained target rendering image.
[0134] Fig. 9 FIG. 1 is a schematic diagram of another process of obtaining a target rendered image in an embodiment. In an exemplary embodiment, as shown in FIG. Fig. 9 As shown, the above-mentioned "merging and rendering the initial rendering image, the external grid rendering image and the reference depth information corresponding to the slice data closest to the screen to obtain the target rendering image" includes S901 to S902. Among them:
[0135] S901 , rendering an initial rendering image, an external mesh rendering image, and reference depth information to obtain a second rendering image and a second depth map corresponding to the second rendering image.
[0136] In this embodiment, the computer device may render the initial rendered image, the external mesh rendered image, and the reference depth information based on the depth peeling algorithm to obtain m second rendered images and m second depth maps corresponding to the second rendered images, where m is an integer greater than 0 and may be equal to n.
[0137] Exemplarily, the computer device may input the initial rendering image, the external mesh rendering image, and the reference depth information into a shader, and the shader sorts them by depth to regenerate the second rendering image and a second depth map corresponding to the second rendering image.
[0138] S902: According to the second depth map, fuse the second rendered image in directions from far to near the screen to obtain a target rendered image.
[0139] Furthermore, based on the second depth map, the computer device can mix the m re-obtained second rendering images in a manner from far to near to obtain a final target rendering image of half-angle slice volume rendering and semi-transparent mesh mixed rendering.
[0140] In the above embodiment, due to the rendering of the initial rendering image, the external grid rendering image and the reference depth information, a second rendering image and a second depth map corresponding to the second rendering image are obtained, and based on the second depth map, the second rendering image is fused in the direction from far to near from the screen to obtain a target rendering image. In this way, the grid rendering image and the slice rendering image of each slice data can be fused and rendered to obtain a target rendering image with better rendering effect.
[0141] Fig.10 FIG. 1 is a flow chart of obtaining a slice rendering image in an embodiment. In an exemplary embodiment, as shown in FIG. Fig.10 As shown, S202 includes S1001 to S1002. Among them:
[0142] S1001, performing slicing processing on volume data to obtain slice data corresponding to the volume data.
[0143] In this embodiment, the computer device can obtain volume data. For example, the computer device can obtain volume data sent by a medical scanning device. The medical scanning device may include but is not limited to a computer tomography (CT) device, a magnetic resonance imaging (MRI) device, and the like.
[0144] Then, the computer device can slice the volume data to obtain slice data corresponding to the volume data. In other words, after the computer device slices the volume data, the volume data can be divided into at least one slice, and each slice will generate corresponding slice data. The slice data may include the position of the slice, the gray value of each voxel on the slice, etc.
[0145] Optionally, the computer device may slice the volume data according to the sight direction and the illumination direction to obtain each slice data corresponding to the volume data. For example, the direction of the slice obtained by the computer device is perpendicular to the half-way vector between the sight direction and the illumination direction. The direction of the slice is also the direction in which the volume data is sliced.
[0146] Fig.11 A schematic diagram of the slicing process in implementation is shown in FIG. Fig.11As shown in (a), when the illumination direction and the sight direction are in the same direction, that is, when the vector dot product between the illumination direction and the sight direction is positive, the direction of the slice is perpendicular to the half-distance vector between the illumination direction and the sight direction. Fig.11 As shown in (b), when the illumination direction and the sight direction are opposite, that is, when the vector dot product between the illumination direction and the sight direction is negative, the direction of the slice is perpendicular to the half-way vector in the opposite direction of the illumination direction and the sight direction.
[0147] S1002, rendering each slice data to obtain a slice rendering image of each slice data.
[0148] Furthermore, the computer device can render each slice data to obtain a slice rendering image of each slice data. For example, the computer device can input each slice data into a shader to obtain a slice rendering image of each slice data.
[0149] In the above embodiment, since the volume data is sliced to obtain each slice data corresponding to the volume data, each slice data is rendered to obtain a slice rendering image of each slice data, it is beneficial to render the volume data.
[0150] In an exemplary embodiment, optionally, the above S1002 may be implemented in the following manner:
[0151] For each slice data, the color information of the slice data is determined according to the grayscale value corresponding to the slice data; the preset shadow map is sampled to obtain the lighting information corresponding to the slice data; and the slice rendering image of the slice data is determined according to the color information and lighting information of each slice data.
[0152] In this embodiment, when rendering each slice data, the computer device determines the color information of the slice data according to the gray value corresponding to the slice data. For example, the computer device can sample the gray value of each voxel in the slice data, and convert the gray value of each voxel into the color of the voxel through a transfer function to obtain the color information of the slice data.
[0153] The computer device will also sample the preset shadow map to obtain the lighting information corresponding to the slice data. The preset shadow map includes the lighting color and lighting intensity corresponding to each voxel. The slice data may include the coordinates of the slice in the screen coordinate system. Then, based on the coordinates of the slice in the screen coordinate system, the preset shadow map is sampled to obtain the color and intensity of the lighting corresponding to each voxel in the slice data to determine the color information of the slice data.
[0154] Furthermore, the computer device can determine the slice rendering image of the slice data according to the color information and illumination information of each slice data. Optionally, for each slice data, the computer device can determine the slice rendering image of the slice data according to the product between the color information and illumination information of the slice data. Exemplarily, the computer device can multiply the color information and illumination information of the same voxel in the slice data to obtain the corresponding pixel color value, and mix the pixel color value with the image in the current buffer to obtain the slice rendering image of the slice data.
[0155] In the above embodiment, since the color information of each slice data can be determined according to the grayscale value corresponding to the slice data, and the preset shadow map can be sampled to obtain the lighting information corresponding to the slice data, the slice rendering image of the slice data can be determined efficiently and accurately according to the color information and lighting information of each slice data.
[0156] In an exemplary embodiment, optionally, the above S1002 may include the following steps:
[0157] If the slice data passes through a plurality of volume data, a slice rendering image of the slice data is obtained according to a slice rendering image corresponding to at least one of the passed volume data.
[0158] In some embodiments, there are application scenarios of multiple volume data. If there are multiple volume data, the computer device can determine the bounding space according to the multiple volume data.
[0159] Exemplarily, taking the bounding space as a bounding box as an example, the computer device can determine the priority order of each volume data, the high priority is the main body data, the remaining volume data is converted to the same coordinate space as the main body data based on the registration matrix, and the multiple volume data are integrally generated into a bounding box. Then, slicing the volume data includes: slicing the bounding space to obtain a slice rendering image of each slice data. Fig.12 FIG. 1 is a schematic diagram of a bounding box in an embodiment. In the case where volume data 1 and volume data 2 exist, the bounding box is determined as follows: Fig.12 As shown in the figure, it is understandable that since there are places without volume data in the bounding box, even if the slice passes through these sampling points, it will not affect the final result.
[0160] It is understandable that when slicing the bounding space, there is a situation where one slice data passes through multiple volume data. If the slice data passes through multiple volume data, the slice rendering image of the slice data is obtained according to the slice rendering image corresponding to at least one volume data passed.
[0161] Optionally, if the slice data passes through multiple volume data, the computer device may determine the slice rendering image of the slice data according to the slice rendering image corresponding to the volume data with the highest priority order. Fig.11 For example, when slicing the bounding box, there is slice data P that passes through volume data 1 and volume data 2. If the priority order of volume data 1 is less than the priority order of volume data 2, then when the computer device renders the slice data P, it only renders part of volume data 1 to obtain a slice rendering image corresponding to volume data 1. That is to say, only volume data 2 will be considered and volume data 2 will not be considered, thereby obtaining a slice rendering image of slice data P.
[0162] In the above embodiment, if the slice data passes through multiple volume data, a slice rendering image of the slice data is obtained according to a slice rendering image corresponding to at least one volume data passed through. Therefore, this embodiment is also applicable to application scenarios of multi-volume data.
[0163] In an exemplary embodiment, the above-mentioned “obtaining a slice rendering image of the slice data according to the slice rendering image corresponding to the at least one volume data” can be implemented as follows:
[0164] According to the priority order of at least one volume data passed, the slice rendering image corresponding to each volume data is fused to determine the slice rendering image of the slice data.
[0165] In this embodiment, optionally, the computer device may perform weighted calculation on the slice rendering image corresponding to the passed volume data according to the weight of the passed volume data to determine the slice rendering image of the slice data. Fig.11 For example, when the computer device renders the slice data P, it first multiplies the weight corresponding to volume data 1 by the slice rendering image corresponding to volume data 1 to obtain a first result, then multiplies the weight corresponding to volume data 2 by the slice rendering image corresponding to volume data 2 to obtain a second result, and then fuses the first result and the second result to obtain the slice rendering image of the slice data P. The weight corresponding to the volume data is proportional to the priority order, and the larger the priority order, the higher the corresponding weight.
[0166] Optionally, the computer device may also sequentially fuse the slice rendering images corresponding to each volume data according to the priority order of at least one volume data passed, from high priority order to low priority order, to determine the slice rendering image of the slice data. Fig.11For example, when a computer device renders slice data P, assuming that the priority order of volume data 1 is less than the priority order of volume data 2, the computer device can obtain a slice rendering image corresponding to volume data 2 based on the under operator, and then fuse the slice rendering image corresponding to volume data 1 based on the under operator on the basis of the slice rendering image corresponding to volume data 2 to obtain a slice rendering image of slice data P.
[0167] In the above embodiment, since the slice rendering image corresponding to each volume data is fused according to the priority order of at least one volume data passed through, the slice rendering image of the slice data is determined, thereby improving the effect of the slice rendering image.
[0168] In order to more clearly introduce the medical image rendering method in this application, Fig.13 and Fig.14 Provide explanation. Fig.13 FIG. 1 is a schematic diagram of a medical image rendering method in an embodiment. Fig.13 As shown, the computer device can execute the medical image rendering method according to the following process.
[0169] S1301, rendering the mesh data to obtain a mesh rendering image.
[0170] S1302: for each slice data, determine the color information of the slice data according to the gray value corresponding to the slice data.
[0171] S1303, sampling the preset shadow map to obtain lighting information corresponding to the slice data.
[0172] S1304: Determine a slice rendering image of the slice data according to the color information and illumination information of each slice data.
[0173] S1305, rendering each slice data to obtain a slice rendering image of each slice data. Optionally, if the slice data passes through a plurality of volume data, a slice rendering image of the slice data is obtained according to a slice rendering image corresponding to at least one volume data passed through.
[0174] S1306: Determine a first depth of a first sampling point in the first slice rendering image and a second depth of a second sampling point in the second slice rendering image, wherein the first sampling point corresponds to the second sampling point in a preset direction.
[0175] S1307: Determine an internal mesh rendering sub-image from the first rendering image according to the first depth map, wherein the mesh rendering image includes the first rendering image and a first depth map corresponding to the first rendering image; and the depth corresponding to the internal mesh rendering sub-image is between the first depth and the second depth.
[0176] S1308, merging the first slice rendering image and the internal grid rendering sub-image into the second slice rendering image to obtain an updated second slice rendering image, wherein the first slice rendering image and the second slice rendering image are two adjacent slice rendering images in a preset direction, the internal grid rendering sub-image is an internal grid rendering image between the first slice rendering image and the second slice rendering image, and the depth of the internal grid rendering image is within the depth range of the volume data.
[0177] S1309: Fusing the updated second slice rendering images and the first slice rendering image in a preset direction to obtain an intermediate rendering image.
[0178] S1310: Process the intermediate rendering image to obtain an initial rendering image.
[0179] S1311: Render the initial rendering image, the external mesh rendering image, and the reference depth information to obtain a second rendering image and a second depth map corresponding to the second rendering image.
[0180] S1312: According to the second depth map, fuse the second rendered image in directions from far to near the screen to obtain a target rendered image.
[0181] S1301~S1312 can refer to the above embodiment and will not be described in detail here.
[0182] Fig.14 FIG. 4 is a process diagram of another medical image rendering method in an embodiment. Fig.14 As shown, firstly, depth peeling rendering is performed. In the depth peeling rendering, the computer device renders the mesh data based on the depth peeling algorithm to obtain a mesh rendering image. Then the computer device slices the volume data to obtain each slice data. Then, slice drawing is performed. In the slice drawing, the computer device renders each slice data to obtain a slice rendering image of each slice data.
[0183] After that, hybrid rendering is performed. In hybrid rendering, the computer device will fuse the internal grid rendering image and each slice rendering image to obtain an intermediate rendering image. Then tone mapping is performed. In tone mapping, the computer device will convert the intermediate rendering image from HDR to LDR to obtain the initial rendering image.
[0184] Then modify the depth peeling rendering result. In this step, the computer device renders the initial rendering image, the external mesh rendering image and the reference depth information to obtain a second rendering image and a second depth map corresponding to the second rendering image. Finally, blend the depth peeling images. In this step, the computer device fuses the second rendering images according to the second depth map from far to near the screen to obtain the target rendering image.
[0185] It can be seen that since the half-angle slicing volume rendering algorithm does not originally support the depth peeling algorithm of the semi-transparent grid, the present application transforms the half-angle slicing algorithm. First, in the process of the half-angle slicing algorithm, the slice data corresponding to each slice of volume data can be drawn, and the grid data between the slices can be mixed using the depth peeling algorithm, and mixed into the slice rendering image of each slice data, and then added to the mixed iterative calculation of the half-angle slicing rendering equation. Second, the present application can transform the original grid rendering image of the depth peeling algorithm, divide the grid rendering image into two parts, the inside and the outside of the volume data, and use different methods and the results obtained by the half-angle slicing algorithm to mix the colors of these two parts. Third. The present application performs mixed rendering based on the half-angle slicing algorithm and the depth peeling algorithm. The half-angle slicing algorithm can be applied to scenes that do not support global access to volume data, streaming, etc., and can integrate advanced global illumination models such as shadows, multiple scattering, color bleeding, and ambient occlusion to make the final mixed effect more realistic.
[0186] In this way, the methods of grid depth sorting and color calculation can be integrated to achieve the mixed use of half-angle slicing and depth peeling methods, thereby completing the mixed rendering of volume data and semi-transparent grids, so that the semi-transparent grid can be displayed in the result of the half-angle slicing algorithm. In addition, the present application can also support the mixed display of multiple volume data and semi-transparent grids.
[0187] It should be noted that, in one embodiment, the computer device can obtain the target rendered image based on the graphics rendering program interface of the Open Graphics Library (OpenGL). In OpenGL, the size of the depth value is proportional to the screen distance. If other graphics rendering program interfaces are used, the size of the depth value may be inversely proportional to the screen distance.
[0188] In addition, the letters in the above embodiments are only for distinction and do not limit the actual number.
[0189] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0190] Based on the same inventive concept, the embodiment of the present application also provides a medical image rendering device for implementing the medical image rendering method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more medical image rendering device embodiments provided below can refer to the limitations of the medical image rendering method above, and will not be repeated here.
[0191] Fig.15 FIG. 1 is a block diagram of a medical image rendering device in an embodiment. In an exemplary embodiment, Fig.15 As shown, a medical image rendering device 1500 is provided, comprising: a first rendering module 1501, a second rendering module 1502 and a third rendering module 1503, wherein:
[0192] The first rendering module 1501 is used to render the mesh data to obtain a mesh rendering image.
[0193] The second rendering module 1502 is used to render each slice data corresponding to the volume data to obtain a slice rendering image of each slice data.
[0194] The third rendering module 1503 is used to perform fusion rendering on the grid rendering image and the slice rendering images of each slice data to obtain a target rendering image.
[0195] In the above-mentioned medical image rendering device, the mesh data is rendered to obtain a mesh rendering image, and each slice data corresponding to the volume data is rendered to obtain a slice rendering image of each slice data. After the mesh rendering image and the slice rendering image of each slice data are obtained, the mesh rendering image and the slice rendering image can be fused and rendered to obtain a target rendering image, thus achieving the rendering of the volume data and the mesh data together, thereby improving the rendering effect obtained by using different devices to render the volume data and the mesh data in the related art.
[0196] Optionally, the grid rendering image includes an internal grid rendering image and an external grid rendering image; the third rendering module 1503 includes:
[0197] The first rendering unit is used to fuse and render the internal grid rendering image and each slice rendering image to obtain an initial rendering image; the depth of the internal grid rendering image is within the depth range of the volume data.
[0198] The second rendering unit is used to perform fusion rendering on the initial rendering image and the external mesh rendering image to obtain a target rendering image.
[0199] Optionally, the first rendering unit includes:
[0200] The first rendering subunit is used to fuse and render the internal grid rendering image and each slice rendering image to obtain an intermediate rendering image.
[0201] The processing subunit is used to process the intermediate rendering image to obtain the initial rendering image.
[0202] Optionally, the first rendering sub-unit is further used to fuse the first slice rendering image and the internal grid rendering sub-image into the second slice rendering image to obtain an updated second slice rendering image; fuse the updated second slice rendering images and the first slice rendering image in a preset direction to obtain an intermediate rendering image; the first slice rendering image and the second slice rendering image are two adjacent slice rendering images in the preset direction, and the internal grid rendering sub-image is an internal grid rendering image between the first slice rendering image and the second slice rendering image.
[0203] Optionally, the grid rendering image includes a first rendering image and a first depth map corresponding to the first rendering image; the first rendering sub-unit is further used to determine a first depth of a first sampling point in the first slice rendering image and a second depth of a second sampling point in the second slice rendering image, the first sampling point corresponding to the second sampling point in a preset direction; according to the first depth map, an internal grid rendering sub-image is determined from the first rendering image; the depth corresponding to the internal grid rendering sub-image is between the first depth and the second depth; the first slice rendering image and the internal grid rendering sub-image are merged into the second slice rendering image to obtain an updated second slice rendering image.
[0204] Optionally, the second rendering unit is further used to fuse and render the initial rendering image, the external mesh rendering image, and the reference depth information corresponding to the slice data closest to the screen to obtain a target rendering image.
[0205] Optionally, the second rendering unit includes:
[0206] The second rendering subunit is used to render the initial rendering image, the external mesh rendering image and the reference depth information to obtain a second rendering image and a second depth map corresponding to the second rendering image.
[0207] The fusion subunit is used to fuse the second rendered image according to the second depth map in the direction from far to near of the screen to obtain a target rendered image.
[0208] Optionally, the second rendering module 1502 includes:
[0209] The slicing unit is used to perform slicing processing on the volume data to obtain slice data corresponding to the volume data.
[0210] The third rendering unit is used to render each slice data to obtain a slice rendering image of each slice data.
[0211] Optionally, the third rendering unit is further configured to obtain a slice rendered image of the slice data according to a slice rendering image corresponding to at least one of the passed volume data if the slice data passes through a plurality of volume data.
[0212] Optionally, the third rendering unit is further configured to fuse the slice rendering images corresponding to each volume data according to a priority order of at least one volume data passed through, and determine the slice rendering images of the slice data.
[0213] Optionally, the third rendering unit is further used to determine, for each slice data, the color information of the slice data according to the grayscale value corresponding to the slice data; sample the preset shadow map to obtain the lighting information corresponding to the slice data; and determine the slice rendering image of the slice data according to the color information and lighting information of each slice data.
[0214] Each module in the above-mentioned medical image rendering device can be implemented in whole or in part by software, hardware or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0215] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0216] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0217] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0218] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0219] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0220] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A medical image rendering method, characterized in that: The method comprises: Rendering the mesh data to obtain a mesh rendering image; Rendering each slice data corresponding to the volume data to obtain a slice rendering image of each slice data; The grid rendering image and the slice rendering images of each slice data are fused and rendered to obtain a target rendering image.
2. The method according to claim 1, characterized in that The grid rendering image includes an internal grid rendering image and an external grid rendering image; The step of fusing and rendering the grid rendering image and the slice rendering images of each slice data to obtain a target rendering image includes: The internal grid rendering image and each of the slice rendering images are fused and rendered to obtain an initial rendering image; the depth of the internal grid rendering image is within the depth range of the volume data; The initial rendering image and the external mesh rendering image are fused and rendered to obtain a target rendering image.
3. The method according to claim 2, characterized in that The step of fusing and rendering the internal grid rendering image and each of the slice rendering images to obtain an initial rendering image includes: The internal grid rendering image and each of the slice rendering images are fused and rendered to obtain an intermediate rendering image; The intermediate rendered image is processed to obtain the initial rendered image.
4. The method according to claim 3, characterized in that The step of fusing and rendering the internal grid rendering image and each of the slice rendering images to obtain an intermediate rendering image includes: The first slice rendering image and the internal grid rendering sub-image are merged into the second slice rendering image to obtain an updated second slice rendering image; the first slice rendering image and the second slice rendering image are two adjacent slice rendering images in a preset direction, and the internal grid rendering sub-image is an internal grid rendering image between the first slice rendering image and the second slice rendering image; The updated second slice rendering images and the first slice rendering image in the preset direction are fused to obtain the intermediate rendering image.
5. The method according to claim 4, characterized in that The mesh rendering image includes a first rendering image and a first depth map corresponding to the first rendering image; The step of fusing the first slice rendering image and the internal mesh rendering sub-image into the second slice rendering image to obtain an updated second slice rendering image includes: Determine a first depth of a first sampling point in the first slice rendering image and a second depth of a second sampling point in the second slice rendering image, the first sampling point and the second sampling point corresponding to each other in the preset direction; Determine the internal mesh rendering sub-image from the first rendering image according to the first depth map; the depth corresponding to the internal mesh rendering sub-image is between the first depth and the second depth; The first slice rendering image and the internal mesh rendering sub-image are merged into the second slice rendering image to obtain the updated second slice rendering image.
6. The method according to any one of claims 2 to 5, characterized in that: The step of fusing the initial rendered image with the external mesh rendered image to obtain a target rendered image comprises: The initial rendering image, the external grid rendering image, and reference depth information corresponding to the slice data closest to the screen are fused and rendered to obtain the target rendering image.
7. The method according to claim 6, characterized in that The step of fusing and rendering the initial rendering image, the external mesh rendering image, and the reference depth information corresponding to the slice data closest to the screen to obtain the target rendering image includes: Rendering the initial rendered image, the external mesh rendered image, and the reference depth information to obtain a second rendered image and a second depth map corresponding to the second rendered image; According to the second depth map, the second rendered images are fused in directions from far to near from the screen to obtain the target rendered image.
8. The method according to any one of claims 1 to 5, characterized in that: The step of rendering each slice data corresponding to the volume data to obtain a slice rendering image of each slice data includes: Slicing the volume data to obtain slice data corresponding to the volume data; If the slice data passes through a plurality of volume data, a slice rendering image of the slice data is obtained according to a slice rendering image corresponding to at least one volume data passed through.
9. The method according to claim 8, characterized in that The step of obtaining a slice rendering image of the slice data according to a slice rendering image corresponding to at least one volume data passed through comprises: According to the priority order of the at least one volume data passed, the slice rendering image corresponding to each of the volume data is fused to determine the slice rendering image of the slice data.
10. The method according to any one of claims 1 to 5, characterized in that: The step of rendering each slice data corresponding to the volume data to obtain a slice rendering image of each slice data includes: For each of the slice data, determining the color information of the slice data according to the grayscale value corresponding to the slice data; Sampling a preset shadow map to obtain lighting information corresponding to the slice data; A slice rendering image of the slice data is determined according to the color information and the illumination information of each slice data.
11. A medical image rendering device, characterized in that: The device comprises: A first rendering module, used for rendering the mesh data to obtain a mesh rendering image; A second rendering module, used for rendering each slice data corresponding to the volume data to obtain a slice rendering image of each slice data; The third rendering module is used to perform fusion rendering on the grid rendering image and the slice rendering images of each slice data to obtain a target rendering image.
12. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 10 are implemented.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.
14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.
Citation Information
Cited By
Medical ultrasonic data reality visualization method and system based on half-angle segmentation
CN119359892A
Medical Ultrasound Data Photorealistic Visualization Method and System Based on Half-width Segmentation
CN119359892B
