#include <itkFEMRegistrationFilter.h>
Inheritance diagram for itk::fem::FEMRegistrationFilter< TMovingImage, TFixedImage >:
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) 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 SetMoving/FixedImage or see the ReadImages function.
TODO : Keep the full field around (if using re-gridding). Introduce compensation for kinematic non-linearity in time (if using Eulerian frame).
Definition at line 102 of file itkFEMRegistrationFilter.h.
|
Reimplemented from itk::ImageToImageFilter< TMovingImage, TFixedImage >. Definition at line 108 of file itkFEMRegistrationFilter.h. |
|
Typedef support for the interpolation function Definition at line 145 of file itkFEMRegistrationFilter.h. |
|
Definition at line 150 of file itkFEMRegistrationFilter.h. |
|
Definition at line 159 of file itkFEMRegistrationFilter.h. |
|
Definition at line 160 of file itkFEMRegistrationFilter.h. |
|
Definition at line 140 of file itkFEMRegistrationFilter.h. |
|
Re-size the vector field (smaller to larger). Definition at line 437 of file itkFEMRegistrationFilter.h. |
|
Definition at line 135 of file itkFEMRegistrationFilter.h. Referenced by itk::fem::FEMRegistrationFilter< TMovingImage, TFixedImage >::GetDeformationField(). |
|
Definition at line 117 of file itkFEMRegistrationFilter.h. Referenced by itk::fem::FEMRegistrationFilter< TMovingImage, TFixedImage >::GetFixedImage(), and itk::fem::FEMRegistrationFilter< TMovingImage, TFixedImage >::GetWarpedImage(). |
|
Definition at line 163 of file itkFEMRegistrationFilter.h. |
|
|
Definition at line 139 of file itkFEMRegistrationFilter.h. |
|
Definition at line 125 of file itkFEMRegistrationFilter.h. Referenced by itk::fem::FEMRegistrationFilter< TMovingImage, TFixedImage >::GetJacobianImage(). |
|
Definition at line 138 of file itkFEMRegistrationFilter.h. |
|
Instantiate the load class with the correct image type. Definition at line 171 of file itkFEMRegistrationFilter.h. |
|
Definition at line 119 of file itkFEMRegistrationFilter.h. Referenced by itk::fem::FEMRegistrationFilter< TMovingImage, TFixedImage >::SetConfigFileName(). |
|
Definition at line 141 of file itkFEMRegistrationFilter.h. |
|
Definition at line 148 of file itkFEMRegistrationFilter.h. |
|
Definition at line 147 of file itkFEMRegistrationFilter.h. |
|
Definition at line 133 of file itkFEMRegistrationFilter.h. |
|
Definition at line 126 of file itkFEMRegistrationFilter.h. |
|
Definition at line 130 of file itkFEMRegistrationFilter.h. |
|
Definition at line 137 of file itkFEMRegistrationFilter.h. |
|
Definition at line 172 of file itkFEMRegistrationFilter.h. |
|
Definition at line 174 of file itkFEMRegistrationFilter.h. Referenced by itk::fem::FEMRegistrationFilter< TMovingImage, TFixedImage >::GetImageSize(). |
|
Definition at line 116 of file itkFEMRegistrationFilter.h. Referenced by itk::fem::FEMRegistrationFilter< TMovingImage, TFixedImage >::GetMovingImage(), and itk::fem::FEMRegistrationFilter< TMovingImage, TFixedImage >::GetOriginalMovingImage(). |
|
Definition at line 118 of file itkFEMRegistrationFilter.h. |
|
Reimplemented from itk::ImageToImageFilter< TMovingImage, TFixedImage >. Definition at line 107 of file itkFEMRegistrationFilter.h. |
|
Standard class typedefs. Reimplemented from itk::ImageToImageFilter< TMovingImage, TFixedImage >. Definition at line 105 of file itkFEMRegistrationFilter.h. |
|
Definition at line 127 of file itkFEMRegistrationFilter.h. Referenced by itk::fem::FEMRegistrationFilter< TMovingImage, TFixedImage >::UseLandmarks(). |
|
Reimplemented from itk::ImageToImageFilter< TMovingImage, TFixedImage >. Definition at line 106 of file itkFEMRegistrationFilter.h. |
|
Definition at line 134 of file itkFEMRegistrationFilter.h. |
|
Definition at line 136 of file itkFEMRegistrationFilter.h. |
|
Definition at line 128 of file itkFEMRegistrationFilter.h. |
|
de/constructor |
|
de/constructor |
|
The image loads are entered into the solver. |
|
The non-image loads are entered into the solver. |
|
Choose the metric by parameter : 0= mean squares, 1=cross correlation, 2=pattern intensity, 3 = mutual information. |
|
Compute the jacobian of the current deformation field. |
|
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 338 of file itkFEMRegistrationFilter.h. |
|
Sets the use of multi-resolution strategy. The control file always uses multi-res. Definition at line 342 of file itkFEMRegistrationFilter.h. |
|
Sets the use of multi-resolution strategy. The control file always uses multi-res. Definition at line 345 of file itkFEMRegistrationFilter.h. |
|
We check the jacobian of the current deformation field. If it is < threshold, we begin diffeomorphism enforcement: 1) Warp the moving image. 2) Set the vector field to zero. 3) Set the warped moving image as the new moving image, resizing if necessary. |
|
Evaluates the image similarity energy by calling the image metric |
|
|
|
Re-size the vector field (smaller to larger). |
|
|
|
Run-time type information (and related methods) Reimplemented from itk::ImageToImageFilter< TMovingImage, TFixedImage >.
|
|
Definition at line 360 of file itkFEMRegistrationFilter.h. |
|
Outputs the FE deformation field interpolated over the entire image domain. Definition at line 238 of file itkFEMRegistrationFilter.h. References itk::fem::FEMRegistrationFilter< TMovingImage, TFixedImage >::FieldType. |
|
Gets the stiffness Matrix weight. Definition at line 323 of file itkFEMRegistrationFilter.h. References itk::fem::FEMRegistrationFilter< TMovingImage, TFixedImage >::Float. |
|
Definition at line 209 of file itkFEMRegistrationFilter.h. |
|
Definition at line 223 of file itkFEMRegistrationFilter.h. References itk::fem::FEMRegistrationFilter< TMovingImage, TFixedImage >::FixedImageType. |
|
Definition at line 362 of file itkFEMRegistrationFilter.h. References itk::fem::FEMRegistrationFilter< TMovingImage, TFixedImage >::MetricBaseTypePointer. |
|
Get a pointer to the interpolator function. |
|
Get the image that gives the jacobian of the deformation field. Definition at line 234 of file itkFEMRegistrationFilter.h. References itk::fem::FEMRegistrationFilter< TMovingImage, TFixedImage >::FloatImageType. |
|
Set the solver's current load. |
|
Set/Get the Metric. Definition at line 365 of file itkFEMRegistrationFilter.h. |
|
Calculates the metric over the domain given the vector field. |
|
Definition at line 205 of file itkFEMRegistrationFilter.h. |
|
Definition at line 220 of file itkFEMRegistrationFilter.h. References itk::fem::FEMRegistrationFilter< TMovingImage, TFixedImage >::MovingImageType. |
|
Definition at line 221 of file itkFEMRegistrationFilter.h. References itk::fem::FEMRegistrationFilter< TMovingImage, TFixedImage >::MovingImageType. |
|
Definition at line 274 of file itkFEMRegistrationFilter.h. |
|
Get the reference image warped to the target image. Must first apply the warp using WarpImage() Definition at line 228 of file itkFEMRegistrationFilter.h. References itk::fem::FEMRegistrationFilter< TMovingImage, TFixedImage >::FixedImageType. |
|
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.
|
|
Sets the boolean for writing the displacement field to a file. Definition at line 354 of file itkFEMRegistrationFilter.h. |
|
Finds the optimum value between the last two solutions and sets the current solution to that value. Uses Evaluate Residual; |
|
Interpolates the vector field over the domain. Our convention is to always keep the vector field at the scale of the original images. |
|
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::Object.
|
|
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< TMovingImage, TFixedImage >.
|
|
|
|
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 313 of file itkFEMRegistrationFilter.h. References itk::fem::FEMRegistrationFilter< TMovingImage, TFixedImage >::Float. |
|
Sets the file name for the FEM multi-resolution registration. One can also set the parameters in code. Definition at line 358 of file itkFEMRegistrationFilter.h. References itk::fem::FEMRegistrationFilter< TMovingImage, TFixedImage >::ImageSizeType. |
|
Sets the FE deformation field. Definition at line 241 of file itkFEMRegistrationFilter.h. |
|
Tries to maximize energy Definition at line 335 of file itkFEMRegistrationFilter.h. |
|
Tries to minimize energy Definition at line 332 of file itkFEMRegistrationFilter.h. |
|
Sets the filename for the vector field component images. Definition at line 277 of file itkFEMRegistrationFilter.h. |
|
Sets the stiffness Matrix weight. Definition at line 320 of file itkFEMRegistrationFilter.h. References itk::fem::FEMRegistrationFilter< TMovingImage, TFixedImage >::Float. |
|
This function allows one to set the element and its material externally. Definition at line 374 of file itkFEMRegistrationFilter.h. |
|
Sets the energy below which we decide the solution has converged. Definition at line 317 of file itkFEMRegistrationFilter.h. References itk::fem::FEMRegistrationFilter< TMovingImage, TFixedImage >::Float. |
|
Definition at line 207 of file itkFEMRegistrationFilter.h. |
|
Define the target (fixed) image. |
|
Image similarity energy weight Definition at line 329 of file itkFEMRegistrationFilter.h. |
|
Set the interpolator function. |
|
These functions control the use of landmark constraints. Currently, landmarks must be read in from a file. Definition at line 250 of file itkFEMRegistrationFilter.h. |
|
This sets the line search's max iterations. Definition at line 348 of file itkFEMRegistrationFilter.h. |
|
This sets the pointer to the material. Definition at line 377 of file itkFEMRegistrationFilter.h. |
|
Setting the maximum iterations stops the solution after i iterations regardless of energy.
References itk::fem::FEMRegistrationFilter< TMovingImage, TFixedImage >::Float. |
|
Definition at line 382 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 pixels per element in each dimension in the 1st resolution, use SetMeshResolution(10,0);. Definition at line 285 of file itkFEMRegistrationFilter.h. |
|
Set/Get the Metric. Definition at line 366 of file itkFEMRegistrationFilter.h. References itk::fem::Element::Pointer. |
|
One can set the reference file names to read images from files Definition at line 203 of file itkFEMRegistrationFilter.h. |
|
Define the reference (moving) image. |
|
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 291 of file itkFEMRegistrationFilter.h. |
|
Definition at line 381 of file itkFEMRegistrationFilter.h. |
|
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 270 of file itkFEMRegistrationFilter.h. |
|
Definition at line 272 of file itkFEMRegistrationFilter.h. |
|
Mass matrix weight Definition at line 326 of file itkFEMRegistrationFilter.h. |
|
Definition at line 384 of file itkFEMRegistrationFilter.h. References itk::fem::FEMOF. |
|
Setting the time step - usually 1.0. We prefer to use rho to control step sizes. Definition at line 310 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.
|
|
Sets the boolean for writing the displacement field to a file. Definition at line 351 of file itkFEMRegistrationFilter.h. |
|
This determines if the landmark file will be read Definition at line 253 of file itkFEMRegistrationFilter.h. References itk::fem::FEMRegistrationFilter< TMovingImage, TFixedImage >::SolverType. |
|
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. |