Three-dimensional visualization method and system for OCT (optical coherence tomography) image
Technical Field
The invention relates to the field of detection and imaging, in particular to a three-dimensional visualization method and a three-dimensional visualization system for an OCT image.
Background
With the development of medical diagnostic techniques, people can probe internal information of objects and human bodies in a non-invasive manner. Modern medical imaging technologies and equipment such as Computed Tomography (CT), Magnetic Resonance Imaging (MRI), Ultrasound (US), Optical Coherence Tomography (OCT) and the like are increasingly popularized and upgraded, become important engines for development of modern medicine and detection science, and occupy a very important research position for processing and analyzing acquired images. The medical image contains abundant information, particularly, after the three-dimensional visualization processing of the image, the three-dimensional forms of structures and tissues can be intuitively obtained, the diagnosis of doctors can be effectively assisted, and the method is widely applied to metal detection, failure component judgment and the like.
Through research, in clinic and experiment, the reconstruction mode of the three-dimensional image has a variety, and the most widely applied plane drawing technology is on the current hardware platform. The surface drawing method describes the three-dimensional structure of an object by splicing and fitting the surface of the object through geometric units, extracts information of related organs by adopting surface drawing, enables doctors to obtain quantitative description on the aspects of the size, shape, spatial position relation and the like of the interested organs, and adopts a surface drawing technical scheme in many current CT and MRI imaging methods. The three-dimensional reconstruction of the slice medical image is carried out by adopting a surface drawing technology, and four steps are firstly completed: plane contour extraction, inter-slice contour registration, contour splicing and curved surface fitting. However, clinical application indicates that the rendering technology needs to distinguish and classify volume data, that is, it needs to distinguish whether each voxel is on a currently rendered surface, so when complex and fuzzy-boundary human tissues are processed, errors in classification often occur, that is, edge extraction is inaccurate, false surface display or a hole is generated on a display surface, and finally, visualization is prone to losing pathological details.
In order to be beneficial to keeping the detail information of the three-dimensional medical image and enhancing the overall drawing effect of the image, the sample image is not divided and is directly drawn, so that a volume drawing technology, such as a footprint throwing method, a miscut deformation method and the like, is developed, and the intermediate process of constructing surfaces such as a geometric polygon and the like in a surface drawing technology is effectively avoided. The method synthesizes images with three-dimensional effect by a shading method for all volume data; but the defects are that all voxels need to be processed, the calculation amount is increased, the drawing speed of the image is limited, and the processing speed is slow.
The above background disclosure is only for the purpose of assisting understanding of the concept and technical solution of the present invention and does not necessarily belong to the prior art of the present patent application, and should not be used for evaluating the novelty and inventive step of the present application in the case that there is no clear evidence that the above content is disclosed at the filing date of the present patent application.
Disclosure of Invention
In order to solve the technical problems, the invention provides a three-dimensional visualization method and a three-dimensional visualization system for an OCT image, which not only improve the quality of the image, but also improve the processing speed.
In order to achieve the purpose, the invention adopts the following technical scheme:
the invention discloses a three-dimensional visualization method of an OCT image, which comprises the following steps:
s1: and a data reading step: reading a sequence of slice images consisting of a plurality of OCT images into a volume database;
s3: and (3) classification step: converting the plurality of OCT images in the volumetric database into optical properties available for rendering;
s5: a synthesizing step of synthesizing the plurality of OCT images into a final image by superimposing the respective optical parameters in the optical properties;
s6: and a display step of displaying the final image.
Preferably, between step S1 and step S3, S2 is further included: a pretreatment step: and carrying out image binarization and image size clipping on the plurality of OCT images.
Preferably, the preprocessing step is a batch operation on the plurality of OCT images to acquire a grayscale image of the effective area having the sample information.
Preferably, step S3 specifically includes using an opacity transfer function, a color transfer function, and/or a gradient transfer function to convert the plurality of OCT images into optical properties for rendering.
Preferably, the opacity transfer function, the color transfer function and the gradient transfer function are each piecewise linear scalar mapping functions.
Preferably, the opacity transfer function is specifically to map a gray value of a sampling point on the OCT image to a predetermined opacity value, and when the gray value is less than 60, the opacity value is set to 0; when the gray value is between 60 and 150, the opaque value is set to be 0 to 0.02; when the gray value is between 150 and 196, the opaque value is set to be 0.02 to 0.05; when the gray value is larger than 196, the opaque value is set to be 0.05-0.5.
Preferably, the color transfer function is specifically to map the gray values of the sampling points on the plurality of OCT images to predetermined RGB values, and when the gray value is less than 60, the RGB values are set to (0, 0, 0) - (0.1, 0.1, 0.1); when the gray value is between 60 and 160, the RGB value is set to be between (0.1, 0.1, 0.1) and (0.3, 0.3, 0.3); when the gray value is between 160 and 196, the RGB value is set to be (0.3, 0.3, 0.3) to (0.5, 0.5, 0.5); when the gradation value is larger than 196, the RGB values are set to be between (0.5, 0.5, 0.5) to (1, 1, 1).
Preferably, the gradient transfer function is embodied to map the gradient modulus of the plurality of OCT images as an opacity multiplier, and when the gradient modulus is less than 500, the opacity multiplier is set to 2.0; when the gradient modulus value is between 500 and 600, the opaque multiplier is set to be 0.73 to 2.0; when the gradient modulus value is between 600 and 900, the opaque multiplier is set to be 0.73 to 0.9; when the gradient modulus value is between 900 and 1300, the opaque multiplier is set to be 0.1 to 0.9; when the gradient modulus is greater than 1300, the opacity multiplier is set to 0-0.1.
Preferably, between step S3 and step S5, S4 is further included: and (3) abnormal point elimination step: setting a threshold range for each optical parameter in the optical property, and excluding points for which each optical parameter is not within the threshold range.
Preferably, the step S5 further includes setting an ambient light coefficient, a diffuse reflection coefficient, a high light coefficient and a high light intensity, wherein the ambient light coefficient is set to 0.1-0.3, the diffuse reflection coefficient is set to 0.8-1.0, the high light coefficient is set to 0.1-0.3, and the high light intensity is set to 9-11.
The invention also discloses a three-dimensional visualization system of the OCT images, which comprises a data memory unit, a classifier unit, a renderer unit and a window unit, wherein the data memory unit is used for reading a slice image sequence consisting of a plurality of OCT images into a volume database; the classifier unit is used for converting the plurality of OCT images in the volume database into optical attributes for drawing; the renderer unit is configured to synthesize the plurality of OCT images into a final image by superimposing the respective optical parameters in the optical properties; the window unit is used for displaying the final image.
Compared with the prior art, the invention has the beneficial effects that: according to the three-dimensional visualization method and system for the OCT images, disclosed by the invention, the plurality of OCT images are converted into optical parameters for drawing, and the optical parameters are superposed and synthesized into the final image, so that the three-dimensional visualization of the OCT images is realized, the image quality is improved, and the processing speed is also improved.
In a further scheme, a preprocessing step is further arranged before the classifying step, the gray level image of the effective area with the sample information is obtained, the quality of the image to be processed is improved, the redundancy of processing data is avoided, and therefore the processing speed is further improved.
In a further scheme, the opaque transfer function, the color transfer function and the gradient transfer function are set by a piecewise linear scalar quantity mapping method to obtain volume data which can be used for drawing three-dimensional reconstruction, the drawing of an object is completed, a straight line is used for carrying out curve approximation to realize a complex transfer function, the image quality is further improved, and meanwhile, the processing speed is further improved.
Drawings
FIG. 1 is a flow chart of a method of three-dimensional visualization of OCT images of a preferred embodiment of the invention;
FIG. 2a is an OCT image of a skin sample of one embodiment of the invention;
FIG. 2b is a diagram of a clearly visible fingerprint of the image of FIG. 2a after reconstruction using the three-dimensional visualization method of the preferred embodiment of the present invention;
FIG. 2c is a diagram of the visible and clear sweat glands of the image of FIG. 2a after reconstruction using the three-dimensional visualization method of the preferred embodiment of the present invention;
FIG. 3a is an OCT image of a foam sample of one embodiment of the invention;
FIG. 3b is a graph of the visible foam surface texture of the image of FIG. 3a reconstructed using a three-dimensional visualization method in accordance with a preferred embodiment of the present invention;
fig. 3c is a diagram of the structure inside the visible foam after the image of fig. 3a has been reconstructed using the three-dimensional visualization method according to the preferred embodiment of the invention.
Detailed Description
The invention will be further described with reference to the accompanying drawings and preferred embodiments.
As shown in fig. 1, a preferred embodiment of the present invention discloses a three-dimensional visualization method of an OCT image, comprising the steps of:
s1: and a data reading step: reading a sequence of slice images consisting of a plurality of OCT images into a volume database;
in a specific embodiment, 1-400 BMP pictures are sequentially read in and stored in a volume database, and image attributes including pixel size and depth digit are set.
S2: a pretreatment step: carrying out image binarization and image size cutting on a plurality of OCT images;
specifically, a plurality of OCT images are subjected to binarization processing in batch, and the image size is cut according to an effective area which is obtained by tissue imaging and has sample information, so that the imaging workload is reduced, and the accuracy and the working efficiency are improved.
S3: and (3) classification step: converting a plurality of OCT images in a volume database into optical attributes that can be rendered;
specifically, a plurality of OCT images are designed into corresponding optical attributes through data classification, and data basis is provided for the operation of a drawing device. In this embodiment, an opacity transfer function, a color transfer function, and/or a gradient transfer function are specifically used to convert a plurality of OCT images into optical properties for drawing, where the opacity transfer function, the color transfer function, and the gradient transfer function are respectively piecewise linear scalar mapping functions, that is, a complex transfer function is implemented by performing curve approximation using straight lines.
The opacity transfer function is specifically to map the gray value of a sampling point in the light projection process to a predetermined opacity value, in this embodiment, four opacity breakpoints (60, 0), (150, 0.02), (196, 0.05), (255, 0.5) are set, that is, when the gray value is less than 60, the opacity value is set to 0; when the gray value is between 60 and 150, the opaque value is set to be 0 to 0.02; when the gray value is between 150 and 196, the opaque value is set to be 0.02 to 0.05; when the gray value is larger than 196, the opaque value is set to be 0.05-0.5.
The color transfer function is specifically to map the gray value of the sampling point in the light projection process to a predetermined RGB value, in this embodiment, four color breakpoints (60, 0.1, 0.1, 0.1), (160, 0.3, 0.3, 0.3), (196, 0.5, 0.5, 0.5), (255, 1, 1, 1) are set, where the first bit represents the gray value of the pixel, and the last three bits are the mapped RGB components, that is, when the gray value is less than 60, the RGB value is set to (0, 0, 0) to (0.1, 0.1, 0.1); when the gray value is between 60 and 160, the RGB value is set to be between (0.1, 0.1, 0.1) and (0.3, 0.3, 0.3); when the gray value is between 160 and 196, the RGB value is set to be (0.3, 0.3, 0.3) to (0.5, 0.5, 0.5); when the gradation value is larger than 196, the RGB values are set to be between (0.5, 0.5, 0.5) to (1, 1, 1).
The gradient transfer function is specifically configured to map the gradient modulus value as an opaque multiplier, in this embodiment, five gradient modulus breakpoints (0, 2.0), (500, 2.0), (600, 0.73), (900, 0.9), (1300, 0.1) are set, that is, when the gradient modulus value is less than 500, the opaque multiplier is set to 2.0; when the gradient modulus value is between 500 and 600, the opaque multiplier is set to be 0.73 to 2.0; when the gradient modulus value is between 600 and 900, the opaque multiplier is set to be 0.73 to 0.9; when the gradient modulus value is between 900 and 1300, the opaque multiplier is set to be 0.1 to 0.9; when the gradient modulus is greater than 1300, the opacity multiplier is set to 0-0.1. The difference of the transition region can be enhanced through the opaque multipliers, and the gradient module value is utilized to correspond to one opaque multiplier to be multiplied to the opaque value, so that the image is sharpened.
S4: and (3) abnormal point elimination step: setting a threshold range of each optical parameter in the optical properties, and excluding points of the optical parameters which are not in the threshold range;
the optical parameters comprise RGB values and opaque values, all synthesized points are ensured to be in a reasonable range by eliminating abnormal points, and the processing speed is improved while the image quality is ensured.
S5: the synthesis steps are as follows: synthesizing the plurality of OCT images into a final image by superimposing the respective optical parameters in the optical properties;
namely, setting the volume data, and overlapping the RGB value and the opaque value; further, in the synthesis step, the method also comprises the setting of shadow, an environment light coefficient, a diffuse reflection coefficient, a highlight coefficient and highlight intensity, wherein the environment light coefficient can be set to be 0.1-0.3, the diffuse reflection coefficient can be set to be 0.8-1.0, the highlight coefficient can be set to be 0.1-0.3, and the highlight intensity can be set to be 9-11; in a preferred embodiment, the ambient light coefficient is set to 0.2, the diffuse reflectance is set to 0.9, the specular reflectance is set to 0.2, and the specular intensity is set to 10.
S6: a display step: and displaying the final image.
The display of a three-dimensional reconstruction result is realized, the volume data is rendered, an interactive interface is built, specifically, a background color and a drawing window size are required to be set, and the initial drawing is carried out. In a specific embodiment, the display window is set, the background color is set to be black, and the drawing window is 500 × 500 pixels in size, as shown in fig. 2a to 2c and fig. 3a to 3c, where fig. 2a is an OCT image of a skin sample, fig. 2b and 2c are images reconstructed by the three-dimensional visualization method according to the preferred embodiment of the present invention, where a clear fingerprint is visible in fig. 2b and a clear sweat gland is visible in fig. 2 c; FIG. 3a is an OCT image of a foam sample, and FIGS. 3b and 3c are images reconstructed by a three-dimensional visualization method according to a preferred embodiment of the present invention, in which the texture of the foam surface is visible in FIG. 3b, and the structure inside the foam is visible in FIG. 3 c; from fig. 2a to 2c and fig. 3a to 3c, it is shown that the image quality obtained by the three-dimensional visualization method of the present invention is high and the processing speed is fast.
The invention also discloses a three-dimensional visualization system of the OCT images, which comprises a data memory unit, a classifier unit, a renderer unit and a window unit, wherein the data memory unit is used for reading a slice image sequence consisting of a plurality of OCT images into a volume database; the classifier unit is used for converting a plurality of OCT images in the volume database into optical attributes for drawing; the plotter unit is used for synthesizing a plurality of OCT images into a final image by superposing various optical parameters in the optical properties; and the window unit is used for displaying the final image and realizing interactive functions such as screenshot, storage and the like.
The invention discloses a three-dimensional visualization method and a three-dimensional visualization system for OCT images, wherein compared with the prior surface drawing technology surrounding images such as CT, MRI and the like, the images of CT and MRI are millimeter and sub-millimeter magnitude, the OCT images reach micron or even nanometer magnitude, the information is finer in image processing, and the structural form is not easy to draw; the OCT has the advantages of high resolution, non-contact, no damage and high precision, and the image information retention rate of the drawn three-dimensional image is high, namely the reduction degree is high by combining the volume drawing method provided by the invention.
The foregoing is a more detailed description of the invention in connection with specific preferred embodiments and it is not intended that the invention be limited to these specific details. For those skilled in the art to which the invention pertains, several equivalent substitutions or obvious modifications can be made without departing from the spirit of the invention, and all the properties or uses are considered to be within the scope of the invention.