#include <itkFEMRegistrationFilter.h>
Inheritance diagram for itk::fem::FEMRegistrationFilter:
The image registration problem is modeled here with the finite element method. Image registration is, in general, an ill-posed problem. Thus, we use an optimization scheme where the optimization criterion is given by a regularized variational energy. The variational energy arises from modeling the image as a physical body on which external forces act. The body is allowed to deform so as to minimize the applied force. The resistance of the physical body to deformation, determined by the physics associated with the body, serves to regularize the solution. The forces applied to the body are, generally, highly non-linear and so the body is allowed to deform slowly and incrementally. The direction it deforms follows the gradient of the potential energy (the force) we define. The potential energies we may choose from are given by the itk image-to-image metrics. The choices and the associated direction of descent are : Mean Squares (minimize), Normalized Cross-Correlation (maximize) Pattern Intensity (maximize) Mutual Information (maximize). Note that we have to set the direction (SetDescentDirection) when we choose a metric. The forces driving the problem may also be given by user-supplied landmarks. The corners of the image, in this example, are always pinned. This example is designed for 2D or 3D images. A rectilinear mesh is generated automatically given the correct element type (Quadrilateral or Hexahedral).
Our specific Solver for this example uses trapezoidal time stepping. This is a method for solving a second-order PDE in time. The solution is penalized by the zeroth (mass matrix) and first derivatives (stiffness matrix) of the shape functions. There is an option to perform a line search on the energy after each iteration. Optimal parameter settings require experimentation. The following approach tends to work well : Choose the relative size of density to elasticity (e.g. Rho / E ~= 1.) such that the image deforms locally and slowly. This also affects the stability of the solution. Choose the time step to control the size of the deformation at each step. Choose enough iterations to allow the solution to converge (this may be automated).
Reading images is up to the user. Either set the images using SetReference/TargetImage or see the ReadImages function. Outputs are raw images of the same type as the reference image.
Definition at line 98 of file itkFEMRegistrationFilter.h.
|
Reimplemented from itk::ImageToImageFilter< TReference, TTarget >. Definition at line 104 of file itkFEMRegistrationFilter.h. |
|
Definition at line 136 of file itkFEMRegistrationFilter.h. |
|
Definition at line 133 of file itkFEMRegistrationFilter.h. |
|
Definition at line 126 of file itkFEMRegistrationFilter.h. |
|
Definition at line 122 of file itkFEMRegistrationFilter.h. |
|
Definition at line 114 of file itkFEMRegistrationFilter.h. |
|
Definition at line 135 of file itkFEMRegistrationFilter.h. |
|
Instantiate the load class with the correct image type. Definition at line 140 of file itkFEMRegistrationFilter.h. |
|
Definition at line 116 of file itkFEMRegistrationFilter.h. |
|
Definition at line 112 of file itkFEMRegistrationFilter.h. |
|
Definition at line 137 of file itkFEMRegistrationFilter.h. |
|
Definition at line 123 of file itkFEMRegistrationFilter.h. |
|
Definition at line 129 of file itkFEMRegistrationFilter.h. |
|
Definition at line 130 of file itkFEMRegistrationFilter.h. |
|
Definition at line 131 of file itkFEMRegistrationFilter.h. |
|
Definition at line 115 of file itkFEMRegistrationFilter.h. |
|
Reimplemented from itk::ImageToImageFilter< TReference, TTarget >. Definition at line 103 of file itkFEMRegistrationFilter.h. |
|
Standard class typedefs. Reimplemented from itk::ImageToImageFilter< TReference, TTarget >. Definition at line 101 of file itkFEMRegistrationFilter.h. |
|
Definition at line 124 of file itkFEMRegistrationFilter.h. |
|
Reimplemented from itk::ImageToImageFilter< TReference, TTarget >. Definition at line 102 of file itkFEMRegistrationFilter.h. |
|
Definition at line 113 of file itkFEMRegistrationFilter.h. |
|
Definition at line 132 of file itkFEMRegistrationFilter.h. |
|
Definition at line 134 of file itkFEMRegistrationFilter.h. |
|
Definition at line 125 of file itkFEMRegistrationFilter.h. |
|
de/constructor |
|
de/constructor |
|
The loads are entered into the solver. |
|
Choose the metric by parameter : 0= mean squares, 1=cross correlation, 2=pattern intensity, 3 = mutual information. |
|
Builds the itpack linear system wrapper with appropriate parameters. Currently undefined |
|
This function generates a regular mesh of ElementsPerSide^D size |
|
Finds the minimum energy between the current and next solution by linear search. Definition at line 305 of file itkFEMRegistrationFilter.h. |
|
Sets the use of multi-resolution strategy. The control file always uses multi-res. Definition at line 309 of file itkFEMRegistrationFilter.h. |
|
Evaluates the image similarity energy by calling the image metric |
|
|
|
|
|
Run-time type information (and related methods) Reimplemented from itk::ImageToImageFilter< TReference, TTarget >. |
|
Definition at line 327 of file itkFEMRegistrationFilter.h. |
|
Outputs the FE deformation field interpolated over the entire image domain. Definition at line 226 of file itkFEMRegistrationFilter.h. |
|
Gets the stiffness Matrix weight. Definition at line 290 of file itkFEMRegistrationFilter.h. |
|
Definition at line 329 of file itkFEMRegistrationFilter.h. |
|
Definition at line 201 of file itkFEMRegistrationFilter.h. |
|
Definition at line 216 of file itkFEMRegistrationFilter.h. |
|
Definition at line 243 of file itkFEMRegistrationFilter.h. |
|
Definition at line 205 of file itkFEMRegistrationFilter.h. |
|
Definition at line 218 of file itkFEMRegistrationFilter.h. |
|
Interpolates the vector field over the domain. Our convention is to always keep the vector field at the scale of the original images. |
|
Get the reference image warped to the target image. Must first apply the warp using WarpImage() Definition at line 223 of file itkFEMRegistrationFilter.h. |
|
Sets the boolean for writing the displacement field to a file. Definition at line 321 of file itkFEMRegistrationFilter.h. |
|
Finds the optimum value between the last two solutions and sets the current solution to that value. Uses Evaluate Residual; |
|
The solution loop |
|
Dimensionality of input and output data is assumed to be the same. |
|
The solution loop for a simple multi-resolution strategy. |
|
Method for creation through the object factory. Reimplemented from itk::ImageToImageFilter< TReference, TTarget >. |
|
Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes. Reimplemented from itk::ImageToImageFilter< TReference, TTarget >. Definition at line 364 of file itkFEMRegistrationFilter.h. |
|
|
|
Read the configuration file to set up the example parameters |
|
Call this to register two images. |
|
This is used for changing between mesh resolutions. |
|
Set alpha for the trapezoidal rule (usually 1.0 in our experiments). Definition at line 280 of file itkFEMRegistrationFilter.h. |
|
Sets the file name for the FEM multi-resolution registration. One can also set the parameters in code. Definition at line 325 of file itkFEMRegistrationFilter.h. |
|
Tries to maximize energy Definition at line 302 of file itkFEMRegistrationFilter.h. |
|
Tries to minimize energy Definition at line 299 of file itkFEMRegistrationFilter.h. |
|
Sets the filename for the vector field component images. Definition at line 246 of file itkFEMRegistrationFilter.h. |
|
Sets the stiffness Matrix weight. Definition at line 287 of file itkFEMRegistrationFilter.h. |
|
This function allows one to set the element and its material externally. Definition at line 339 of file itkFEMRegistrationFilter.h. |
|
Sets the energy below which we decide the solution has converged. Definition at line 284 of file itkFEMRegistrationFilter.h. |
|
Image similarity energy weight Definition at line 296 of file itkFEMRegistrationFilter.h. |
|
These functions control the use of landmark constraints. Currently, landmarks must be read in from a file. Definition at line 230 of file itkFEMRegistrationFilter.h. |
|
This allows one to skip the line search every fth iteration. Definition at line 312 of file itkFEMRegistrationFilter.h. |
|
This sets the line search's max iterations. Definition at line 315 of file itkFEMRegistrationFilter.h. |
|
This sets the pointer to the material. Definition at line 342 of file itkFEMRegistrationFilter.h. References HardConnectedComponentImageFilter::PrintSelf(). |
|
Setting the maximum iterations stops the solution after i iterations regardless of energy.
Definition at line 273 of file itkFEMRegistrationFilter.h. |
|
The FEM filter can generate its own mesh for 2 or 3 dimensions, if none is provided. The mesh is generated for quadrilaterals in 2D and hexahedra in 3D. This function sets the number of elements generated along each dimension at the resolution designated by "which". E.g. to generate 10 elements per dimension in the 1st resolution, use SetMeshResolution(10,0);. Definition at line 254 of file itkFEMRegistrationFilter.h. |
|
Set/Get the Metric. Definition at line 332 of file itkFEMRegistrationFilter.h. |
|
This determines the number of integration points to use at each resolution. These integration points are used to generate the force. The actual number used will be i^d, where d is the number of parameters in the elements local domain. Definition at line 260 of file itkFEMRegistrationFilter.h. |
|
One can set the reference file names to read images from files Definition at line 199 of file itkFEMRegistrationFilter.h. |
|
Define the reference (moving) image. |
|
The warped reference image will be written to this file name with the extension "11.img" appended to it. One can also output the image after every iteration, yielding result11.img, result12.img, etc. by uncommenting the code at the end of IterativeSolve. Definition at line 239 of file itkFEMRegistrationFilter.h. |
|
Definition at line 241 of file itkFEMRegistrationFilter.h. |
|
Mass matrix weight Definition at line 293 of file itkFEMRegistrationFilter.h. |
|
Definition at line 203 of file itkFEMRegistrationFilter.h. |
|
Define the target (fixed) image. |
|
Setting the time step - usually 1.0. We prefer to use rho to control step sizes. Definition at line 277 of file itkFEMRegistrationFilter.h. |
|
The metric region allows one to compute the derivative (force) of the similarity metric using a region of size [i,i] in 2D [i,i,i] in 3D.
Definition at line 267 of file itkFEMRegistrationFilter.h. |
|
Sets the boolean for writing the displacement field to a file. Definition at line 318 of file itkFEMRegistrationFilter.h. |
|
This determines if the landmark file will be read Definition at line 233 of file itkFEMRegistrationFilter.h. |
|
Applies the warp to the input image. |
|
Writes the displacement field to a file. |
|
Call this to write out images - a counter is attached to the file name so we can output a numbered sequence tracking the deformation. |