Disclosure of Invention
In view of the above, the embodiments of the present invention provide a three-dimensional surface reconstruction method, apparatus and electronic device for two-dimensional intracardiac ultrasound catheter images, which are used for solving or partially solving the above-mentioned problems.
In a first aspect, an embodiment of the present invention provides a three-dimensional surface reconstruction method for a two-dimensional intracardiac ultrasound catheter image, including the steps of:
s1, acquiring a plurality of continuous ultrasonic images inside a heart through an intracardiac ultrasonic catheter;
s2, carrying out interpolation processing on blank areas among the ultrasonic images to obtain a plurality of interpolation images;
s3, inputting each ultrasonic image into a pre-trained Unet model to obtain a heart chamber separation image of each output ultrasonic image;
s4, extracting edge information of each chamber surface of each heart chamber separation image to obtain an edge image of each chamber;
s5, generating corresponding point cloud data according to each edge image and each interpolation image;
And S6, carrying out surface reconstruction on the generated point cloud data through Ashape algorithm to obtain a three-dimensional model.
According to a specific implementation manner of the embodiment of the present invention, in the step S1, the ultrasound image includes rotation angle information corresponding to an intracardiac ultrasound catheter.
According to a specific implementation manner of the embodiment of the present invention, in the step S2, the interpolation process is linear interpolation, and the interpolated image includes pixel information and angle information.
According to a specific implementation manner of the embodiment of the present invention, in the step S3, the Unet model training manner is as follows:
s3.1: preparing an intra-cardiac ultrasound image dataset with corresponding cardiac chamber annotations;
s3.2: preprocessing an intra-cardiac ultrasound image within the intra-cardiac ultrasound image dataset to remove noise, enhance contrast, and unify the dimensions of the image;
S3.3: dividing the preprocessed intracardiac ultrasonic image data set into a training set, a verification set and a test set;
s3.4: training the Unet model using the intra-cardiac ultrasound image data and corresponding cardiac chamber annotations in the training set;
S3.5: verifying the Unet model in the training process by using the verification set to evaluate the performance of the model and perform tuning;
s3.6: the test set is used to make a final assessment of the Unet model that was trained and validated.
According to a specific implementation manner of the embodiment of the present invention, in the step S3.4, the difference between the prediction result and the true label is measured using the cross entropy loss function, and the training process uses the gradient descent algorithm to minimize the loss function by back-propagating the parameters of the optimization model.
According to a specific implementation manner of the embodiment of the present invention, in the step S3, the method further includes: and the Unet model judges each output heart chamber separation image, and if the heart chamber separation image is judged to be undetermined, the corresponding heart chamber separation image is marked secondarily by manual intervention.
According to a specific implementation manner of the embodiment of the present invention, in the step S4, the edge information is extracted based on the Sobel operator in the following manner:
for each pixel location in the heart chamber separation image Amplitude of gradientAnd direction ofThe calculation can be made by the following formula:
Wherein, AndRepresenting the gradients of the pixels in the image in the x-direction and the y-direction, respectively.
According to a specific implementation manner of the embodiment of the present invention, in the step S5, the point cloud data generation manner is as follows:
Wherein, For the point coordinates in the point cloud, (x, y) for each pixel position in the edge image or the interpolated image,And c is an offset constant for angle information corresponding to the edge image or the interpolation image.
The embodiment of the method has at least the following technical effects:
The first and the current conventional heart chamber modeling depends on the second catheter, and the three-dimensional surface reconstruction method is an ultrasonic image modeling method based on a two-dimensional image and a single ultrasonic probe and based on a two-dimensional image turning point cloud, so that the operation flow and difficulty are reduced, and simultaneously, the heart chamber reconstruction updated in real time is supported, so that the automatic segmentation of the heart chamber position can be realized, the speed is higher, and the accuracy is higher.
And secondly, in the three-dimensional surface reconstruction method, the automatic segmentation result is adjusted in a man-machine interaction mode, and intervention is performed at any time to ensure accuracy and reliability.
Thirdly, in the three-dimensional surface reconstruction method, boundary contours are extracted through edges after the heart chamber separation image is segmented, cloud data are turned on, so that the calculated amount is greatly reduced, and the efficiency is improved.
In a second aspect, an embodiment of the present invention provides a three-dimensional surface reconstruction apparatus for two-dimensional intracardiac ultrasound catheter images, including:
The data acquisition module is used for acquiring a plurality of continuous ultrasonic images inside the heart through an intracardiac ultrasonic catheter;
the image interpolation module is used for carrying out interpolation processing on blank areas among the ultrasonic images to obtain a plurality of interpolation images;
The region separation module is used for inputting each ultrasonic image into a pre-trained Unet model to obtain a heart chamber separation image of each output ultrasonic image;
The edge extraction module is used for extracting edge information of each chamber surface of each heart chamber separation image to obtain an edge image of each chamber;
the point cloud generation module is used for generating corresponding point cloud data according to the edge images and the interpolation images;
and the surface reconstruction module is used for carrying out surface reconstruction on the generated point cloud data through Ashape algorithm to obtain a three-dimensional model.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the steps of the three-dimensional surface reconstruction method in the foregoing first aspect or any implementation manner of the first aspect when the processor executes the program.
Detailed Description
Embodiments of the technical scheme of the present invention will be described in detail below with reference to the accompanying drawings. The following examples are only for more clearly illustrating the technical aspects of the present invention, and thus are merely examples, which should not be construed as limiting the scope of the present invention.
It is noted that unless otherwise indicated, technical or scientific terms used herein should be given the ordinary meaning as understood by one of ordinary skill in the art to which this application belongs.
Fig. 1 is a flowchart of steps of a three-dimensional surface reconstruction method for a two-dimensional intracardiac ultrasound catheter image according to an embodiment of the present invention, referring to fig. 1, the method includes the following steps:
s1, data acquisition: a plurality of sequential ultrasound images are acquired inside the heart through an intracardiac ultrasound catheter.
Continuous ultrasound images are acquired using an intracardiac ultrasound catheter technique, specifically by placing the catheter inside the heart and rotating it through a range of angles along the ultrasound catheter head. As shown in A in fig. 2, a continuous intracardiac ultrasonic image sequence is acquired, in the process, the motor rotates step by step, and waits for sampling instructions sent by an electrocardiogram to sample, and meanwhile, the rotation angles of all moments are recorded, and the real-time internal 360-degree high-speed rotation can be supported during rotation. In order to ensure that the acquired image sequence covers all view angles and positions of the heart chamber and has good image quality, the sampling frequency in the acquisition process needs to be sampled according to the diastolic points of the electrocardiogram of the patient so as to ensure that the three-dimensional model drawn after sampling is accurate, and meanwhile, the change of the whole process can be dynamically refreshed through real-time model reconstruction. The individual acquisition results are shown as B in fig. 2.
S2, image interpolation: and carrying out interpolation processing on blank areas among the ultrasonic images to obtain a plurality of interpolation images.
For the acquired two-dimensional ultrasonic image data, since the motor rotation angle cannot meet the minimum modeling requirement, interpolation is required for a blank area between images. And interpolating the edge image to obtain an interpolation image, wherein the interpolation image is used for filling a blank area which possibly appears, and comprises pixel information and angles.
Interpolation is to ensure not only continuity of the image but also reliability of the whole image, so that the pixel value thereof is calculated using linear interpolation. The linear interpolation calculates the pixel value of the interpolation point according to the distance ratio by using the pixel values of two adjacent points on the boundary of the known region. Let the point to be interpolated be P and its neighboring known points be a and B. The distance between the point A and the point P is d1, and the distance between the point B and the point P is d2. The interpolated pixel value for the P point can be calculated by the following formula:
P = A + (B - A) * (d1 / (d1 + d2))(1)
this formula is actually based on the linear relationship of the line segment AB, and the value of P is calculated according to the distance scale.
Fig. 3 is an effect diagram of interpolation by the above method, A, B in fig. 3 is two adjacent diagrams obtained by ultrasound, and C in fig. 3 is a result after linear interpolation from A, B in fig. 3.
S3, target area separation: each ultrasound image is input into a pre-trained Unet model, and a heart chamber separation image of each ultrasound image is obtained.
The Unet model is a common convolutional neural network architecture, and is particularly suitable for pixel-level segmentation tasks. The design inspiration comes from the self-encoder, and the local characteristics and the context information can be learned at the same time by connecting the encoder and the decoder, so that an accurate segmentation result is realized.
The Unet model training mode is as follows:
s3.1 data preparation:
An intracardiac ultrasound image dataset with corresponding cardiac chamber annotations is first prepared. Typically, these images will contain individual slices and views of the heart, as well as corresponding heart chamber boundary annotations.
S3.2, preprocessing data:
an intra-cardiac ultrasound image within the image dataset is preprocessed to remove noise, enhance contrast, and unify the dimensions of the image. Common preprocessing operations include filtering, histogram equalization, normalization, and the like.
S3.3, data division:
the preprocessed image dataset is divided into a training set, a validation set and a test set. The training set is used for training of the model, the validation set is used for adjusting the hyper-parameters of the model and monitoring the training progress, and the test set is used for evaluating the performance of the model.
S3.4 training Unet model:
Unet, consisting of an encoder and decoder, can learn to perform pixel-level cardiac chamber segmentation. The encoder portion is used to extract image features and the decoder portion is used to remap features back to the size of the input image and generate segmentation results. The Unet model is trained using intra-cardiac ultrasound image data and corresponding cardiac chamber labeling in a training set. The difference between the predicted outcome and the true annotation is typically measured using a cross entropy loss function and the parameters of the model are optimized by back propagation. The training process may use a gradient descent algorithm or variants thereof to minimize the loss function.
S3.5, verification and optimization:
And verifying the Unet model in the training process by using a verification set to evaluate the performance of the model and perform tuning. The best model may be selected based on segmentation results and metrics (e.g., accuracy, recall, F1 score, etc.) on the validation set.
S3.6 test and evaluation:
the trained and validated Unet model was finally evaluated using the test set. And inputting the intracardiac ultrasonic image on the test set into the trained model to obtain a heart chamber segmentation result generated by the model. Various evaluation indices (e.g., dice coefficients, jaccard indices, etc.) may be used to evaluate the performance and accuracy of the model.
The heart chamber separation image after Unet outputs is shown in fig. 4, wherein the three images A, B, C in fig. 4 are respectively left heart chambers at different angles.
The steps also include:
man-machine interaction: the part sets a manual labeling button in the interface aiming at the heart chamber image with deviation of labeling so as to prevent errors of the machine.
The method comprises the specific operations that a result of automatic segmentation is presented in a screen, unet can score each picture, the scoring is based on the internal consistency of two indexes 1), the consistency and smoothness of the interior of a segmented image are evaluated, the quality of the segmented result can be evaluated by calculating the similarity or difference between adjacent pixels, for example, the difference of color, texture or gradient between pixels can be calculated, and the segmented image is scored according to the size of the difference; 2) Regional connectivity: whether the areas in the segmented image have connectivity or not is evaluated, the smoothness of the area, perimeter or boundary of each area can be calculated, and different scores can be given to the segmented results according to the characteristics. After the evaluation indexes are weighted and averaged, the images are arranged in order from small to large, and a corresponding user is prompted to check the images under the condition that the images are lower than a set threshold value, and if the images are inaccurate, the corresponding images can be marked secondarily in a manual intervention mode.
S4, edge extraction: and extracting edge information of each chamber surface of each heart chamber separation image, and obtaining an edge image of each chamber.
The edge extraction method is used for obtaining edge information of the surface of the cavity. The boundary contours of the chamber and other regions are obtained by edge extraction and used for further processing and analysis. Edge extraction can help determine the pixel location of the object boundary, enabling accurate segmentation and reconstruction of the chamber region.
In this embodiment, a method based on the Sobel operator is used, which is based on the principle that the gradient of pixel intensity in an image is calculated to detect the edge, so as to calculate the image positionAndGradient in direction. Assuming that in the Sobel operator, each pixel position in the input imageThen the amplitude of the image gradientAnd direction ofThe calculation can be made by the following formula:
(2)
(3)
Wherein, AndRepresenting the gradient of the image in the x-direction and the y-direction, respectively, the larger the G value is, the more significant the pixel value near the edge will be, i.e. there is edge information.
Unet, and calculating boundary contour information of the heart chamber separation diagram through a Sobel operator, as shown in fig. 5.
S5, generating point cloud: and generating corresponding point cloud data according to each edge image and the interpolation image.
And according to each edge image and the angle obtained during scanning (corresponding to the ultrasonic image), generating corresponding point cloud data by combining the pixel information and the angle of the interpolation image in the step S2.
Assuming that the original coordinates are (x, y) and the pixel position on the nth picture is (x, y) and the angle isAssume that the transformed point cloud coordinates areThe transformation relationship is shown in formula (4).
(4)
Where c is the offset constant.
The point cloud generated by the method has the condition of excessive point number, which causes the calculation amount of the subsequent steps to be increased, and in order to solve the problem, the furthest point sampling (Farthest Point Sampling, FPS) is introduced for selecting a group of representative sampling points from large-scale point cloud data. The furthest point sampling method is based on the distance measurement between points, and covers the whole point cloud data as much as possible while keeping the uniform distribution among the sampling points. In this embodiment, the furthest point sampling is adopted to keep uniformity between data on one hand, and on the other hand, to avoid the problem that the triangular surface difference is too large during the later surface reconstruction, as shown in fig. 6, a in fig. 6 is original point cloud data, the number of point clouds is large, so that the calculation complexity of the surface reconstruction is increased, and B in fig. 6 is obtained after sampling the FPS for 10000 points, so that the improvement of the calculation performance is obtained while the integral structure is not lost.
S6, surface reconstruction: and carrying out surface reconstruction on the generated point cloud data through Ashape algorithm to obtain a three-dimensional model.
The Ashape algorithm is a commonly used surface reconstruction algorithm that can recover a smooth chamber surface based on the geometry and topology of the point cloud data. Three-dimensional shape information of the chamber can be extracted from the point cloud data through Ashape algorithm.
The generated point cloud data is surface reconstructed using Ashape algorithm. And visually displaying the chamber data subjected to Ashape algorithm surface reconstruction. Three-dimensional visualization software or libraries may be used to present the chamber reconstruction results so that doctors and researchers can more intuitively observe and analyze the heart chamber structure, as shown in fig. 7.
It should be noted that, the modules are arranged according to a streaming layout, which is only one embodiment of the present invention, and may be arranged in other manners, which is not limited by the present invention.
Different from other intracardiac catheter image modeling, the three-dimensional surface reconstruction method is a reconstruction method based on an ultrasonic image completely, firstly, an image of the heart inner cavity is acquired through the ultrasonic catheter, then a cavity boundary is determined through interpolation and automatic segmentation methods, then three-dimensional coordinate mapping is carried out through the image after edge extraction, and finally, surface reconstruction is carried out through AShape algorithm. The embodiment of the invention has at least the following technical effects:
The first and the current conventional heart chamber modeling depends on the second catheter, and the three-dimensional surface reconstruction method is an ultrasonic image modeling method based on a two-dimensional image and a single ultrasonic probe and based on a two-dimensional image turning point cloud, so that the operation flow and difficulty are reduced, and simultaneously, the heart chamber reconstruction updated in real time is supported, so that the automatic segmentation of the heart chamber position can be realized, the speed is higher, and the accuracy is higher.
And secondly, in the three-dimensional surface reconstruction method, the automatic segmentation result is adjusted in a man-machine interaction mode, and intervention is performed at any time to ensure accuracy and reliability.
Thirdly, in the three-dimensional surface reconstruction method, boundary contours are extracted through edges after the heart chamber separation image is segmented, cloud data are turned on, so that the calculated amount is greatly reduced, and the efficiency is improved.
The embodiment is based on an intracardiac ultrasonic catheter technology, the clinical medical diagnosis technology of ultrasonic waves is an ultrasonic detection technology based on echo scanning, ultrasonic diagnostic imaging adopts an array transducer with multiple array elements to emit ultrasonic waves into a human body, changes the relative delay and amplitude of excitation of each array element, and can form a focused acoustic beam emitted in a certain direction. When the acoustic beam encounters the interface of different organs and tissues in the body, a reflected echo is generated and received by the array transducer. The above process requires multiple component connections, the device connections being as shown in fig. 8. The device specifically comprises the following components:
The ultrasonic transducer 1 is composed of 64 array elements, completes the functions of ultrasonic wave emission and receiving, and can be sent to a designated position of the heart for data acquisition.
An ultrasound catheter 2, in which various connection lines for the transducer and a flexible material for bending are contained.
An ultrasonic handle 3, which is operated by a doctor to control the depth and direction of the catheter, and a sensor such as a rotary motor is arranged in the ultrasonic handle.
And a rotary motor 4 connected to the catheter for adjusting the direction of the ultrasonic transducer.
An ultrasonic connector 5, which converts between analog and digital signals.
The ultrasonic host computer 6 sends or receives the instruction, and the two-dimensional image sequence is obtained through the ultrasonic image acquisition equipment, so that faster visual feedback is provided for doctors.
Fig. 9 shows a schematic structural diagram of an electronic device 90 according to an embodiment of the present invention, where the electronic device 90 includes at least one processor 901 (e.g. a CPU), at least one input/output interface 904, a memory 902, and at least one communication bus 903 for enabling connection communication between these components. At least one processor 901 is configured to execute computer instructions stored in memory 902 to enable the at least one processor 901 to perform any one of the embodiments of the three-dimensional surface reconstruction method described above. The memory 902 is a non-transitory memory (non-transitory memory) that may include volatile memory, such as high-speed random access memory (RAM: random Access Memory), or may include non-volatile memory, such as at least one disk memory. Communication connection(s) with at least one other device or unit is effected through at least one input output interface 904 (which may be a wired or wireless communication interface).
In some embodiments, the memory 902 stores a program 9021, and the processor 901 executes the program 9021 to perform any of the foregoing sub-table method embodiments.
The electronic device may exist in a variety of forms including, but not limited to:
(1) A mobile communication device: such devices are characterized by mobile communication capabilities and are primarily aimed at providing voice, data communications. Such terminals include: smart phones, multimedia phones, functional phones, low-end phones, etc.
(2) Ultra mobile personal computer device: such devices are in the category of personal computers, having computing and processing functions, and generally also having mobile internet access characteristics. Such terminals include: PDA, MID, and UMPC devices, etc., such as iPad.
(3) Portable entertainment device: such devices may display and play multimedia content. The device comprises: audio, video players (e.g., iPod), palm game consoles, electronic books, and smart toys and portable car navigation devices.
(4) Specific server: the configuration of the server includes a processor, a hard disk, a memory, a system bus, and the like, and the server is similar to a general computer architecture, but is required to provide highly reliable services, and thus has high requirements in terms of processing capacity, stability, reliability, security, scalability, manageability, and the like.
(5) Other electronic devices with data interaction functions.
Fig. 10 is a block diagram of a three-dimensional surface reconstruction apparatus for two-dimensional intracardiac ultrasound catheter images according to an embodiment of the present invention, the apparatus comprising:
The data acquisition module is used for acquiring a plurality of continuous ultrasonic images in the heart through the intracardiac ultrasonic catheter;
the image interpolation module is used for carrying out interpolation processing on blank areas among the ultrasonic images to obtain a plurality of interpolation images;
The region separation module is used for inputting each ultrasonic image into the pre-trained Unet model to obtain a heart chamber separation image of each output ultrasonic image;
The edge extraction module is used for extracting edge information of the surfaces of the chambers of the heart chamber separation images to obtain edge images of the chambers;
the point cloud generation module is used for generating corresponding point cloud data according to each edge image and the interpolation image;
And the surface reconstruction module is used for carrying out surface reconstruction on the generated point cloud data through Ashape algorithm to obtain a three-dimensional model.
The functions of each module in the embodiment of fig. 10 correspond to the content in the corresponding method embodiment, and are not described herein.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any changes or substitutions easily contemplated by those skilled in the art within the scope of the present invention should be included in the present invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.