Three-dimensional body image data visualization method
By generating three-dimensional body textures and visualizing them according to the drawing mode selected by the user, the problem that the inner layer image of the three-dimensional body image data in the prior art cannot be observed in three-dimensionally, and the clear display and interactive enhancement of the internal details of the three-dimensional body image data is achieved.
Patent Information
- Application Number
- CN202411958420.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-18
AI Technical Summary
The existing three-dimensional volume image data visualization methods cannot effectively display the internal details of the image data. The outer image blocks the inner image, and the inner image can only be displayed in two-dimensional terms, so three-dimensional observation cannot be performed.
A three-dimensional body image data visualization method is adopted to generate a three-dimensional body texture by reading the three-dimensional body image data, and visualize it according to the drawing mode (surface drawing mode or body drawing mode) selected by the user. The method includes an interactive step, allowing the user to modify the opacity and/or color value of the color value through the interactive interface, and adjust the opacity of the three-dimensional image to display the inner image details.
The three-dimensional observation of the internal details of the three-dimensional image data is realized, which avoids the problem of the outer image blocking the inner image, and can clearly view the spatial orientation changes between different image data, enhancing the interactiveness of the visualization method.
Smart Images

Figure CN119850844A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image data processing, and in particular, relates to a three-dimensional image data visualization method. Background Art
[0002] In the digital age, the way data is presented is becoming increasingly important. As an emerging technology, volume data visualization can present a large amount of complex data in an intuitive and easy-to-understand way. Especially in the fields of medicine and marine research, it can help relevant personnel better understand and analyze data by visualizing the three-dimensional volume image data of human tissue or ocean hydrology.
[0003] There are two main methods for visualizing 3D volumetric image data: surface rendering and volume rendering. Surface rendering generates intermediate geometric primitives (vertices, line segments, patches, etc.) for rendering. For example, to draw an image, you need to create a quadrilateral primitive in space, and then map the image to the primitive in a texture mapping way for rendering, while the drawing of a 3D model is usually decomposed into a series of polygonal patches for drawing. Surface rendering is faster, but it cannot display the internal details of 3D volumetric image data.
[0004] Volume rendering, also known as 3D reconstruction (different from 3D reconstruction of projected images), directly uses 3D volume image data to generate 3D images. Taking 3D CT data of the human body as an example, due to the complexity of human tissue, the outer layer is muscle, and the inner layer has bones, internal organs, etc. The existing visualization method can only observe the image of the outer layer. The inner layer needs to be cut into 3D volume image data for display, but only the cross-sectional plane is presented, and the internal details of the 3D volume image data cannot be observed in stereo, and the spatial orientation changes between different image data cannot be discovered.
[0005] For three-dimensional ocean image data, existing visualization methods directly display the data according to the data acquisition resolution, and then adjust the resolution after interpolation or sampling for output. Scientific researchers cannot separately visualize the data in a specific range or with a specific value, and thus cannot obtain the distribution pattern of the specific data in space.
[0006] Regardless of volume rendering or surface rendering, first of all, current research is mainly focused on optimizing and improving algorithms. There is less research on customized visualization of three-dimensional image data, which cannot meet the needs of marine researchers for intuitive observation of three-dimensional ocean observation data, or medical workers for viewing three-dimensional medical data. Summary of the invention
[0007] In order to solve the technical problem that images generated by existing three-dimensional image data have outer layers blocking inner layers, and if the internal image is observed by cutting, only a two-dimensional section is presented, and a stereoscopic image of the internal details of the three-dimensional image data cannot be obtained, the present invention proposes a three-dimensional image data visualization method to solve the above problem.
[0008] In order to solve the above technical problems, the present invention adopts the following technical solutions to achieve the above problems: A three-dimensional image data visualization method, comprising: Step 1, reading three-dimensional volume image data, and generating three-dimensional volume texture according to the three-dimensional volume image data; Step 2: obtaining a drawing mode selected by a user and drawing a three-dimensional image according to the selected drawing mode, wherein the drawing mode includes a surface drawing mode and a volume drawing mode; Step 3: Visualize the interaction step, receive the interaction instruction, and execute the corresponding interaction control according to the interaction instruction; The interaction instructions include key value range extraction instructions, and the key value range extraction instructions include opacity adjustment; When the rendering mode is the volume rendering mode, the data values in the three-dimensional volume image data are divided into a number of intervals, each interval is assigned a color value for display, and the opacity adjustment includes: Receiving a user's request to modify the opacity and / or color value of a color value through an interactive interface; Call the area judgment function to judge the corresponding interval segment to be modified, obtain the opacity modification value and / or the color value modification value, and modify the feature list accordingly; The feature list is passed into a shader, the shader receives the feature list, and the three-dimensional image data is divided into a plurality of fragments; According to the received feature list, the opacity corresponding to each fragment and the color value corresponding to the fragment are obtained from the feature list to adjust the three-dimensional image; When the drawing mode is the surface drawing mode, the opacity adjustment includes: An opacity slider is provided in the interactive interface, and the user inputs an opacity modification value by dragging the opacity slider; The opacity modification value is passed into the shader, and the built-in variable value for controlling the opacity is modified in the shader to modify the opacity of the entire three-dimensional image.
[0009] In some embodiments, in the profile adjustment step, the key value range extraction instruction also includes a profile filtering instruction, including: Receiving a section position and a section color input by a user through an interactive interface, wherein the section position includes a position and a direction for sectioning perpendicular to an X-axis, a Y-axis, and a Z-axis respectively; Pass the section position and section color into the shader through the callback function; The portion of the three-dimensional image data outside the cross section is divided into 32 intervals according to the data range of the three-dimensional image data, the opacity and color of each interval are set respectively, and the output is displayed in the three-dimensional image.
[0010] In some embodiments, in step 1, initialization is performed after reading the three-dimensional volume image data, firstly loading the surface rendering mode, recording the visualization result of the surface rendering, and displaying the output surface rendered three-dimensional image; In step 2, when the drawing mode selected by the user is the volume drawing mode, the volume drawing process is executed, the visualization result of the volume drawing is recorded, and the three-dimensional image drawn by the surface is hidden, and the three-dimensional image drawn by the output volume is displayed. When the drawing mode selected by the user is the surface drawing mode, the three-dimensional image drawn by the output surface is kept displayed; The interactive instructions also include instructions for switching between surface drawing mode and volume drawing mode. When an external input is obtained to switch the current drawing mode to another drawing mode instruction, the display or hiding effect of the visualization result of the volume drawing and the visualization result of the surface drawing are modified through the callback function to realize the switching between the two modes.
[0011] In some embodiments, the three-dimensional image data visualization method also includes encapsulating an integrated structure for recording the user's profile adjustment information and scale adjustment information in the current drawing mode. When switching to another drawing mode, the profile adjustment information and / or scale adjustment information is read from the integrated structure, and the three-dimensional image output by the new drawing mode is modified according to the profile adjustment information and / or scale adjustment information.
[0012] In some embodiments, when the rendering mode is a volume rendering mode, the method for rendering a three-dimensional image includes: Reading the three-dimensional volume texture; emitting light toward the three-dimensional volume texture, wherein the light passes through the entire three-dimensional volume texture; For each light ray, sampling the three-dimensional volume texture at equal intervals in the transmission direction of the light ray to obtain grayscale information in the three-dimensional volume texture; According to the grayscale information, a corresponding color value is obtained from a preset color bar; The color values of all sampling points are displayed and output to generate a three-dimensional image drawn in volume rendering mode.
[0013] In some embodiments, when the drawing mode is a volume drawing mode, the method further includes: using an enumeration variable to record the currently selected coordinate mode, and passing the enumeration variable into the shader; The interactive instructions also include coordinate mode conversion instructions for converting between rectangular coordinate mode and cylindrical coordinate mode, including: Receive a user's request to modify the coordinate mode through an interactive interface; Modify the enumeration variable and pass it into the shader; The shader determines the current coordinate mode based on the enumeration variable. When the request is to switch to the cylindrical coordinate mode, for each fragment, the texture coordinates of the fragment in the rectangular coordinate are passed to the conversion function, the rectangular coordinate-cylindrical coordinate conversion function is called, the coordinate value of the fragment in the cylindrical coordinate mode is calculated, and the three-dimensional image is displayed and output in the cylindrical coordinate mode. For example, Figure 6 When a request is made to switch to the rectangular coordinate mode, the three-dimensional image is directly displayed and output in the rectangular coordinate mode according to the texture coordinates of each fragment in the rectangular coordinate mode.
[0014] In some embodiments, the drawn three-dimensional image is displayed and outputted through a main window of a display window, and the display window further includes one or more sub-windows, and the three-dimensional volume image data visualization method further includes: Extract the data on the corresponding section in the main window, call the packaged color map drawing function to draw the data on the section into a color image, and display the output through the sub-window; When the section in the main window changes, the data on the corresponding section in the main window is re-extracted, and the section image displayed in the sub-window is modified synchronously.
[0015] In some embodiments, when a user performs a point query or a line query in the secondary window, the query location and results are synchronously displayed in the primary window, including: Record the query type selected by the user and the query area selected in the secondary window; Convert the two-dimensional coordinates of the query area into three-dimensional coordinates; Normalizing the three-dimensional coordinates to obtain actual coordinates of the query area in the three-dimensional volume image data; The output query area is drawn and displayed in the three-dimensional image of the main window according to the actual coordinates.
[0016] In some embodiments, the interaction instruction further includes a main-sub-window exchange instruction, which is used to exchange the content displayed in the sub-window selected by the user with the content displayed in the main window, including: Detect the main-sub-window swap command input by the user through the interactive interface, and call the recognition function to identify the currently selected sub-window; Determine the specific positions and contents displayed by the two windows that need to be swapped; Call the encapsulated component exchange function to exchange the components of the two windows, so that the content displayed in the sub-window is displayed through the main window, and the content displayed in the main window is displayed through the selected sub-window.
[0017] In some embodiments, when the drawing mode is the surface drawing mode, the interaction instruction further includes a data isosurface extraction instruction, including: Receive one or more data to be displayed and their corresponding colors input by the user through the interactive interface; Obtain all data in the three-dimensional image data that is consistent with the input data, and display them in corresponding colors; The data not selected in the three-dimensional volume image data is set to transparent.
[0018] Compared with the prior art, the advantages and positive effects of the present invention are: the three-dimensional volume image data visualization method of the present invention can perform three-dimensional visualization of the inner three-dimensional volume image data regardless of the surface rendering or volume rendering mode, avoiding the problem that the outer layer image blocks the inner layer image and the inner layer image can only be displayed in two dimensions. The present solution can observe the internal details of the three-dimensional volume image data in stereo, and can clearly view the spatial orientation changes between different image data. Through the visualization interaction step, the interactivity of the visualization method is enhanced, which is convenient for user operation.
[0019] Other features and advantages of the present invention will become more apparent after reading the detailed description of the embodiments of the present invention in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 is a flow chart of an embodiment of a three-dimensional image data visualization method proposed by the present invention; Figure 2 It is an opacity adjustment effect diagram in a volume rendering mode in one embodiment of the three-dimensional volume image data visualization method proposed by the present invention; Figure 3 It is a display effect diagram of the main window and the sub-window in one embodiment of the three-dimensional image data visualization method proposed by the present invention; Figure 4 It is a cross-section filtering effect diagram in one embodiment of the three-dimensional image data visualization method proposed by the present invention; Figure 5 It is an effect diagram of extracting multiple isosurfaces in one embodiment of the three-dimensional image data visualization method proposed by the present invention; Figure 6 It is an output effect diagram in cylindrical coordinate mode in one embodiment of the three-dimensional image data visualization method proposed by the present invention; Figure 7This is an effect diagram when the opacity is 1 in one embodiment of the three-dimensional image data visualization method proposed by the present invention; Figure 8 This is an effect diagram when the opacity is 0.5 in one embodiment of the three-dimensional image data visualization method proposed by the present invention; Fig. 9 This is an effect diagram when the opacity is 0 in one embodiment of the three-dimensional image data visualization method proposed by the present invention; Fig.10 is a flowchart of proportion adjustment in one embodiment of the three-dimensional image data visualization method proposed by the present invention; Fig.11 is a flow chart of cross-section filtering in one embodiment of the three-dimensional volume image data visualization method proposed by the present invention; Fig.12 is a flow chart of coordinate mode conversion in one embodiment of the three-dimensional image data visualization method proposed by the present invention; Fig.13 It is a flowchart of isosurface extraction in one embodiment of the three-dimensional image data visualization method proposed by the present invention. DETAILED DESCRIPTION
[0021] The specific implementation modes of the present invention will be further described in detail below in conjunction with the accompanying drawings.
[0022] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0023] Embodiment 1, the present invention proposes a three-dimensional image data visualization method, such as Figure 1 As shown, including: Step 1: read the 3D volume image data, and generate a 3D volume texture according to the 3D volume image data. The 3D volume texture is a bitmap image, which contains 3D information. The method for generating a three-dimensional volume texture according to three-dimensional volume image data includes: (1) Normalize the three-dimensional image data and convert the three-dimensional image data to between 0 and 1 according to the maximum and minimum values of the three-dimensional image data.
[0024] (2) Create a three-dimensional object for storing texture data according to the size of the three-dimensional image data, and store the normalized three-dimensional image data in it.
[0025] (3) Create a three-dimensional volume texture and press the created object storing texture data into the texture to obtain a three-dimensional volume texture.
[0026] Step 2, obtain the drawing mode and draw the three-dimensional image according to the selected drawing mode, the drawing mode includes surface drawing mode and volume drawing mode. Among them, the surface drawing mode is to visualize the outermost data of the three-dimensional volume image data in the three-dimensional space, and the inside of the visualized graphic is empty. The volume drawing mode is to draw all the data of the three-dimensional volume image data in the graphic, that is, there is also data inside the graphic.
[0027] In some embodiments, the drawing mode is selected by external input.
[0028] Step 3, the visual interaction step, detects and receives the interactive instructions input from the outside world, and performs corresponding interactive control according to the interactive instructions. Users can interact with the drawing effects through the visual interaction module.
[0029] The interactive instructions include key value range extraction instructions, and the key value range extraction instructions include opacity adjustment.
[0030] When the rendering mode is volume rendering mode, the data values in the 3D volume image data are divided into several intervals, each interval is assigned a color value for display, and the opacity adjustment includes: Receives a request to modify the opacity and / or color value of a color value.
[0031] The area judgment function is called to judge the interval corresponding to the modification, obtain the opacity modification value and / or the color value modification value, and modify the feature list accordingly.
[0032] The feature list is passed into the shader, and the shader receives the feature list, and the three-dimensional image data is divided into a number of fragments.
[0033] According to the received feature list, the opacity corresponding to each fragment and the color value corresponding to the fragment are obtained from the feature list to adjust the three-dimensional image.
[0034] The opacity adjustment effect in volume rendering mode is as follows Figure 2 As shown, the opacity of a specific color value can be adjusted, for example, the opacity of the focus color value is adjusted to 1, and the opacity of the non-focus color value is adjusted to 0, so as to avoid occlusion or interference of the focus color value by the non-focus color value.
[0035] Since only the outer layer of the 3D image drawn in the surface drawing mode has a pattern, only the outer layer of the 3D image drawn in the surface drawing mode needs to be adjusted. When the drawing mode is the surface drawing mode, the opacity adjustment includes: An opacity slider is provided in the interactive interface, and the user inputs an opacity modification value by dragging the opacity slider.
[0036] The opacity modification value is passed into the shader, and the built-in variable value for controlling opacity is modified in the shader to modify the opacity of the entire three-dimensional image.
[0037] The opacity adjustment effect in face drawing mode is as follows Figure 7-Figure 9 As shown, these are the effects when the opacity is 1, 0.5, and 0 respectively.
[0038] The three-dimensional volume image data visualization method of the present invention can realize the modification of the opacity and / or color value of a specific color value. Regardless of the surface rendering or volume rendering mode, the inner layer three-dimensional volume image data can be three-dimensionally visualized (the opacity of the outer layer image data is adjusted), avoiding the problem that the outer layer image obscures the inner layer image and the inner layer image can only be displayed in two dimensions.
[0039] Since only the opacity of the outer layer image data is adjusted, the outer layer data is not completely hidden. This method can perform stereoscopic observation of the internal details of the three-dimensional image data and clearly view the spatial orientation changes between different image data.
[0040] In addition, through the visualization interaction steps, the interactivity of the visualization method is enhanced, making it convenient for users to operate.
[0041] In some embodiments, the three-dimensional image data may be three-dimensional medical image data or three-dimensional ocean image data, etc.
[0042] In some embodiments, in the profile adjustment step, Fig.11 As shown, the key value range extraction instruction also includes a profile filtering instruction, including: The section position and section color input by the user through the interactive interface are received, and the section position includes the position and direction of cutting along the vertical X-axis, Y-axis and Z-axis respectively.
[0043] The section position and section color are passed into the shader through the callback function.
[0044] The portion of the three-dimensional image data outside the cross section is divided into 32 intervals according to the data range of the three-dimensional image data, the opacity and color of each interval are set respectively, and the output is displayed in the three-dimensional image.
[0045] like Figure 4 As shown, since the outer layer data of the three-dimensional image drawn by the volume rendering mode will block the inner layer data, the profile filtering of this scheme can selectively slice only the data of some color layers, which can meet the user's observation needs in different situations.
[0046] In some embodiments, in step 1, initialization is performed after reading the three-dimensional volume image data, firstly loading the surface rendering mode, recording the visualization result of the surface rendering, and displaying the output surface rendered three-dimensional image.
[0047] In step 2, when the drawing mode selected by the user is the volume rendering mode, the volume rendering process is executed, the visualization result of the volume rendering is recorded, and the three-dimensional image of the surface rendering is hidden, and the three-dimensional image of the output volume rendering is displayed. When the drawing mode selected by the user is the surface rendering mode, the three-dimensional image of the output surface rendering is kept displayed.
[0048] For the common functions in the two drawing modes, such as section adjustment and scale adjustment, an integrated structure is encapsulated in the background to record the information of these functions.
[0049] The interactive instructions also include instructions for switching between surface drawing mode and volume drawing mode. When external input is obtained to switch the current drawing mode to another drawing mode instruction, the visualization results of volume drawing and surface drawing are modified through the callback function to display or hide the effects, thereby realizing switching between the two modes.
[0050] In some embodiments, the three-dimensional image data visualization method also includes encapsulating an integrated structure for recording the user's profile adjustment information and scale adjustment information in the current drawing mode. When switching to another drawing mode, the profile adjustment information and / or scale adjustment information is read from the integrated structure, and the three-dimensional image output by the new drawing mode is modified according to the profile adjustment information and / or scale adjustment information.
[0051] Take proportional adjustment as an example. Fig.10 As shown, the background uses the scale information in the integrated structure to record the scaling ratios in three directions (X-axis, Y-axis, and Z-axis).
[0052] After the user interactively sends a request to modify the display ratio, the background will obtain the modification direction and specific value, call the encapsulated integrated structure, and modify the function of the ratio information in the integrated structure to realize the recording of the modified ratio value.
[0053] When the user switches to another drawing mode, the visualization effect in the target drawing mode is loaded first. Before displaying it on the screen, the background retrieves the scale information in the integrated structure through the callback function, and then calls the scale modification function to modify the display scale value, so that each fragment can be stretched or shrunk in the X, Y, and Z directions. In this way, the scale modification function is synchronized between the two modes.
[0054] In some embodiments, when the drawing mode is a volume rendering mode, the drawing method of a three-dimensional image includes: reading a three-dimensional volume texture, emitting light toward the three-dimensional volume texture, and the light passes through the entire three-dimensional volume texture. For each light ray, sampling the three-dimensional volume texture at equal intervals in the transmission direction of the light ray, obtaining grayscale information in the three-dimensional volume texture, and obtaining corresponding color values from a preset color bar according to the grayscale information; displaying and outputting the color values of all sampling points to generate a three-dimensional image drawn in the volume rendering mode. These sampling points constitute the visualization result seen by the user.
[0055] In some embodiments, when the drawing mode is the volume drawing mode, the method further includes: using an enumeration variable to record the currently selected coordinate mode, and passing the enumeration variable into the shader.
[0056] Interaction instructions also include coordinate mode conversion instructions, such as Fig.12 As shown, the conversion between rectangular coordinate mode and cylindrical coordinate mode is performed, including: Receive the user's request to modify the coordinate mode through the interactive interface.
[0057] Modify the enumeration variable and pass it into the shader.
[0058] The shader determines the current coordinate mode based on the enumeration variable. When the request is to switch to the cylindrical coordinate mode, for each fragment, the texture coordinates of the fragment in the rectangular coordinate are passed to the conversion function, the rectangular coordinate-cylindrical coordinate conversion function is called, the coordinate value of the fragment in the cylindrical coordinate mode is calculated, and the three-dimensional image is displayed and output in the cylindrical coordinate mode. For example, Figure 6 When a request is made to switch to the rectangular coordinate mode, the three-dimensional image is directly displayed and output in the rectangular coordinate mode according to the texture coordinates of each fragment in the rectangular coordinate mode.
[0059] Since the texture coordinates in the shader range between 0 and 1, the x and y values of the origin of the cylindrical coordinates are both 0.5, assuming that the texture coordinates in rectangular coordinates are (x, y, z).
[0060] First use the length calculation function to calculate the radius: length (x-0.5,y-0.5).
[0061] Then calculate the number of layers in cylindrical coordinates as arctan(-(x-0.5), y-0.5) / (Π / 2)+0.5.
[0062] Finally, the texture coordinates converted to cylindrical coordinates are: (length (x-0.5,y-0.5) *2, z, arctan (-(x-0.5),y-0.5) / (Π / 2)+0.5).
[0063] Through this method, users can select and switch coordinate systems as needed.
[0064] In some embodiments, the drawn three-dimensional image is displayed and outputted through a main window of a display window, the display window further includes one or more sub-windows, and the three-dimensional volume image data visualization method further includes: Extract the data on the corresponding section in the main window, call the packaged color map drawing function to draw the data on the section into a color image, and display the output through the sub-window.
[0065] When the section in the main window changes, the data on the corresponding section in the main window is re-extracted, and the section image displayed in the sub-window is modified synchronously.
[0066] like Figure 3 As shown, on the left side of the main window, there are three sub-windows, which respectively display the sections of the cube in the X, Y, and Z directions. When the user divides the main window, the contents of the three sub-windows will change simultaneously. When performing point and line queries in the three sub-windows, the query position and results will be synchronously displayed in the main window. The main window and the three sub-windows can also be swapped to facilitate better observation of the sub-windows.
[0067] When performing a point query or line query in the small window, the query location and results will be displayed in the main window simultaneously. Taking line query as an example, when the user performs a line query in the small window, the system will process it according to the following steps: First, record the click window and position: First, the background will record the specific small window (i.e., X, Y, or Z profile window) clicked by the user, and record the user's two click positions in sequence. These two click positions will be used as the starting point and end point of the line query.
[0068] Second, coordinate conversion: Next, the system converts the click position from the 2D coordinates in the small window to the 3D coordinates in the data cube. For example, suppose the user clicks a point in the Z-direction section window, its 2D coordinates are (m,n), and the Z-axis position of this section is represented by a preset variable pz.
[0069] The expanded 3D coordinates are (m, n, pz), where m and n are the 2D coordinates clicked in the small window, and pz is the specific position of the Z-axis section.
[0070] In some embodiments, assuming that the size of the data cube is r×c×l (representing the number of rows, columns, and layers in the X, Y, and Z directions, respectively), the actual position of the point in the data cube is: (m*r, n*c, pz*l).
[0071] Third, draw the query line: the system will also calculate the point clicked by the user for the second time, and connect the starting point and the end point in the data cube. In this way, the query line defined by the user in the small window can be displayed synchronously in the 3D cube view of the main window.
[0072] Fourth, synchronous display of results: After completing the coordinate conversion and line drawing, the query results will be displayed in the main window as a straight line connecting the starting point and the end point selected by the user. This method can intuitively reflect the query operation performed by the user in the small window in the 3D view of the main window.
[0073] In some embodiments, when a user performs a point query or a line query in the secondary window, the query location and results are synchronously displayed in the primary window, including: Record the query type selected by the user and the query area selected in the secondary window; Convert the two-dimensional coordinates of the query area into three-dimensional coordinates; Normalizing the three-dimensional coordinates to obtain the actual coordinates of the query area in the three-dimensional volume image data; The output query area is drawn and displayed in the three-dimensional image of the main window according to the actual coordinates.
[0074] In some embodiments, the interaction instruction further includes a main-sub-window exchange instruction, which is used to exchange the content displayed in the sub-window selected by the user with the content displayed in the main window, including: Detect the main-sub-window swapping instruction input by the user through the interactive interface, and call the recognition function to identify the currently selected sub-window.
[0075] Determine the specific positions and contents displayed by the two windows that need to be swapped.
[0076] Call the encapsulated component exchange function to exchange the components of the two windows, so that the content displayed in the sub-window is displayed through the main window, and the content displayed in the main window is displayed through the selected sub-window.
[0077] In some embodiments, when the drawing mode is the surface drawing mode, such as Fig.13 As shown, the interactive instructions also include data isosurface extraction instructions, including: Receive one or more data to be displayed and their corresponding colors input by the user through the interactive interface.
[0078] All data in the three-dimensional image data that is consistent with the input data is obtained and displayed in corresponding colors.
[0079] The data not selected in the three-dimensional volume image data is set to transparent.
[0080] In face drawing mode, such as Figure 5 As shown, users can extract multiple isosurfaces through the visualization interaction module, control whether the isosurfaces are displayed, and freely adjust the value and color of each isosurface to observe the distribution of a certain value in the overall data, which plays a great role in the visualization of three-dimensional medical image data.
[0081] To achieve the above functions, this module adds an "isosurface settings" interface, which has three main functions: 1. Control the display status of all isosurfaces through the "Is isosurface displayed" checkbox; 2. Control the number of extracted isosurfaces through the "Number of isosurfaces" slider; 3. Display a table of each isosurface information. The table has a total of n rows and three columns, where n is the number of isosurfaces. The first column displays the isosurface number, the second column displays the value of each isosurface, and the third column displays the color of each isosurface. Users can modify the contents of the second and third columns to modify the color and value of each isosurface.
[0082] Modifying the display status of isosurfaces includes: 1. Modifying the display status of isosurfaces: users can control the display status of all isosurfaces through the "Is isosurface displayed" checkbox in the interface. When the status of the checkbox is modified, a signal will be sent and the background will obtain the signal. When the signal is checked, the background will set the isosurface to display by calling the encapsulated function of setting node display and hiding; when the signal is unchecked, the background calls the function to set the isosurface to hide.
[0083] In the background, add the contour line information list to record the number of contour lines, the color and value of each contour surface.
[0084] 2. Modify the number of isosurfaces: (1) When the user drags the slider to modify the number of isosurfaces, the background will obtain the value of the slider, modify the element that records the number of isosurfaces in the isosurface information list, and pass the value of the element to the shader of the rendering module.
[0085] (2) When implementing the contour extraction algorithm in the shader, a variable is set to control the number of isosurfaces extracted. This variable represents the number of isosurfaces.
[0086] (3) Assign the information passed in step (1) to the variables in step (2), thereby modifying the number of isosurfaces.
[0087] 3. Modify the value and color of the isosurface: (1) When the user modifies the value and color of the isosurface through the "Data Value" column and "Color Value" column in the interface, a signal will be sent. The background will obtain the signal and modify the isosurface information list based on the information in the signal, record the elements of each isosurface value and color, and pass the information list to the shader of the rendering module.
[0088] (2) After the shader obtains the information list, it obtains the value and color information of each isosurface in the list, and modifies the lists that control the value and color of each isosurface in the isosurface, thereby modifying the value and color of the isosurface.
[0089] This method can support modifying the value and color of each isosurface in the isosurface, and can directly visualize the distribution law, distribution range and size of data in a specific range or specific value in space.
[0090] Of course, the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions or substitutions made by ordinary technicians in this technical field within the essential scope of the present invention should also fall within the protection scope of the present invention.
Claims
1. A three-dimensional image data visualization method, characterized in that: include: Step 1, reading three-dimensional volume image data, and generating three-dimensional volume texture according to the three-dimensional volume image data; Step 2, obtaining a drawing mode and drawing a three-dimensional image according to the drawing mode, wherein the drawing mode includes a surface drawing mode and a volume drawing mode; Step 3: Visualize the interaction step, receive the interaction instruction, and execute the corresponding interaction control according to the interaction instruction; The interaction instructions include key value range extraction instructions, and the key value range extraction instructions include opacity adjustment; When the rendering mode is the volume rendering mode, the data values in the three-dimensional volume image data are divided into a number of intervals, each interval is assigned a color value for display, and the opacity adjustment includes: receiving a request to modify the opacity and / or color value of a color value; Determine the interval corresponding to the modified content, obtain the opacity modification value and / or the color modification value, and modify the feature list accordingly; The feature list is passed into a shader, the shader receives the feature list, and the three-dimensional image data is divided into a plurality of fragments; According to the received feature list, the opacity corresponding to each fragment and the color value corresponding to the fragment are obtained from the feature list to adjust the three-dimensional image; When the drawing mode is the surface drawing mode, the opacity adjustment includes: An opacity slider is provided in the interactive interface, and the opacity modification value is entered by dragging the opacity slider; The opacity modification value is passed into the shader, and the built-in variable value for controlling the opacity is modified in the shader to modify the opacity of the entire three-dimensional image.
2. The three-dimensional image data visualization method according to claim 1, characterized in that: The key value domain extraction instruction also includes a profile filtering instruction, including: Receiving a section position and a section color inputted through an interactive interface, wherein the section position includes a position and a direction of sectioning along a direction perpendicular to an X-axis, a Y-axis, and a Z-axis respectively; Pass the section position and section color into the shader through the callback function; The portion of the three-dimensional image data outside the cross section is divided into 32 intervals according to the data range of the three-dimensional image data, the opacity and color of each interval are set respectively, and the output is displayed in the three-dimensional image.
3. The three-dimensional image data visualization method according to claim 1, characterized in that: In step 1, after reading the three-dimensional volume image data, initialization is performed, firstly, the surface rendering mode is loaded, the visualization result of the surface rendering is recorded, and the three-dimensional image of the output surface rendering is displayed; In step 2, when the drawing mode is the volume drawing mode, the volume drawing process is executed, the visualization result of the volume drawing is recorded, and the three-dimensional image drawn by the surface is hidden, and the three-dimensional image drawn by the output volume is displayed. When the drawing mode is the surface drawing mode, the three-dimensional image drawn by the output surface is kept displayed; The interactive instructions also include instructions for switching between surface drawing mode and volume drawing mode. When an instruction to switch the current drawing mode to another drawing mode is obtained, the display or hiding effects of the visualization results of the volume drawing and the visualization results of the surface drawing are modified through a callback function to achieve switching between the two modes.
4. The three-dimensional image data visualization method according to claim 3, characterized in that: The three-dimensional data visualization method also includes encapsulating an integrated structure for recording profile adjustment information and scale adjustment information in a current drawing mode. When switching to another drawing mode, the profile adjustment information and / or scale adjustment information is read from the integrated structure, and the three-dimensional image output by the new drawing mode is modified according to the profile adjustment information and / or scale adjustment information.
5. The three-dimensional image data visualization method according to claim 1, characterized in that: When the rendering mode is a volume rendering mode, the method for rendering a three-dimensional image includes: Reading the three-dimensional volume texture; emitting light toward the three-dimensional volume texture, wherein the light passes through the entire three-dimensional volume texture; For each light ray, sampling the three-dimensional volume texture at equal intervals in the transmission direction of the light ray to obtain grayscale information in the three-dimensional volume texture; According to the grayscale information, a corresponding color value is obtained from a preset color bar; The color values of all sampling points are displayed and output to generate a three-dimensional image drawn in volume rendering mode.
6. The three-dimensional image data visualization method according to claim 1, characterized in that: When the drawing mode is the volume drawing mode, the method further includes: using an enumeration variable to record the currently selected coordinate mode, and passing the enumeration variable into the shader; The interactive instructions also include coordinate mode conversion instructions for converting between rectangular coordinate mode and cylindrical coordinate mode, including: Receive a user's request to modify the coordinate mode through an interactive interface; Modify the enumeration variable and pass it into the shader; The shader determines the current coordinate mode based on the enumeration variable. When a request is made to switch to the cylindrical coordinate mode, for each fragment, the texture coordinates of the fragment in the rectangular coordinate are passed into the conversion function, the rectangular coordinate-cylindrical coordinate conversion function is called, the coordinate value of the fragment in the cylindrical coordinate mode is calculated, and the three-dimensional image is displayed and output in the cylindrical coordinate mode. When a request is made to switch to the rectangular coordinate mode, the three-dimensional image is directly displayed and output in the rectangular coordinate mode according to the texture coordinates of each fragment in the rectangular coordinate mode.
7. The three-dimensional image data visualization method according to claim 1, characterized in that: The drawn three-dimensional image is displayed and outputted through a main window of a display window, and the display window also includes one or more sub-windows. The three-dimensional data visualization method also includes: Extract the data on the corresponding section in the main window, call the packaged color map drawing function to draw the data on the section into a color image, and display the output through the sub-window; When the section in the main window changes, the data on the corresponding section in the main window is re-extracted, and the section image displayed in the sub-window is modified synchronously.
8. The three-dimensional image data visualization method according to claim 7, characterized in that: When the user performs a point query or line query in the secondary window, the query location and results are displayed synchronously in the main window, including: Record the query type selected by the user and the query area selected in the secondary window; Convert the two-dimensional coordinates of the query area into three-dimensional coordinates; Normalizing the three-dimensional coordinates to obtain actual coordinates of the query area in the three-dimensional volume image data; The output query area is drawn and displayed in the three-dimensional image of the main window according to the actual coordinates.
9. The three-dimensional image data visualization method according to claim 7, characterized in that: The interaction instruction also includes a main-sub-window exchange instruction, which is used to exchange the content displayed in the sub-window selected by the user with the content displayed in the main window, including: Detect the main-sub-window swap command input by the user through the interactive interface, and call the recognition function to identify the currently selected sub-window; Determine the specific positions and contents displayed by the two windows that need to be swapped; Call the encapsulated component exchange function to exchange the components of the two windows, so that the content displayed in the sub-window is displayed through the main window, and the content displayed in the main window is displayed through the selected sub-window.
10. The three-dimensional image data visualization method according to any one of claims 1 to 9, characterized in that: The three-dimensional image data is three-dimensional medical image data or three-dimensional ocean image data; When the drawing mode is the surface drawing mode, the interaction instruction further includes a data isosurface extraction instruction, including: Receive one or more data to be displayed and their corresponding colors input by the user through the interactive interface; Obtain all data in the three-dimensional image data that is consistent with the input data, and display them in corresponding colors; The data not selected in the three-dimensional volume image data is set to transparent.