Introducing a new way to review your PRs.

Read the announcement

insightsoftwareconsortium / itk

Insight Toolkit (ITK) -- Official Repository. ITK builds on a proven, spatially-oriented architecture for processing, segmentation, and registration of scientific images in two, three, or more dimensions.

View on GitHub

19 documents · Updated Nov 23, 2026

docs / registration-framework

Registration framework

The registration framework aligns a fixed object with a moving object by changing a geometric transform until a metric reports a good match. It supports images, point sets, landmarks, global transforms, and deformable fields. The result is a transform or field that downstream resampling and geometric analysis can use.

Registration problem

Fixed and moving objects

Registration uses the fixed object as the reference space. It maps the moving object into that space through a transform. A metric measures the match, while an optimizer searches for better transform parameters. Image registration also uses an interpolator because transformed points usually fall between image samples. Modules/…/itkImageRegistrationMethod.h• L29-59 Modules/…/itkImageToImageMetric.h• L41-46

The same model applies to geometric data. Point-set registration compares a fixed point set with a transformed moving point set. Point-set-to-image registration uses geometric points to query image values. Modules/…/itkPointSetToPointSetRegistrationMethod.h• L28-60 Modules/…/itkPointSetToImageRegistrationMethod.h• L29-61

References: Modules/…/itkImageRegistrationMethod.h• L29-59 Modules/…/itkPointSetToPointSetRegistrationMethod.h• L28-60 Modules/…/itkPointSetToImageRegistrationMethod.h• L29-61

Registration components

The framework separates the match measure from the search method and the spatial model. This lets one workflow select components that fit its data and motion type.

ComponentPurpose
MetricMeasures agreement and can provide a derivative.
OptimizerChooses new transform parameters from the metric result.
TransformMaps points between spaces.
InterpolatorSupplies moving-image values at mapped points.
Registration methodConnects the data and components and returns the result.

The older common path and the v4 path use different metric and optimizer contracts. The common path uses the earlier families. The v4 path uses Metricsv4 with Optimizersv4. Modules/Registration/Metricsv4/itk-module.cmake#L1-L15 Modules/Numerics/Optimizersv4/itk-module.cmake#L1-L24

References: Modules/…/itkImageRegistrationMethod.h• L95-155 Modules/…/itkObjectToObjectOptimizerBase.h• L60-105 Modules/…/itk-module.cmake• L1-15 Modules/…/itk-module.cmake• L1-24

Registration pipeline

Component connections

The registration method sends fixed and moving data to a metric. The metric uses the current transform and interpolator to evaluate alignment. The optimizer changes the transform parameters. The method publishes the final transform. Modules/Registration/Common/include/itkImageRegistrationMethod.hxx#L114-L207 Modules/…/itkObjectToObjectOptimizerBase.h• L64-73

The v4 method can refine an initial transform or a composite transform. It uses a virtual domain as the shared physical space for metric evaluation. This supports staged registration in which a later stage improves an earlier result. Modules/…/itkImageRegistrationMethodv4.h• L62-105 Modules/…/itkImageRegistrationMethodv4.h• L260-376

The diagram shows how registration changes the geometric model instead of changing the source images.

flowchart LR
    F[Fixed image or geometry] --> M[Metric]
    G[Moving image or geometry] --> I[Interpolator or geometric query]
    T[Transform parameters] --> M
    T --> I
    M --> O[Optimizer]
    O --> T
    T --> R[Updated transform]

References: Modules/…/itkImageRegistrationMethod.hxx• L114-207 Modules/…/itkImageRegistrationMethodv4.h• L62-105 Modules/…/itkImageRegistrationMethodv4.h• L260-376 Modules/…/itkObjectToObjectOptimizerBase.h• L64-73

Transform direction

Image-to-image registration normally uses a transform that maps fixed-space points to moving-space points for metric sampling. Resampling then uses the resulting mapping to place moving image values in fixed space. Modules/…/itkImageRegistrationMethod.h• L49-59 Modules/…/itkImageToImageMetric.h• L41-46

Image-to-spatial-object registration uses a different direction. Its transform maps the moving spatial object into the fixed image. A caller must therefore confirm the direction for the selected method before using its output. Modules/…/itkImageToSpatialObjectRegistrationMethod.h• L49-75

Projection registration adds a projective interpolator for three-dimensional images. It samples the image along rays from a source and integrates voxels above a threshold, so its transform and camera geometry must agree with the projection setup. Modules/…/itkSiddonJacobsRayCastInterpolateImageFunction.h• L46-54 Modules/…/itkSiddonJacobsRayCastInterpolateImageFunction.h• L150-168

References: Modules/…/itkImageRegistrationMethod.h• L49-59 Modules/…/itkImageToImageMetric.h• L41-46 Modules/…/itkImageToSpatialObjectRegistrationMethod.h• L49-75 Modules/…/itkSiddonJacobsRayCastInterpolateImageFunction.h• L46-54 Modules/…/itkSiddonJacobsRayCastInterpolateImageFunction.h• L150-168

Similarity metrics

Image metrics

Image metrics compare image values at matching physical locations. The image metric family supports masks, regions, gradients, and dense or sampled evaluation. The common metric path can use all pixels, sequential samples, random samples, or explicit fixed-image indexes. Modules/…/itkImageToImageMetric.h• L117-133 Modules/…/itkImageToImageMetric.h• L252-329 Modules/…/itkImageToImageMetricv4.h• L37-59

Common choices measure intensity difference, correlation, or intensity distributions. Mean squares suits a direct intensity relation. Mutual information suits data with a less direct intensity relation. Mattes mutual information uses sampled intensity distributions. ANTS neighborhood correlation measures local agreement. Each choice needs valid overlap and enough image variation to guide the search. Modules/…/itkMeanSquaresImageToImageMetricv4.h• L28-47 Modules/…/itkMattesMutualInformationImageToImageMetricv4.h• L33-66 Modules/…/itkANTSNeighborhoodCorrelationImageToImageMetricv4GetValueAndDerivativeThreader.h• L45-55

The v4 image metric evaluates virtual-domain samples in parallel. It supports both image-region domains and indexed point domains. This lets dense image metrics and sparse local-support metrics use the same value-and-derivative contract. Modules/…/itkImageToImageMetricv4GetValueAndDerivativeThreader.h• L29-40 Modules/…/itkImageToImageMetricv4GetValueAndDerivativeThreader.h• L101-108 Modules/…/itkImageToImageMetricv4GetValueAndDerivativeThreader.h• L178-185

The Mattes metric also supplies derivatives for parameter updates. Its derivative checks must use a perturbation that is large enough for the active physical-coordinate precision. The metric test scales that perturbation for SpacePrecisionType, which keeps the check useful in lower-precision geometry builds. Modules/Registration/Metricsv4/test/itkMattesMutualInformationImageToImageMetricv4Test.cxx#L340-L365

References: Modules/…/itkImageToImageMetric.h• L117-133 Modules/…/itkImageToImageMetric.h• L252-329 Modules/…/itkImageToImageMetricv4.h• L37-59 Modules/…/itkImageToImageMetricv4.h• L85-109 Modules/…/itkImageToImageMetricv4GetValueAndDerivativeThreader.h• L29-40 Modules/…/itkImageToImageMetricv4GetValueAndDerivativeThreader.h• L101-108 Modules/…/itkImageToImageMetricv4GetValueAndDerivativeThreader.h• L178-185 Modules/…/itkMeanSquaresImageToImageMetricv4.h• L28-47 Modules/…/itkMattesMutualInformationImageToImageMetricv4.h• L33-66 Modules/…/itkANTSNeighborhoodCorrelationImageToImageMetricv4GetValueAndDerivativeThreader.h• L45-55 Modules/…/itkMattesMutualInformationImageToImageMetricv4Test.cxx• L340-365

Geometric metrics

Point-set metrics align physical points without a dense image comparison. A virtual domain gives v4 metrics a shared space for image and point samples. Distance thresholds can limit which point pairs contribute to a value and its derivative. Modules/…/itkPointSetToPointSetMetricv4.h• L25-60 Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricTest3.cxx#L112-L198

Labeled point-set metrics keep points with different integer labels in separate groups. They match common labels and combine the result from each group. A label therefore describes a correspondence group. It does not act as a numeric distance between features. Modules/…/itkLabeledPointSetToPointSetMetricv4.h• L27-46

References: Modules/…/itkPointSetToPointSetMetricv4.h• L25-60 Modules/…/itkEuclideanDistancePointSetMetricTest3.cxx• L112-198 Modules/…/itkLabeledPointSetToPointSetMetricv4.h• L27-46

Metric combinations

Several metrics can form one weighted metric when one source of evidence is not enough. The combined metric produces one value and one derivative for the shared transform. This lets one stage use complementary image and point-set evidence. Modules/…/itkObjectToObjectMultiMetricv4.h• L28-88

All component metrics must evaluate the same transform parameters. The shared virtual domain must also describe the space in which their samples can be compared. Modules/…/itkObjectToObjectMultiMetricv4.h• L55-88

References: Modules/…/itkObjectToObjectMultiMetricv4.h• L28-88

Frequency and block evidence

Phase correlation estimates image translation from frequency-domain correlation peaks. It can crop to the overlap, pad the inputs, suppress a trivial zero peak, merge nearby peaks, and refine peak positions. The result includes one or more translation candidates and the correlation image used to assess them. Modules/Registration/Montage/include/itkPhaseCorrelationImageRegistrationMethod.hxx#L141-L205 Modules/Registration/Montage/include/itkPhaseCorrelationImageRegistrationMethod.hxx#L238-L385 Modules/Registration/Montage/include/itkPhaseCorrelationOptimizer.hxx#L287-L347 Modules/Registration/Montage/include/itkPhaseCorrelationOptimizer.hxx#L434-L609

Block matching supplies sparse local motion evidence around selected feature points. It searches a moving-image neighborhood for the block with the best local intensity agreement. It returns a displacement and a similarity score for each input point, so a later non-rigid method can use this evidence instead of a dense image-wide metric. Feature points must leave enough room for both the compared block and the search window. Modules/…/itkBlockMatchingImageFilter.h• L31-56 Modules/Registration/Common/include/itkBlockMatchingImageFilter.hxx#L286-L367

References: Modules/…/itkPhaseCorrelationImageRegistrationMethod.hxx• L141-205 Modules/…/itkPhaseCorrelationImageRegistrationMethod.hxx• L238-385 Modules/…/itkPhaseCorrelationOptimizer.hxx• L287-347 Modules/…/itkPhaseCorrelationOptimizer.hxx• L434-609 Modules/…/itkBlockMatchingImageFilter.h• L31-56 Modules/…/itkBlockMatchingImageFilter.hxx• L286-367

Transform models

Global transforms

Global transforms describe one motion model for the full domain. Translation, rigid, similarity, and affine models change position, orientation, scale, or linear shape with a small parameter set. The common transform interface gives metrics and optimizers a shared way to map points and update parameters. Modules/…/itkTransform.h• L33-58 Modules/…/itkTransform.h• L378-400

Global models suit differences that one shared motion can explain. They also provide a useful first stage before local deformation. CompositeTransform keeps earlier stages in the full mapping while a later stage changes only its own parameters. Modules/…/itkCompositeTransform.h• L28-71

References: Modules/…/itkTransform.h• L33-58 Modules/…/itkTransform.h• L378-400 Modules/…/itkCompositeTransform.h• L28-71

Local transforms

Local transforms let different parts of the domain move in different ways. A B-spline transform uses a control-point grid to produce a smooth deformation. Its physical domain and mesh size control where the field is valid and how much detail it can represent. Modules/…/itkBSplineTransform.h• L25-55 Modules/…/itkBSplineBaseTransform.h• L91-107

The current BSplineTransform is the preferred model. BSplineDeformableTransform remains a compatible model and can add a bulk transform. The transform can expose the same coefficients as optimizer parameters or as coefficient images. Points outside valid spline support receive no local contribution. Modules/…/itkBSplineTransform.h• L79-95 Modules/…/itkBSplineDeformableTransform.h• L25-49 Modules/Core/Transform/include/itkBSplineBaseTransform.hxx#L203-L243

Time-varying B-spline velocity transforms use a space-time control-point lattice. At each resolution level, an adaptor changes the lattice domain and resamples the existing coefficients before integrating the velocity field. This carries a smooth motion model from coarse levels to finer levels. Modules/Registration/Common/include/itkTimeVaryingBSplineVelocityFieldTransformParametersAdaptor.hxx#L123-L179 Modules/Registration/Common/include/itkTimeVaryingBSplineVelocityFieldTransformParametersAdaptor.hxx#L239-L334

References: Modules/…/itkBSplineTransform.h• L25-55 Modules/…/itkBSplineTransform.h• L79-95 Modules/…/itkBSplineDeformableTransform.h• L25-49 Modules/…/itkBSplineBaseTransform.hxx• L203-243 Modules/…/itkTimeVaryingBSplineVelocityFieldTransformParametersAdaptor.hxx• L123-179 Modules/…/itkTimeVaryingBSplineVelocityFieldTransformParametersAdaptor.hxx• L239-334

Transform composition

CompositeTransform applies a sequence of transforms as one mapping. A workflow can keep a global stage fixed and optimize a later local stage. This preserves the earlier alignment while adding finer motion. Modules/…/itkCompositeTransform.h• L28-71

References: Modules/…/itkCompositeTransform.h• L28-71

Sampling and resolution

Metric sampling

Sampling reduces the number of points used for metric evaluation. The v4 method supports no sampling, regular sampling, and random sampling. The sampling rate can change at each resolution level. A fixed random seed can make random samples repeatable. Modules/…/itkImageRegistrationMethodv4.h• L39-60 Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.hxx#L872-L1030

The virtual image describes sampling geometry. It does not need an allocated pixel buffer. Dense metrics walk its indices. Sparse metrics use sampled physical points. This keeps the virtual domain separate from image storage. Modules/Registration/Metricsv4/include/itkImageToImageMetricv4GetValueAndDerivativeThreader.hxx#L29-L67 Modules/Registration/RegistrationMethodsv4/test/itkImageRegistrationMethodv4VirtualDomainGTest.cxx#L34-L72

Parameter-scale estimation has its own domain sampling choices. These choices affect how the optimizer compares parameter effects. Modules/…/itkRegistrationParameterScalesEstimator.h• L32-73

References: Modules/…/itkImageRegistrationMethodv4.h• L39-60 Modules/…/itkImageRegistrationMethodv4.hxx• L872-1030 Modules/…/itkImageToImageMetricv4GetValueAndDerivativeThreader.hxx• L29-67 Modules/…/itkImageToImageMetricv4GetValueAndDerivativeThreader.h• L101-108 Modules/…/itkImageToImageMetricv4GetValueAndDerivativeThreader.h• L178-185 Modules/…/itkImageRegistrationMethodv4VirtualDomainGTest.cxx• L34-72 Modules/…/itkRegistrationParameterScalesEstimator.h• L32-73

Multi-resolution levels

Multi-resolution registration starts with coarse images or virtual domains and moves to finer levels. Each level can set image shrink factors, smoothing, metric sampling, and transform adaptation. Coarse levels reduce the effect of small structures during the first search. Modules/…/itkImageRegistrationMethodv4.h• L386-461

Image pyramids smooth before downsampling and provide one image for each level. Transform parameter adaptors carry the current result to the next level when the transform gains more freedom. Modules/…/itkMultiResolutionPyramidImageFilter.h• L26-101 Modules/…/itkTransformParametersAdaptor.h• L26-45

The time-varying B-spline registration method repeats this process over levels. It obtains metric derivatives at sampled time points, fits them to the space-time control lattice, updates the velocity model, and integrates it to produce forward and inverse displacement fields. It supports image metrics and point-set metrics in this loop. Modules/Registration/RegistrationMethodsv4/include/itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx#L62-L170 Modules/Registration/RegistrationMethodsv4/include/itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx#L338-L591 Modules/Registration/RegistrationMethodsv4/include/itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx#L820-L841

References: Modules/…/itkImageRegistrationMethodv4.h• L386-461 Modules/…/itkMultiResolutionPyramidImageFilter.h• L26-101 Modules/…/itkTransformParametersAdaptor.h• L26-45 Modules/…/itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx• L62-170 Modules/…/itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx• L338-591 Modules/…/itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx• L820-841

Numerical optimization

An optimizer treats transform parameters as a search position. It receives a metric value and sometimes a derivative. It changes the position until a stop condition is met. The framework provides gradient, line-search, quasi-Newton, evolutionary, exhaustive, and other search families. Modules/…/itkObjectToObjectOptimizerBase.h• L38-73 Modules/…/itkOptimizer.h• L27-52

The optimizer choice must fit the metric derivative, transform size, and shape of the search problem. The metric owns the transform update path, so the optimizer does not need to know the concrete transform model. Modules/…/itkObjectToObjectOptimizerBase.h• L64-73

References: Modules/…/itkObjectToObjectOptimizerBase.h• L38-73 Modules/…/itkOptimizer.h• L27-52

Parameter scales and weights

Parameter scales make updates comparable when parameters have different units or effects. The framework can use supplied scales or estimate them from the metric and sampled domain. Weights are separate. They reduce or remove selected parameter updates. Modules/…/itkObjectToObjectOptimizerBase.h• L75-103 Modules/…/itkRegistrationParameterScalesEstimator.h• L57-73

For local transforms, scales and weights describe repeated local parameter groups. This keeps updates useful when a field has many parameters. Modules/…/itkObjectToObjectOptimizerBase.h• L75-103

References: Modules/…/itkObjectToObjectOptimizerBase.h• L75-103 Modules/…/itkRegistrationParameterScalesEstimator.h• L57-73

Landmark and geometric alignment

Landmark initialization

Modules/…/itkLandmarkBasedTransformInitializer.h computes an initial transform from paired fixed and moving landmarks. It fits the selected model in a least-squares sense. Affine and B-spline models can use landmark weights. Supported models include rigid, similarity, affine, and B-spline transforms. Modules/…/itkLandmarkBasedTransformInitializer.h• L36-65

The initializer can produce a direct landmark alignment or a starting point for a later metric-based search. Landmark lists must have equal length and matching order. The transform model determines the minimum number of pairs needed for a useful fit. Modules/…/itkLandmarkBasedTransformInitializer.h• L45-65

References: Modules/…/itkLandmarkBasedTransformInitializer.h• L36-65

Landmark robustness

Feature descriptors turn local point geometry into values that can help form correspondences. Robust landmark fitting can then reduce the effect of wrong pairs. RANSAC tests transforms from small subsets, keeps pairs that agree with a distance rule, and refits the best model from its consensus set. Modules/…/itkPointFeature.h• L27-35 Modules/…/itkRANSAC.h• L34-46 Modules/…/itkLandmarkRegistrationEstimator.h• L32-91

The flow below shows how paired points become a transform while outliers are excluded.

flowchart LR
    P[Paired landmarks] --> S[Candidate subsets]
    S --> E[Candidate transform]
    E --> A[Agreement and outlier checks]
    A --> B[Best consensus set]
    B --> L[Least-squares refit]
    L --> T[Landmark transform]

References: Modules/…/itkRANSAC.h• L34-46 Modules/…/itkRANSAC.hxx• L137-201 Modules/…/itkParametersEstimator.h• L30-114 Modules/…/itkLandmarkRegistrationEstimator.h• L32-91

Point-set workflows

Point-set registration uses a metric and optimizer to align physical points. Point-set-to-image registration uses point evidence to sample a moving image. These workflows use the same transform-and-search model as image registration without requiring a dense image comparison. Modules/…/itkPointSetToPointSetRegistrationMethod.h• L28-60 Modules/…/itkPointSetToImageRegistrationMethod.h• L29-61

The v4 method can combine image and point-set metrics. A shared virtual domain makes their samples comparable when the transform has local support. Modules/…/itkImageRegistrationMethodv4.h• L164-176 Modules/…/itkObjectToObjectMultiMetricv4.h• L70-88

References: Modules/…/itkPointSetToPointSetRegistrationMethod.h• L28-60 Modules/…/itkPointSetToImageRegistrationMethod.h• L29-61 Modules/…/itkImageRegistrationMethodv4.h• L164-176 Modules/…/itkObjectToObjectMultiMetricv4.h• L70-88

Deformable registration

Displacement-field methods

PDE deformable registration represents motion as a displacement field. Each iteration uses local image evidence to compute a field update. A regularizer smooths or constrains that update so the field does not develop unstable local motion. Modules/…/itkPDEDeformableRegistrationFilter.h• L27-66

Demons forces are one intensity-difference family. Their gradient choice can use the fixed image, the warped moving image, or both. Diffeomorphic variants use velocity-field updates and field exponentiation to aim for a smooth one-to-one mapping. Modules/…/itkVariationalRegistrationDemonsFunction.h• L27-41 Modules/…/itkVariationalDiffeomorphicRegistrationFilter.h• L28-51

The PDE curvature method is a separate fast field update path. It applies curvature smoothing to the updated displacement field through a cosine transform and is available only when the required double-precision FFTW real-to-real support is built. Modules/…/itkCurvatureRegistrationFilter.h• L24-29 Modules/…/itkCurvatureRegistrationFilter.h• L32-80 Modules/Registration/PDEDeformable/include/itkCurvatureRegistrationFilter.hxx#L200-L274

References: Modules/…/itkPDEDeformableRegistrationFilter.h• L27-66 Modules/…/itkVariationalRegistrationDemonsFunction.h• L27-41 Modules/…/itkVariationalDiffeomorphicRegistrationFilter.h• L28-51 Modules/…/itkCurvatureRegistrationFilter.h• L24-29 Modules/…/itkCurvatureRegistrationFilter.h• L32-80 Modules/…/itkCurvatureRegistrationFilter.hxx• L200-274

Variational model

The variational framework separates image evidence from the motion prior. A force function computes an update from the fixed image and the warped moving image. A regularizer changes that update into a smoother field. The filter repeats this process until a stop rule or iteration limit is reached. Modules/…/itkVariationalRegistrationFilter.h• L31-73 Modules/…/itkVariationalRegistrationFunction.h• L29-39 Modules/…/itkVariationalRegistrationRegularizer.h• L27-35

The framework includes squared-difference, demons, and normalized cross-correlation force families. The normalized cross-correlation variants use local neighborhoods and can select fixed, warped, or symmetric gradients. This lets the image relation and the motion prior vary independently. Modules/…/itkVariationalRegistrationSSDFunction.h• L28-38 Modules/…/itkVariationalRegistrationNCCFunction.h• L30-50 Modules/…/itkVariationalRegistrationFastNCCFunction.h• L30-50

References: Modules/…/itkVariationalRegistrationFilter.h• L31-73 Modules/…/itkVariationalRegistrationFunction.h• L29-39 Modules/…/itkVariationalRegistrationRegularizer.h• L27-35 Modules/…/itkVariationalRegistrationSSDFunction.h• L28-38 Modules/…/itkVariationalRegistrationNCCFunction.h• L30-50 Modules/…/itkVariationalRegistrationFastNCCFunction.h• L30-50

Field regularizers

Regularizers define the motion prior for a displacement field. Gaussian and diffusion choices provide smooth fields. Elastic regularization also couples vector components. Curvature regularization suppresses rapid field changes. All regularizers can account for image spacing when the field represents physical motion. Modules/…/itkVariationalRegistrationRegularizer.h• L27-38 Modules/…/itkVariationalRegistrationGaussianRegularizer.h• L26-36 Modules/…/itkVariationalRegistrationDiffusionRegularizer.h• L26-37 Modules/…/itkVariationalRegistrationElasticRegularizer.h• L35-53 Modules/…/itkVariationalRegistrationCurvatureRegularizer.h• L33-51

Elastic and curvature regularizers use frequency-domain smoothing. They use FFTW when the build provides it and use pocketfft otherwise. Curvature regularization uses a discrete cosine transform, while elastic regularization uses a real-to-complex transform and solves a coupled system for each frequency. The public choices remain available across supported dimensions, but elastic regularization is limited to two and three dimensions. Modules/Registration/VariationalRegistration/include/itkVariationalRegistrationElasticRegularizer.hxx#L174-L338 Modules/Registration/VariationalRegistration/include/itkVariationalRegistrationElasticRegularizer.hxx#L477-L690 Modules/…/itkVariationalRegistrationCurvatureRegularizer.h• L92-101 Modules/Registration/VariationalRegistration/include/itkVariationalRegistrationCurvatureRegularizer.hxx#L174-L318 Modules/Registration/VariationalRegistration/include/itkVariationalRegistrationCurvatureRegularizer.hxx#L369-L440

References: Modules/…/itkVariationalRegistrationRegularizer.h• L27-38 Modules/…/itkVariationalRegistrationGaussianRegularizer.h• L26-36 Modules/…/itkVariationalRegistrationDiffusionRegularizer.h• L26-37 Modules/…/itkVariationalRegistrationElasticRegularizer.h• L35-53 Modules/…/itkVariationalRegistrationCurvatureRegularizer.h• L33-51 Modules/…/itkVariationalRegistrationElasticRegularizer.hxx• L174-338 Modules/…/itkVariationalRegistrationElasticRegularizer.hxx• L477-690 Modules/…/itkVariationalRegistrationCurvatureRegularizer.h• L92-101 Modules/…/itkVariationalRegistrationCurvatureRegularizer.hxx• L174-318 Modules/…/itkVariationalRegistrationCurvatureRegularizer.hxx• L369-440

Variational multi-resolution

The variational multi-resolution filter registers image pyramids from coarse to fine. It expands the current field between levels and can carry either a displacement field or a velocity field. This gives the same variational model a coarse-to-fine search. Modules/…/itkVariationalRegistrationMultiResolutionFilter.h• L29-61

The command-line entry point assembles the input images, optional mask and initial field, force family, regularizer, search space, and outputs. It supports standard, diffeomorphic, and symmetric diffeomorphic searches. It can write a displacement field, a velocity field for diffeomorphic searches, and a warped image. Modules/Registration/VariationalRegistration/src/VariationalRegistrationMain.cxx#L113-L184 Modules/Registration/VariationalRegistration/src/VariationalRegistrationMain.cxx#L801-L982

The framework tests both single-level and coarse-to-fine registration by checking that the warped image agrees with the fixed image and that missing required input fails. The test matrix also covers image forces, regularizers, and standard or diffeomorphic field modes in two and three dimensions. Modules/Registration/VariationalRegistration/test/itkVariationalRegistrationFilterTest.cxx#L142-L225 Modules/Registration/VariationalRegistration/test/itkVariationalRegistrationMultiResolutionFilterTest.cxx#L142-L241 Modules/…/CMakeLists.txt• L42-53 Modules/…/CMakeLists.txt• L124-152 Modules/…/CMakeLists.txt• L223-251

References: Modules/…/itkVariationalRegistrationMultiResolutionFilter.h• L29-61 Modules/…/VariationalRegistrationMain.cxx• L113-184 Modules/…/VariationalRegistrationMain.cxx• L801-982 Modules/…/itkVariationalRegistrationFilterTest.cxx• L142-225 Modules/…/itkVariationalRegistrationMultiResolutionFilterTest.cxx• L142-241 Modules/…/CMakeLists.txt• L42-53 Modules/…/CMakeLists.txt• L124-152 Modules/…/CMakeLists.txt• L223-251

Diffeomorphic fields

The variational diffeomorphic filter represents motion with a static velocity field. It exponentiates that field to form the displacement mapping. The symmetric variant computes forward and backward evidence and maintains an inverse field. Modules/…/itkVariationalDiffeomorphicRegistrationFilter.h• L28-53 Modules/…/itkVariationalSymmetricDiffeomorphicRegistrationFilter.h• L26-61

The v4 SyN method uses a shared middle space and keeps forward and inverse displacement fields. It uses the v4 metric, sampling, and multi-resolution contracts. Its update loop can combine image metrics, point-set metrics, masks, and multi-metric evidence. Modules/…/itkSyNImageRegistrationMethod.h• L31-54 Modules/Registration/RegistrationMethodsv4/test/itkSyNImageRegistrationMethodGTest.cxx#L172-L283

SyN must keep its derivative size and field state consistent when a metric supplies a replacement derivative buffer. Its tests also check that smoothing gives the same result across work-unit counts, that release-data settings do not change the result, and that lower-precision geometry uses an appropriate baseline tolerance. Modules/Registration/RegistrationMethodsv4/test/itkSyNImageRegistrationMethodGTest.cxx#L301-L405 Modules/Registration/RegistrationMethodsv4/test/itkSyNImageRegistrationMethodReleaseDataGTest.cxx#L151-L365 Modules/Registration/RegistrationMethodsv4/test/itkSyNImageRegistrationMethodReleaseDataGTest.cxx#L426-L453

References: Modules/…/itkVariationalDiffeomorphicRegistrationFilter.h• L28-53 Modules/…/itkVariationalSymmetricDiffeomorphicRegistrationFilter.h• L26-61 Modules/…/itkSyNImageRegistrationMethod.h• L31-54 Modules/…/itkSyNImageRegistrationMethodGTest.cxx• L172-283 Modules/…/itkSyNImageRegistrationMethodGTest.cxx• L301-405 Modules/…/itkSyNImageRegistrationMethodReleaseDataGTest.cxx• L151-365 Modules/…/itkSyNImageRegistrationMethodReleaseDataGTest.cxx• L426-453

Boundary and monitoring behavior

Variational force functions warp the moving image with continuous border behavior. A query outside the input buffer receives the nearest boundary value. This keeps field updates defined near image edges. Modules/…/itkContinuousBorderWarpImageFilter.h• L26-47 Modules/…/itkVariationalRegistrationFunction.h• L92-97

Observers provide progress and stopping behavior. The logger reports levels and metric values. The stop criterion can use repeated metric increases or a fitted metric trend. Its multi-resolution policies can apply stronger checks only at finer levels. Modules/…/itkVariationalRegistrationLogger.h• L27-37 Modules/…/itkVariationalRegistrationStopCriterion.h• L30-55 Modules/…/itkVariationalRegistrationStopCriterion.h• L193-238

References: Modules/…/itkContinuousBorderWarpImageFilter.h• L26-47 Modules/…/itkVariationalRegistrationFunction.h• L92-97 Modules/…/itkVariationalRegistrationLogger.h• L27-37 Modules/…/itkVariationalRegistrationStopCriterion.h• L30-55 Modules/…/itkVariationalRegistrationStopCriterion.h• L193-238

Registration method workflows

This page describes shared registration building blocks. For end-to-end choices and ordered method flows, see registration workflows.

Change checklist

When these files or sections are changed, remember to consider these:

  • Changes to metric or optimizer base classes must preserve the boundary between the older common framework and the v4 framework.
  • Changes to transform direction must be checked against image resampling, point-set metrics, projective ray sampling, and image-to-spatial-object registration because these workflows use different mapping conventions.
  • Changes to metric sampling must stay aligned with virtual-domain point sets, both v4 domain partitioners, and parameter-scale estimation for local-support transforms.
  • Changes to virtual-domain traversal must preserve physical-point mapping for allocated image domains and metadata-only virtual images.
  • Changes to multi-resolution levels must preserve the hand-off between image resolution, transform adaptors, metric sampling, and current transform parameters.
  • Changes to composite-transform optimization flags must keep applied transforms separate from transforms selected for parameter updates.
  • Changes to B-spline transform domains, mesh sizes, or coefficient representations must preserve the relationship between transform metadata, optimizer parameters, and serialized transforms.
  • Changes to time-varying B-spline domains must preserve the space-time lattice geometry, coefficient resampling, and velocity-field integration at every level.
  • Changes to landmark pairing or weights must preserve the correspondence and transform-model assumptions used by initialization.
  • Changes to robust landmark estimation must preserve the relation between candidate subsets, consensus selection, correspondence checks, and the final fit.
  • Changes to phase-correlation padding, peak selection, or cached FFTs must preserve common image geometry and the physical translation represented by each peak.
  • Changes to block-matching radii or feature-point checks must preserve valid fixed and moving neighborhoods and the one-to-one output point correspondence.
  • Changes to variational force terms or regularizers must preserve the displacement-field type, physical-spacing setting, and public parameter meaning.
  • Changes to FFT-backed regularizers must preserve equivalent field results across FFTW and pocketfft backends and across supported field dimensions.
  • Changes to the PDE curvature filter must preserve its FFTW-only build guard and its field-dimension assumptions.
  • Changes to variational stop policies must preserve observer events and the meaning of metric values at each resolution level.
  • Changes to SyN derivative handling or release-data behavior must preserve derivative size, replacement-buffer values, forward and inverse fields, interpolator inputs, and field boundary behavior.
  • Changes to renamed variational tests must keep their CMake test names and test-driver entries aligned.
  • Changes to lower-precision geometry must keep numerical checks scaled to the active SpacePrecisionType.

Important failure modes

TriggerConsequenceGuard
A common metric is paired with a v4 optimizer or a v4 metric is paired with an older optimizer.The registration cannot use the expected cost-function contract.Keep common components with the older optimizer family and v4 components with Metricsv4 and Optimizersv4.
Fixed and moving spaces use an inconsistent transform direction.The metric samples the wrong location or resampling uses the wrong mapping.Confirm the direction for the selected registration method before connecting the transform.
A projective ray sampler is used with non-3D data or mismatched camera geometry.Projection values do not represent the intended image path.Use three-dimensional input and configure the transform, source distance, and projection angle as one geometry.
A local metric uses a virtual domain that does not match the transform support.Samples or parameter-scale estimates become invalid or are omitted.Define a virtual domain that covers the usable field and its physical samples.
A metric assumes that the virtual image owns pixels.Valid samples are skipped or the run reads invalid storage.Treat the virtual image as geometry and traverse indices or sampled physical points.
A multi-metric set uses different transform parameter objects.The combined derivative does not describe one update.Make all component metrics evaluate the same optimized transform.
Phase-correlation inputs have incompatible spacing or direction.The translation estimate is rejected or has the wrong physical meaning.Match image spacing and direction before running the frequency search.
Block-matching points do not leave room for the block and search window.Neighborhood reads can leave the image region or produce invalid matches.Select interior feature points or enable boundary checks where supported.
Landmark counts or pair order do not match.The initial transform is under-constrained or maps the wrong features together.Supply equal, corresponding fixed and moving landmark lists.
A B-spline query falls outside valid interpolation support.The local deformation is omitted.Size the transform domain for sampled points and account for spline support at its boundaries.
A moving-image query falls outside the interpolator region.The metric cannot evaluate the current parameter position.Use valid overlap, masks, and bounds-aware interpolation.
A time-varying B-spline adaptor changes domain metadata without resampling the coefficient lattice.The next level starts with a motion field in the wrong space or with lost motion.Adapt the lattice and integrate the velocity field after each domain change.
A variational field has weak regularization or ignores physical spacing for anisotropic data.The field can contain unstable motion or a motion prior in the wrong units.Select a suitable regularizer and keep spacing use enabled for physical fields.
Elastic or curvature regularization has no usable transform backend or an unsupported field dimension.The selected regularizer cannot run.Use a supported dimension and build with FFTW or the pocketfft support used by the module.
A PDE curvature registration build lacks the required double-precision FFTW real-to-real support.The curvature filter is unavailable.Use a compatible FFTW build and do not select the filter under unsupported FFT backends.
A variational force, regularizer, or field has incompatible dimensions.The filter cannot connect its inputs or produce a valid update.Match image dimensions, vector components, and field dimensions.
A stop observer uses a policy inconsistent with the metric scale or level events.Registration stops too early, too late, or at the wrong level.Attach the observer to the correct events and choose a policy for the metric trend.
Release-data handling drops a field, metric adaptor input, or velocity-field interpolator input before a later step uses it.Results change when release-data flags are enabled.Keep required inputs alive through each update and verify release-data equivalence tests.
A SyN derivative buffer has the wrong length or replacement values are not copied into the update field.SyN cannot form the intended field update.Keep the derivative length equal to the field parameter count and preserve replacement values.
SyN loses one side of the middle-space mapping.The output transform and inverse do not describe the same alignment.Maintain both forward and inverse fields through every level and update.

Key files

FileWhy to read it
Modules/…/itkImageRegistrationMethod.hDefines the classic image registration contract.
Modules/…/itkImageRegistrationMethodv4.hDefines the current multi-stage and multi-resolution flow.
Modules/…/itkImageToImageMetricv4.hDefines image similarity and virtual-domain behavior.
Modules/…/itkImageToImageMetricv4GetValueAndDerivativeThreader.hShows how v4 metric domains are split for value and derivative work.
Modules/…/itkObjectToObjectMultiMetricv4.hShows how image and geometric evidence form one metric.
Modules/…/itkImageToImageMetric.hDefines common image masks, samples, gradients, and transform queries.
Modules/Registration/Metricsv4/test/itkMattesMutualInformationImageToImageMetricv4Test.cxxShows numerical validation of sampled mutual-information derivatives.
Modules/Registration/Montage/include/itkPhaseCorrelationImageRegistrationMethod.hxxShows frequency-based translation setup, padding, and output assembly.
Modules/Registration/Montage/include/itkPhaseCorrelationOptimizer.hxxShows peak selection and sub-pixel translation estimates.
Modules/…/itkBlockMatchingImageFilter.hDefines sparse feature-point displacement and similarity outputs.
Modules/…/itkObjectToObjectOptimizerBase.hDefines parameter updates, scales, weights, and stop conditions.
Modules/…/itkTransform.hDefines point mapping and transform parameters.
Modules/…/itkCompositeTransform.hDefines staged transform composition.
Modules/…/itkBSplineTransform.hDefines the preferred local B-spline model.
Modules/Registration/Common/include/itkTimeVaryingBSplineVelocityFieldTransformParametersAdaptor.hxxShows how space-time B-spline domains carry motion between levels.
Modules/…/itkLandmarkBasedTransformInitializer.hDefines paired-landmark initialization.
Modules/…/itkRANSAC.hDefines robust model fitting from landmark subsets.
Modules/…/itkSiddonJacobsRayCastInterpolateImageFunction.hDefines projective image sampling for three-dimensional registration.
Modules/…/itkCurvatureRegistrationFilter.hDefines the FFTW-backed PDE curvature method and its build limits.
Modules/…/itkVariationalRegistrationFilter.hDefines the variational force-plus-regularizer model.
Modules/…/itkVariationalRegistrationFunction.hDefines image-force inputs and field updates.
Modules/…/itkVariationalRegistrationRegularizer.hDefines the shared field-regularizer contract.
Modules/Registration/VariationalRegistration/include/itkVariationalRegistrationElasticRegularizer.hxxShows elastic frequency-domain smoothing and backend choices.
Modules/Registration/VariationalRegistration/include/itkVariationalRegistrationCurvatureRegularizer.hxxShows curvature smoothing and backend choices.
Modules/…/itkVariationalRegistrationMultiResolutionFilter.hDefines coarse-to-fine variational field registration.
Modules/…/itkVariationalRegistrationStopCriterion.hDefines metric-trend stopping across levels.
Modules/Registration/VariationalRegistration/src/VariationalRegistrationMain.cxxShows public variational choices and output assembly.
Modules/Registration/VariationalRegistration/test/itkVariationalRegistrationFilterTest.cxxShows the single-level force, regularizer, and warp contract.
Modules/Registration/VariationalRegistration/test/itkVariationalRegistrationMultiResolutionFilterTest.cxxShows the coarse-to-fine variational flow.
Modules/…/itkSyNImageRegistrationMethod.hDefines the v4 SyN specialization.
Modules/Registration/RegistrationMethodsv4/test/itkSyNImageRegistrationMethodGTest.cxxChecks SyN field, derivative, smoothing, and precision contracts.
Modules/Registration/RegistrationMethodsv4/test/itkSyNImageRegistrationMethodReleaseDataGTest.cxxChecks that release-data settings preserve metric and deformable results.
Modules/…/CMakeLists.txtRegisters the renamed variational tests and the force and regularizer matrix.