Image registration method, electronic device and storage medium
By training the deformation field smoothing model, the problem of difficulty in ensuring the smoothness and reversibility of the deformation field in the existing technology is solved, and better image registration effects are achieved, which is of great significance especially in applications in the medical field.
Patent Information
- Application Number
- CN202011309155.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-20
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-11-20
AI Technical Summary
In the prior art, smoothing the entire deformation field using the same method cannot guarantee the smoothness and reversibility of the deformation field, and it is difficult to directly obtain a smooth and reversible deformation field.
By training the deformation field smoothing model, the deformation field values corresponding to the target key points in the target deformation field are used for interpolation calculations, and the model parameters are adjusted to meet the convergence conditions to ensure the smoothness and reversibility of the deformation field.
It improves the smoothness and reversibility of the deformation field and ensures the accuracy of image registration and the unchanged topology of the deformation, which has important clinical significance.
Smart Images

Figure CN112435284B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image registration, and in particular to an image registration method, electronic equipment and storage medium. Background Art
[0002] Image registration is the process of spatially matching a floating image with a reference image. Specifically, one or a series of spatial transformations are sought for the floating image so that it can be spatially consistent with the corresponding points on the reference image. In the process of non-rigid image registration, this spatial transformation relationship can be reflected by the deformation field, that is, the coordinate correspondence between the reference image and the floating image. Ideally, this coordinate correspondence should be one-to-one, that is, the deformation field from the floating image to the reference image is reversible and smooth. Reversibility means that the estimated bidirectional deformation field between the image pairs has the same path. However, it is usually difficult to obtain a smooth and reversible deformation field directly through existing image registration methods, and the deformation field needs to be smoothed later.
[0003] In traditional image registration methods, the reversibility and smoothness of the deformation field can be guaranteed by differential geometry constraints, but the calculation is large and time-consuming. Therefore, in order to ensure the smoothness of the deformation field, the deformation field is usually subjected to mean smoothing or Gaussian smoothing, which is a commonly used image smoothing method. Image smoothing operations such as mean smoothing or Gaussian smoothing use the same smoothing operator to perform a sliding window operation on the entire image and perform a weighted summation on the pixel values within the sliding window. This operation of smoothing different local positions of the entire image in the same way is not well suited for smoothing the deformation field, and cannot guarantee the reversibility of the deformation field after smoothing. Summary of the invention
[0004] The technical problem to be solved by the present invention is to overcome the defect in the prior art that the smoothing operation of the entire deformation field using the same method cannot ensure the smoothness and reversibility of the deformation field, and to provide an image registration method, an electronic device and a storage medium.
[0005] The present invention solves the above technical problems through the following technical solutions:
[0006] A first aspect of the present invention provides an image registration method, comprising:
[0007] Obtaining a target deformation field from a target image to be registered to a target reference image;
[0008] Inputting the target deformation field into a deformation field smoothing model to obtain a processed target deformation field;
[0009] Registering the target image to be registered to the target reference image according to the processed target deformation field;
[0010] The deformation field smoothing model is obtained by training through the following steps:
[0011] For the sample image to be registered and the sample reference image in the training sample, an original deformation field from the sample image to be registered to the corresponding sample reference image is obtained, and the original deformation field is input into the deformation field smoothing model;
[0012] Calculating a first loss value according to a first deformation field output by the deformation field smoothing model and the original deformation field;
[0013] Inverting the output first deformation field to obtain a second deformation field;
[0014] Calculating a second loss value according to the second deformation field and the first deformation field;
[0015] The parameters of the deformation field smoothing model are adjusted according to the first loss value and the second loss value until a convergence condition is met, and the trained deformation field smoothing model is output.
[0016] Preferably, the step of inputting the target deformation field into the deformation field smoothing model specifically includes:
[0017] Selecting target key points in the target reference image;
[0018] Preprocessing the deformation field values corresponding to the non-target key points in the target deformation field; wherein the non-target key points are points other than the target key points in the target reference image;
[0019] The target deformation field after preprocessing is input into the deformation field smoothing model.
[0020] Preferably, the step of selecting target key points in the target reference image includes: selecting target key points in an edge area of the target reference image.
[0021] Preferably, the step of selecting target key points in the target reference image comprises:
[0022] Determine a first target area in the target reference image according to pixel points whose difference between the target reference image and the target image to be registered exceeds a first preset threshold;
[0023] Select target key points from the first target area.
[0024] Preferably, the step of determining the first target area in the target reference image according to the pixel points whose difference between the target reference image and the target image to be registered exceeds a preset threshold specifically comprises:
[0025] Obtaining a first difference between the value of each pixel point in the target reference image and the value of the corresponding pixel point in the target image to be registered;
[0026] If the first difference exceeds a first preset threshold, taking the corresponding pixel point in the target reference image as the first target pixel point;
[0027] Determine an area formed by the first target pixel points as a first target area.
[0028] Preferably, the step of selecting target key points from the first target area specifically includes:
[0029] Select target key points from the edge area of the first target area.
[0030] Preferably, the step of inputting the original deformation field into the deformation field smoothing model specifically includes:
[0031] Select sample key points in the sample reference image;
[0032] Preprocessing the deformation field values corresponding to the non-sample key points in the original deformation field to obtain an intermediate deformation field; wherein the non-sample key points are points other than the sample key points in the sample reference image;
[0033] The intermediate deformation field is input into the deformation field smoothing model.
[0034] Preferably, the step of selecting sample key points in the sample reference image comprises:
[0035] Select sample key points in the edge area of the sample reference image.
[0036] Preferably, the second target area in the sample reference image is determined according to the pixel points whose difference between the sample reference image and the sample image to be registered exceeds a second preset threshold;
[0037] Select sample key points from the second target area.
[0038] Preferably, the step of determining the second target area in the sample reference image according to the pixel points whose difference between the sample reference image and the sample image to be registered exceeds a second preset threshold value specifically comprises:
[0039] Obtaining a second difference between the value of each pixel point in the sample reference image and the value of the corresponding pixel point in the sample image to be registered;
[0040] If the second difference exceeds a second preset threshold, taking the corresponding pixel point in the sample reference image as the second target pixel point;
[0041] Determine an area formed by the second target pixel points as a second target area.
[0042] Preferably, the step of selecting sample key points from the second target area specifically includes:
[0043] Select sample key points from the edge area of the second target area.
[0044] Preferably, the calculating the second loss value according to the second deformation field and the first deformation field specifically includes:
[0045] A second loss value is calculated according to the value of the target voxel in the first deformation field and the value of the target voxel at a corresponding position in the second deformation field.
[0046] Preferably, adjusting the parameters of the deformation field smoothing model according to the first loss value and the second loss value specifically includes:
[0047] Performing a weighted summation of the first loss value and the second loss value to obtain a third loss value;
[0048] The parameters of the deformation field smoothing model are adjusted according to the third loss value.
[0049] A second aspect of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the image registration method described in the first aspect when executing the computer program.
[0050] A third aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the image registration method as described in the first aspect.
[0051] The positive and progressive effect of the present invention is that the target deformation field is input into the trained deformation field smoothing model, and the deformation field values corresponding to the target key points in the target deformation field are interpolated to calculate the deformation field values corresponding to the non-target key points, so as to ensure the smooth transition of each deformation field value in the target deformation field output by the deformation field smoothing model, thereby improving the smoothness of the output target deformation field. In addition, since the deformation field smoothing model is trained based on the first loss value and the second loss value (i.e., the inverse consistency loss value), the target deformation field obtained by inputting the target deformation field into the deformation field smoothing model has better reversibility while ensuring accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 This is a flowchart of an image registration method provided in Example 1 of the present invention.
[0053] Figure 2 A flowchart of a method for training a deformation field smoothing model provided in Example 1 of the present invention.
[0054] Figure 3 A schematic diagram of an original deformation field provided in Example 1 of the present invention.
[0055] Figure 4 A schematic diagram of sample key points selected on a sample reference image provided in Embodiment 1 of the present invention.
[0056] Figure 5 A schematic diagram of sample key points selected from a second target area on a sample reference image provided in Embodiment 1 of the present invention.
[0057] Figure 6 For the general Figure 3 and Figure 4 Schematic diagram of the effect after merging the sample key points in .
[0058] Figure 7 A schematic diagram of an intermediate deformation field provided in Example 1 of the present invention.
[0059] Figure 8 A schematic diagram of a first deformation field provided in Example 1 of the present invention.
[0060] Fig. 9 A schematic diagram of a second deformation field provided in Example 1 of the present invention.
[0061] Fig.10 A schematic diagram of a method for training a deformation field smoothing model provided in Example 1 of the present invention.
[0062] Fig.11 A schematic diagram of the structure of an electronic device provided in Example 2 of the present invention. DETAILED DESCRIPTION
[0063] The present invention is further described below by way of examples, but the present invention is not limited to the scope of the examples.
[0064] The non-rigid image registration in the present invention can be applied to military, remote sensing, medicine and other fields. In the application scenario in the medical field, the images to be registered and the reference images involved in the image registration can be medical images. In clinical applications, the registration of images at multiple time points can be used for follow-up studies, and the image registration of different people can be applied to population analysis and quantitative evaluation of different objects. Although accuracy is a key factor in evaluating image registration performance, the smoothness and reversibility of the deformation field are also crucial, especially when analyzing subtle anatomical changes. On the basis of ensuring the accuracy of the deformation, improving the smoothness and reversibility of the deformation field as much as possible can keep the topological structure of the image anatomy unchanged, which has important clinical significance.
[0065] It should be noted that, in some embodiments, the image to be registered may also be referred to as a floating image.
[0066] Example 1
[0067] This embodiment provides an image registration method, such as Figure 1 As shown, the following steps S101 to S103 are included:
[0068] Step S101: Obtain a target deformation field from a target image to be registered to a target reference image.
[0069] In an example of a specific implementation of step S101, the target image to be registered and the target reference image are input into a trained deformable registration model to obtain a target deformation field for registering the target image to the target reference image. In another example of a specific implementation of step S101, the target image to be registered and the target reference image are input into a fnirt (a nonlinear registration function) registration algorithm model to obtain a target deformation field for registering the target image to the target reference image.
[0070] Step S102: input the target deformation field into a deformation field smoothing model to obtain a processed target deformation field.
[0071] In an optional implementation manner, step S102 includes the following steps S102a to S102c:
[0072] Step S102a: Select target key points in the target reference image.
[0073] Generally, the accuracy of the edge registration of the target reference image largely determines the overall registration accuracy of the target image to be registered. In order to ensure the overall registration accuracy of the target image to be registered, in an optional implementation of step S102a, target key points are selected in the edge area of the target reference image.
[0074] In a specific implementation, an edge extraction operator can be used to extract the edge region of the target reference image, and a certain number of points can be selected from the edge region as target key points. In one example, the Sobel operator (an edge extraction operator) is used to obtain the first-order gradient of the target reference image to obtain the edge region of the target reference image, and a certain number of points can be randomly selected on the first-order gradient to obtain the target key points. Figure 3 In the example shown, the white pixels are the target key points selected from the target reference image.
[0075] The area where the target reference image and the target image to be registered have a large difference means that the deformation is large. In another optional implementation of step S102a, the target key point is selected according to the area where the target reference image and the target image to be registered have a large difference. Specifically, step S102a includes the following steps S102a1 and S102a2:
[0076] Step S102a1, determining a first target region in the target reference image according to each pixel point whose difference between the target reference image and the target image to be registered exceeds a first preset threshold.
[0077] In an optional implementation of step S102a1, a difference is made between the target reference image and the target image to be registered, that is, the value of each pixel in the target reference image is subtracted from the value of the corresponding pixel in the target image to be registered, and pixels whose difference exceeds a first preset threshold are selected, and the area formed by these pixels is the first target area.
[0078] In other optional implementations of step S102a1, a quotient may be taken between the target reference image and the target image to be registered to obtain the first target region.
[0079] Step S102a2: Select target key points from the first target area.
[0080] In a specific implementation example, a certain number of points are selected from the first target area, that is, from the pixel points exceeding the first preset threshold, as target key points.
[0081] In another specific implementation example, an edge region is extracted from the first target region, and a target key point is selected in the edge region.
[0082] In another specific implementation example, a target key point, ie, a first target key point, is first selected from an edge region of a target reference image, and then a target key point, ie, a second target key point, is selected from an edge region of the first target region.
[0083] Step S102b: pre-process the deformation field values corresponding to the non-target key points in the target deformation field, wherein the non-target key points are points other than the target key points in the target reference image.
[0084] In an optional implementation of step S102b, the preprocessing includes: setting all deformation field values corresponding to non-target key points in the target deformation field to 0.
[0085] Step S102c: input the target deformation field after preprocessing into the deformation field smoothing model.
[0086] In this implementation, only the deformation field values corresponding to non-target key points in the target deformation field are preprocessed, while the deformation field values corresponding to the target key points are kept consistent before and after preprocessing. The preprocessed target deformation field is input into the deformation field smoothing model, which can ensure the accuracy of deformation at the target key points.
[0087] Among them, combined Figure 2 and Fig.10 As shown, the above deformation field smoothing model is obtained by training through the following steps S201 to S207:
[0088] Step S201: for a sample image to be registered and a sample reference image in a training sample, an original deformation field from the sample image to be registered to the corresponding sample reference image is obtained, and the original deformation field is input into a deformation field smoothing model.
[0089] The training samples include several different sample images to be registered and corresponding sample reference images.
[0090] In a specific example, the original deformation field of the sample to be registered image to the sample reference image is as follows: Figure 3 shown.
[0091] In an optional implementation manner, step S201 includes the following steps S201a to S201c:
[0092] Step S201a: Select sample key points in the sample reference image.
[0093] Generally, the accuracy of edge registration of the sample reference image largely determines the overall registration accuracy of the sample image to be registered. In order to ensure the overall registration accuracy of the sample image to be registered, in an optional implementation of step S201a, sample key points are selected in the edge area of the sample reference image.
[0094] In a specific implementation, an edge extraction operator can be used to extract the edge region of the sample reference image, and a certain number of points can be selected from the edge region as sample key points. In one example, the Sobel operator (an edge extraction operator) is used to obtain the first-order gradient of the sample reference image to obtain the edge region of the sample reference image, and a certain number of points can be randomly selected on the first-order gradient to obtain the sample key points. Figure 4 In the example shown, the white pixels are sample key points selected from the sample reference image.
[0095] The area where the sample reference image and the sample image to be registered have a large difference means that the deformation is large. In another optional implementation of step S201a, sample key points are selected according to the area where the sample reference image and the sample image to be registered have a large difference. Specifically, step S201a includes the following steps S201a1 to S201a2:
[0096] Step S201a1: determine a second target area in the sample reference image according to the pixel points whose difference between the sample reference image and the sample image to be registered exceeds a second preset threshold.
[0097] In an optional implementation of step S201a1, the sample reference image and the sample image to be registered are subtracted, that is, the value of each pixel in the sample reference image is subtracted from the value of the corresponding pixel in the sample image to be registered, and the pixels whose difference exceeds the second preset threshold are selected, and the area formed by these pixels is the second target area. The second preset threshold can be set according to actual conditions.
[0098] In other optional implementations of step S201a1, the sample reference image and the sample to-be-registered image may be divided to obtain a second target region. Step S201a2: Select sample key points from the second target region.
[0099] In a specific implementation example, a certain number of points are selected from the second target area, that is, from the pixel points exceeding the second preset threshold, as sample key points.
[0100] In another specific implementation example, an edge region is extracted from the second target region, and sample key points are selected in the edge region. Figure 5 In the example shown, the white pixels are sample key points selected from the edge region of the second target region on the sample reference image.
[0101] In another specific implementation example, a sample key point, namely a first sample key point, is first selected from an edge region of the sample reference image, and then a sample key point, namely a second sample key point, is selected from an edge region of the second target region. Figure 4 The first sample keypoint shown is Figure 5 After merging the second sample key points shown in Figure 6 The effects shown, such as Figure 6 The white pixel points shown include the first sample key point and the second sample key point in the sample reference image.
[0102] Step S201b, preprocessing the deformation field values corresponding to the non-sample key points in the original deformation field to obtain an intermediate deformation field; wherein the non-sample key points are points in the sample reference image other than the sample key points.
[0103] In an optional implementation of step S201b, the deformation field values corresponding to non-sample key points in the sample deformation field are all set to 0 to obtain an intermediate deformation field. In this implementation, only the places corresponding to the sample key points have deformation field values in the intermediate deformation field.
[0104] Step S201c: input the intermediate deformation field into a deformation field smoothing model.
[0105] In this implementation, only the deformation field values corresponding to non-sample key points in the original deformation field are preprocessed, while the deformation field values corresponding to the sample key points remain consistent before and after preprocessing. The preprocessed original deformation field, i.e., the intermediate deformation field, is input into the deformation field smoothing model, which can ensure the accuracy of deformation at the sample key points.
[0106] It should be noted that, in a specific implementation, if the deformation field values corresponding to the non-sample key points in the original deformation field are preprocessed during the training phase of the deformation field smoothing model, then in the use phase of the deformation field smoothing model, i.e., in the above step S102, the deformation field values corresponding to the non-target key points in the target deformation field also need to be preprocessed in the same manner. Similarly, if the deformation field values corresponding to the non-sample key points in the original deformation field are not preprocessed during the training phase of the deformation field smoothing model, then in the use phase of the deformation field smoothing model, i.e., in the above step S102, the deformation field values corresponding to the non-target key points in the target deformation field also do not need to be preprocessed.
[0107] Step S202: Calculate a first loss value according to the first deformation field output by the deformation field smoothing model and the original deformation field.
[0108] In an optional implementation, the first loss value is calculated using a mean square error (MSE) loss function, specifically the sum of squares of the difference between the output first deformation field and the original deformation field. In other optional implementations, other loss functions may also be used to calculate the first loss value.
[0109] Step S203: Invert the output first deformation field to obtain a second deformation field.
[0110] It should be noted that the first deformation field is the deformation field of the sample image to be registered to the sample reference image, and the second deformation field obtained by inverting the first deformation field is the deformation field of the sample reference image to be registered to the sample image to be registered.
[0111] In a specific example of the deformation field smoothing model training phase, according to Figure 6 The position of the sample key points shown in the sample reference image will be Figure 3The deformation field values corresponding to non-sample key points in the original deformation field shown are all set to 0, and we can get Figure 7 The intermediate deformation field shown is the sample deformation field after preprocessing. Figure 7 The intermediate deformation field shown is input into the deformation field smoothing model for interpolation calculation, and we can get Figure 8 The first deformation field is shown. Figure 8 By inverting the first deformation field shown, we can get Fig. 9 The second deformation field is shown.
[0112] Step S204: Calculate a second loss value according to the second deformation field and the first deformation field.
[0113] The second loss value is essentially an inverse consistency loss value. Inverse consistency means that the estimated bidirectional deformation fields between the image pairs have the same path. When the deformation field is absolutely reversible, the deformation field that is absolutely reversible with it can be calculated. The inverse consistency loss value of two mutually absolutely reversible deformation fields is zero. However, when the deformation field is not absolutely reversible, only its approximate inverse deformation field can be calculated.
[0114] In an optional implementation of step S204, a second loss value is calculated according to a value of a target voxel in the first deformation field and a value of a corresponding position of the target voxel in the second deformation field.
[0115] In a specific implementation example, the second loss value L is calculated using the following formula: cons-loss (f AB ,f BA ):
[0116]
[0117] Among them, f AB is the first deformation field, f BA is the second deformation field, N is the number of voxels in the first deformation field or the second deformation field, ||·|| is the L2 regularization term, ° refers to the sum of the value of voxel n in the first deformation field and the value of voxel n at the corresponding position in the second deformation field, n = 1, 2, 3...N.
[0118] In a specific implementation example, the first deformation field f AB The voxel v is in the second deformation field f BA The corresponding position is u=v+f AB (v). u is not necessarily on the grid point. According to the 8-domain of u, f BA Perform linear interpolation to obtain f BA The value at point u. BA The value at point u is related to f ABThe value at the voxel v of the point is added to obtain the inverse consistency loss value of the point. The same operation is performed on other points, and the inverse consistency loss values of all points are summed to obtain the inverse consistency loss value of the entire deformation field, that is, the second loss value.
[0119] Step S205: determine whether a convergence condition is met according to the first loss value and the second loss value; if so, execute step S207; if not, execute step S206.
[0120] Step S206, adjusting the parameters of the deformation field smoothing model according to the first loss value and the second loss value, and returning to step S201. Wherein, returning to step S201, the deformation field smoothing model is further trained using other sample images to be registered in the training samples and the corresponding sample reference images.
[0121] In an optional implementation, in step S205, a third loss value obtained by weighted summing the first loss value and the second loss value is used to determine whether the convergence condition is met, and in step S206, the parameters of the deformation field smoothing model are adjusted according to the third loss value obtained by weighted summing. The weights of the first loss value and the second loss value can be set according to actual needs. For example, if the demand for the reversibility of the deformation field is higher, the weight of the second loss value can be set to be greater than the weight of the first loss value.
[0122] In a specific implementation example, the convergence condition is satisfied when the third loss value is less than a preset value, and the preset value can be set according to actual needs.
[0123] Step S207, stop training and output the deformation field smoothing model. The deformation field smoothing model outputted in step S207 is the trained deformation field smoothing model.
[0124] In an optional implementation, the deformation field smoothing model is a neural network model. In one example, the neural network model adopts a UNet network structure.
[0125] In the process of training the deformation field smoothing model in this embodiment, the deformation field smoothing model is trained based on the first deformation field output by the deformation field smoothing model and the first loss value calculated based on the original deformation field, and the second loss value calculated based on the first deformation field and the second deformation field obtained by inverting the first deformation field, so that the target deformation field output by the trained deformation field smoothing model has better smoothness and reversibility while ensuring accuracy.
[0126] Step S103: registering the target image to be registered to the target reference image according to the processed target deformation field.
[0127] In this embodiment, the target deformation field is input into the trained deformation field smoothing model, and the deformation field values corresponding to the target key points in the target deformation field are interpolated to calculate the deformation field values corresponding to the non-target key points, thereby ensuring the smooth transition of each deformation field value in the target deformation field output by the deformation field smoothing model, thereby improving the smoothness of the output target deformation field. In addition, since the deformation field smoothing model is trained based on the first loss value and the second loss value (i.e., the inverse consistency loss value), the target deformation field obtained by inputting the target deformation field into the deformation field smoothing model has better reversibility.
[0128] Example 2
[0129] Fig.11 The schematic diagram of the structure of an electronic device provided in this embodiment includes a memory, a processor, a computer program stored in the memory and executable on the processor, and multiple subsystems for implementing different functions, and the image registration method of embodiment 1 is implemented when the processor executes the program. Fig.11 The electronic device 3 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0130] The components of the electronic device 3 may include, but are not limited to: the at least one processor 4 mentioned above, the at least one memory 5 mentioned above, and a bus 6 connecting different system components (including the memory 5 and the processor 4).
[0131] The bus 6 includes a data bus, an address bus and a control bus.
[0132] The memory 5 may include a volatile memory, such as a random access memory (RAM) and / or a cache memory, and may further include a read-only memory (ROM).
[0133] Memory 5 may also include a program / utility having a set (at least one) of program modules, such program modules including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0134] The processor 4 executes various functional applications and data processing by running the computer programs stored in the memory 5, such as the image registration method in embodiment 1 of the present invention.
[0135] The electronic device 3 may also communicate with one or more external devices 7 (e.g., keyboards, pointing devices, etc.). Such communication may be performed via an input / output (I / O) interface 8. Furthermore, the electronic device 3 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 9. Fig.11 As shown, the network adapter 9 communicates with other modules of the electronic device 3 via the bus 6. It should be understood that although Fig.11 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 3, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems.
[0136] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules to be embodied.
[0137] Example 3
[0138] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the image registration method of embodiment 1 is implemented.
[0139] The readable storage medium may include but is not limited to: a portable disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical storage device, a magnetic storage device or any suitable combination of the above.
[0140] In a possible implementation manner, the present invention may also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the image registration method of embodiment 1.
[0141] The program code for executing the present invention may be written in any combination of one or more programming languages, and may be executed entirely on a user device, partially on a user device, as an independent software package, partially on a user device and partially on a remote device, or entirely on a remote device.
[0142] Although the specific embodiments of the present invention are described above, it should be understood by those skilled in the art that this is only for illustration and the protection scope of the present invention is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, but these changes and modifications all fall within the protection scope of the present invention.
Claims
1. An image registration method, It is characterized in that include: Obtaining a target deformation field from a target image to be registered to a target reference image; Inputting the target deformation field into a deformation field smoothing model to obtain a processed target deformation field; Registering the target image to be registered to the target reference image according to the processed target deformation field; The deformation field smoothing model is obtained by training through the following steps: For the sample image to be registered and the sample reference image in the training sample, an original deformation field from the sample image to be registered to the corresponding sample reference image is obtained, and the original deformation field is input into the deformation field smoothing model; Calculating a first loss value according to a first deformation field output by the deformation field smoothing model and the original deformation field; Inverting the first deformation field to obtain a second deformation field; Calculating a second loss value according to the second deformation field and the first deformation field; The parameters of the deformation field smoothing model are adjusted according to the first loss value and the second loss value until a convergence condition is met, and the trained deformation field smoothing model is output.
2. The image registration method according to claim 1, It is characterized in that The step of inputting the target deformation field into the deformation field smoothing model specifically includes: Selecting target key points in the target reference image; Preprocessing the deformation field values corresponding to the non-target key points in the target deformation field; wherein the non-target key points are points other than the target key points in the target reference image; The target deformation field after preprocessing is input into the deformation field smoothing model.
3. The image registration method according to claim 2, It is characterized in that The step of selecting target key points in the target reference image includes: selecting target key points in an edge area of the target reference image.
4. The image registration method according to claim 2, It is characterized in that The step of selecting target key points in the target reference image comprises: Determine a first target area in the target reference image according to pixel points whose difference between the target reference image and the target image to be registered exceeds a first preset threshold; Select target key points from the first target area.
5. The image registration method according to claim 4, It is characterized in that The step of determining the first target area in the target reference image according to the pixel points whose difference between the target reference image and the target image to be registered exceeds a preset threshold specifically comprises: Obtaining a first difference between the value of each pixel point in the target reference image and the value of the corresponding pixel point in the target image to be registered; If the first difference exceeds a first preset threshold, taking the corresponding pixel point in the target reference image as the first target pixel point; Determine an area formed by the first target pixel points as a first target area; and / or, The step of selecting target key points from the first target area specifically includes: Select target key points from the edge area of the first target area.
6. The image registration method according to claim 2, It is characterized in that The step of inputting the original deformation field into the deformation field smoothing model specifically includes: Select sample key points in the sample reference image; Preprocessing the deformation field values corresponding to the non-sample key points in the original deformation field; wherein the non-sample key points are points other than the sample key points in the sample reference image; The original deformation field after preprocessing is input into the deformation field smoothing model.
7. The image registration method according to claim 6, It is characterized in that The step of selecting sample key points in the sample reference image comprises: Selecting sample key points in the edge area of the sample reference image; and / or, Determine a second target area in the sample reference image according to pixel points whose difference between the sample reference image and the sample image to be registered exceeds a second preset threshold; Select sample key points from the second target area.
8. The image registration method according to claim 1, It is characterized in that The calculating the second loss value according to the second deformation field and the first deformation field specifically includes: Calculating a second loss value according to the value of the target voxel in the first deformation field and the value of the corresponding position of the target voxel in the second deformation field; and / or, The adjusting the parameters of the deformation field smoothing model according to the first loss value and the second loss value specifically includes: Performing a weighted summation of the first loss value and the second loss value to obtain a third loss value; The parameters of the deformation field smoothing model are adjusted according to the third loss value.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the image registration method according to any one of claims 1 to 8 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the image registration method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Three-dimensional face model establishing method and device and electronic equipment
CN110458924A
Image registration model training method, image registration method and computer equipment
CN110838139A
