Background
The 2D/3D image registration technology is used as a key technology in an image navigation operation, a plurality of images from different imaging devices, imaging time and imaging targets are subjected to certain spatial transformation and then are positioned in the same reference system to achieve the aim of corresponding matching of image pixels of the same anatomical structure, the accurate tracking and correction of the relative position relation between a surgical instrument and a patient focus are achieved, and the image navigation operation is completed, the key of the operation is to accurately establish the spatial position relation between a preoperative 3D image to be registered and an intraoperative real 2D X ray image, namely, intraoperative 2D is used as a reference image for registering the preoperative 3D image.
There are roughly four categories of medical image registration techniques that are mainly used today: grayscale-based methods, feature-based methods, and deep learning-based methods.
The characteristic-based registration algorithm only needs a small amount of characteristic information to complete an image registration task, has small dependence on image gray scale information, is relatively simple in registration process, easy to operate and low in time consumption under the condition of obtaining the characteristic information, but the extraction of the characteristic information usually needs manual intervention and is difficult to realize automation, so that the characteristic extraction is time-consuming.
Feature-based registration ignores a large amount of valuable other information in the image (such as image gray scale and gradient information), resulting in low registration accuracy, poor stability and low registration success rate.
The gray-scale-based image registration algorithm completes the registration task by using the pixel gray-scale information of far redundant feature information points, so that the registration error is small, the precision is high, and the stability and the robustness are higher.
The registration method based on deep learning directly predicts 2D/3D registration transformation parameters by using a deep regression network, but has complex preprocessing steps, long network structure, large amount of data and adverse guarantee of registration precision due to the fact that the transformation parameters are directly predicted end to end.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a 2D/3D spine CT level registration method based on a deep learning network.
In order to achieve the above object, the present invention provides a deep learning network-based 2D/3D spine CT level registration method, which is characterized by comprising the following steps:
(1) acquiring an X-ray image as an intraoperative 2D reference image in the training and registering process, and acquiring a medical CT sequence as an preoperative 3D image in the training process;
(2) constructing a training image set;
(2.1) inputting the preoperative 3D image into a rigid body transformation model, and randomly transforming six-dimensional rigid body transformation parameter T ═ Tx,ty,tz,rx,ry,rz) Generating a group of three-dimensional image sequences, and then inputting the three-dimensional image sequences into an X-ray imaging calculation model for projection so as to generate a DRR image sequence; wherein, txRepresenting a translation parameter, t, on the X-axisyRepresenting a translation parameter, t, in the Y-axiszRepresenting a translation parameter in the Z-axis, rxRepresenting a rotation parameter along the X-axis, ryRepresenting a rotation parameter along the Y-axis, rzRepresenting a rotation parameter along the Z-axis;
(2.2) combining the DRR image sequences in pairs, wherein one image is used as a reference image, the other image is used as a floating image, and the two images form a training sample to form a training image set;
(3) building a deep learning network model and training;
constructing an 8-layer CNN model as a deep learning network model, then sequentially inputting a reference image and a floating image in a training image set for model training, and accurately outputting a deformation parameter corresponding to the floating image when the model is converged;
(4) carrying out coarse registration by using a deep learning network model;
according to the method in the step (2.1), a DRR image is generated by using the preoperative 3D image to be registered and is used as a floating image, and the floating image and the intraoperative 2D reference image are input into the trained deep learning network model together, so that the rough registration transformation parameters of the preoperative 3D image to be registered are output;
(5) carrying out precise registration on the single vertebra through an Adam parameter optimization algorithm;
(5.1) carrying out vertebra segmentation on the preoperative 3D image to be registered by using a Grow Cut region growing algorithm, so that each segmented sub-image only comprises one vertebra, and obtaining a plurality of single vertebra images;
(5.2) taking the rough registration transformation parameters as initial registration parameters of each single vertebra image, then carrying out rigid body transformation on the single vertebra through the initial registration parameters, and then carrying out projection through an X-ray imaging calculation model to generate a DRR image of the single vertebra image as a floating image;
(5.3) calculating a DiceLoss value between the floating image and the intraoperative 2D reference image of the single vertebra;
wherein | X | represents the sum of all elements in the pixel matrix X of the floating image, | Y | represents the sum of all elements in the pixel matrix Y of the reference image, | X |, and Y | represents the sum of all elements after the pixel matrix X and the pixel matrix Y corresponding element point are multiplied;
(5.4) judging whether the DiceLoss value calculated in the step (5.3) is smaller than a preset threshold value or not, if so, stopping iteration, and finishing the fine registration of the single vertebral image; otherwise, setting the objective function of the Adam parameter optimization algorithm as Dice Loss, setting the parameter vector as the current fine registration parameter, then repeating the steps (5.2) - (5.4), and searching the optimal fine registration parameter with the smallest DiceLoss value through the Adam parameter optimization algorithm, thereby completing the fine registration of the single vertebral block diagram;
(5.5) judging whether the precise registration of all the single vertebral images is finished, if not, repeating the steps (5.2) - (5.4) until the precise registration of all the single vertebral images is finished; otherwise, entering the step (5.6);
and (5.6) carrying out spatial transformation on all the single vertebral images according to the corresponding optimized fine registration parameters, and combining according to the positions before segmentation so as to realize the CT level registration of the spine.
The invention aims to realize the following steps:
the invention relates to a 2D/3D spine CT level registration method based on a deep learning network, which mainly comprises two steps of coarse registration and fine registration; firstly, generating deformation of a 3D CT sequence, generating a DRR image through projection of an X-ray imaging calculation model, and then randomly selecting the DRR image to train a deep learning network; then deforming the 3D image to be registered before the operation, generating a DRR through projection of an X-ray imaging model, and inputting the DRR and the 2D reference image in the operation into a depth learning network to obtain a coarse registration parameter; and finally, based on the coarse registration parameters, finishing the precise registration of a plurality of vertebrae in the preoperative 3D image to be registered through an Adam parameter optimization algorithm, and realizing the CT level registration of the spine.
Meanwhile, the 2D/3D spine CT level registration method based on the deep learning network also has the following beneficial effects:
(1) the invention adopts a hierarchical registration mode, not only integrates a deep learning network, but also matches a classical parameter optimization mode, and ensures that the registration precision is more excellent through the combination of two registration methods, and not only performs rigid registration on the vertebra, but also considers the deformation between the vertebrae.
(2) Compared with the traditional mode that the vertebra is taken as a whole rigid body, the mode of circularly and accurately registering a plurality of vertebrae is adopted, the single-block step-by-step registration accuracy is higher, because 2D images in operation and 3D before operation are considered, the posture change of a patient under imaging equipment causes fine deformation between the vertebrae, if the vertebrae are taken as a rigid body, the registration result is difficult to avoid to be rough, and the accurate registration of a plurality of vertebrae solves the problem.
(3) The segmentation of the vertebrae into a plurality of vertebrae before the fine registration is not mentioned in the conventional registration method, and the purpose of the segmentation is to improve the efficiency of the registration by performing the registration on a plurality of vertebrae in the fine registration, namely segmenting each 3D vertebra into single blocks.
Detailed Description
The following description of the embodiments of the present invention is provided in order to better understand the present invention for those skilled in the art with reference to the accompanying drawings. It is to be expressly noted that in the following description, a detailed description of known functions and designs will be omitted when it may obscure the subject matter of the present invention.
Examples
For convenience of description, the related terms appearing in the detailed description are explained:
GPU (graphics Processing Unit): a graphics processor;
drr (digital reconstructed radiograms): digitally reconstructing a radiological image;
adam parameter optimization algorithm: adaptive motion Estimation.
FIG. 1 is a flow chart of a deep learning network-based 2D/3D spine CT level registration method of the invention.
In this embodiment, as shown in fig. 1, the 2D/3D spine CT level registration method based on a deep learning network of the present invention includes the following steps:
s1, acquiring an X-ray image as an intraoperative 2D reference image in the training and registration process, and acquiring a medical CT sequence as an preoperative 3D image in the training process;
s2, constructing a training image set;
s2.1, inputting the preoperative 3D image into a rigid body transformation model, and randomly transforming six-dimensional rigid body transformation parameter T ═ T (T)x,ty,tz,rx,ry,rz) Generating a group of three-dimensional image sequences, and then inputting the three-dimensional image sequences into an X-ray imaging calculation model for projection so as to generate a DRR image sequence; wherein, txRepresenting a translation parameter, t, on the X-axisyRepresenting a translation parameter, t, in the Y-axiszRepresenting a translation parameter in the Z-axis, rxRepresenting a rotation parameter along the X-axis, ryRepresenting a rotation parameter along the Y-axis, rzRepresenting a rotation parameter along the Z-axis; then, in this embodiment, the rotation matrices around the X-axis, the Y-axis, and the Z-axis can be expressed by the following equations, respectively:
the translation matrix is represented as: t isl(tx,ty,tz)T;
If the image is first rotated around the X-axis, Y-axis, and Z-axis in sequence, and then translated, the pixel coordinates before and after the rigid body transformation can be expressed as:
wherein, (x, y, z)
TRepresenting the spatial coordinates of a certain pixel point in the floating image,
representing the space coordinate of the pixel point after rigid body transformation;
in this embodiment, as shown in fig. 2, the X-Ray imaging calculation model may be implemented by using a Ray-Casting algorithm based on a GPU, and the model specifically includes:
wherein, I represents the energy of the X-ray after attenuation, I0Denotes the initial energy of X-rays, μiRepresents the linear attenuation coefficient of the ith voxel tissue, diRepresenting the distance traveled by the ray in the ith voxel;
s2.2, combining the DRR image sequences in pairs, wherein one image is used as a reference image, the other image is used as a floating image, and the two images form a training sample to form a training image set;
as shown in fig. 3, an 8-layer CNN model is built as a deep learning network model and trained;
a first layer input layer inputting a floating image and a reference image;
the second layer is the first convolution layer, the convolution kernel size is 5 x 20, no padding, the step size is 1, and the output matrix size of the layer is 152 x 296 x 20;
the third layer was the first pooling layer, with maximum pooling, a pooling window size of 2 x 2, step size of 2, the layer output matrix of 76 x 148 x 20;
the fourth layer is the second convolution layer, the convolution kernel size is 5 x 20, no padding, the step size is 1, and the output matrix size of the layer is 72 x 144 x 20;
the fifth layer is the second pooling layer, maximum pooling is used, the pooling window size is 2 x 2, the step size is 2, the layer output matrix is 36 x 72 x 20;
the sixth layer is a full connection layer, 250 ReLU activation function units are provided, and the number of output nodes is 250;
the seventh layer is a second full link layer and is provided with 6 ReLU activation function units, and the number of output nodes is 6;
the eighth layer is an output layer which outputs 6 parameters, namely (t)x,ty,tz,rx,ry,rz);
The method comprises the steps of sequentially inputting a floating image and a reference image in a training image set to a deep learning network model for training, subtracting the reference image from the floating image to obtain a residual image in the model training process, continuously extracting high-order characteristic information of the residual image through a network, seeking a deformation rule from the floating image to the reference image, outputting accurate 6 individual variable parameters, training by utilizing a TensorFlow frame and accelerating training by using a high-performance GPU and a CUDA (compute unified device architecture), wherein the specific training process is similar to a general deep learning network training process and is not repeated herein.
S4, carrying out coarse registration by using a deep learning network model;
according to the method of the step S2.1, a DRR image is generated by using the preoperative 3D image to be registered and is used as a floating image, and the floating image and the intraoperative 2D reference image are input into the trained depth learning network model together, so that the rough registration transformation parameters of the preoperative 3D image to be registered are output;
s5, performing fine registration of the single vertebra through an Adam parameter optimization algorithm;
s5.1, performing vertebra segmentation on the preoperative 3D image to be registered by using a Grow Cut region growing algorithm, so that each segmented sub-image only comprises one vertebra, and obtaining a plurality of single vertebra images;
s5.2, taking the rough registration transformation parameters as initial registration parameters of each single vertebral image, then carrying out rigid body transformation on the single vertebral image through the initial registration parameters, and then carrying out projection through an X-ray imaging calculation model to generate a DRR image of the single vertebral image as a floating image;
s5.3, calculating a DiceLoss value between the floating image of the single vertebra and the intraoperative 2D reference image;
wherein | X | represents the sum of all elements in the pixel matrix X of the floating image, | Y | represents the sum of all elements in the pixel matrix Y of the reference image, | X |, and Y | represents the sum of all elements after the pixel matrix X and the pixel matrix Y corresponding element point are multiplied;
s5.4, judging whether the Dice Loss value calculated in the step S5.3 is smaller than a preset threshold value or not, if so, stopping iteration, and finishing the precise registration of the single vertebral image; otherwise, setting the objective function of the Adam parameter optimization algorithm as Dice Loss, setting the parameter vector as the current fine registration parameter, then repeating the steps (5.2) - (5.4), and searching the optimal fine registration parameter with the smallest DiceLoss value through the Adam parameter optimization algorithm, thereby completing the fine registration of the single vertebral block diagram;
s5.5, judging whether all the single vertebral images are accurately registered, if not, repeating the steps S5.2-S5.4 until the accurate registration of all the single vertebral images is completed; otherwise, go to step S5.6;
and S5.6, performing spatial transformation on all the single vertebral images according to the correspondingly optimized fine registration parameters, and combining the single vertebral images according to the positions before segmentation so as to realize the CT level registration of the spine.
Although illustrative embodiments of the present invention have been described above to facilitate the understanding of the present invention by those skilled in the art, it should be understood that the present invention is not limited to the scope of the embodiments, and various changes may be made apparent to those skilled in the art as long as they are within the spirit and scope of the present invention as defined and defined by the appended claims, and all matters of the invention which utilize the inventive concepts are protected.