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-workflows

Registration method workflows

Registration workflows align a moving object with a fixed reference by choosing a transform that improves a measure of agreement. The v4 framework makes this a staged process for images and point sets, while PDE, RANSAC, phase-correlation, and montage workflows address cases where the data or the search method is different. See Registration framework for the wider registration model.

Registration method model

The registration method model separates the data, the transform, the measure, and the search rule. This separation lets a workflow change the image or point-set measure without changing the main stage structure.

v4 registration stages

ImageRegistrationMethodv4 is the main stage coordinator for current image and point-set registration. A stage supplies fixed and moving objects to a metric through a virtual domain, then uses the metric's value or derivative to update an output transform. Several stages can pass their transforms through a composite transform so that a coarse alignment can precede a deformable one. The v4 metric and method modules are designed to work with the v4 optimizer family rather than the older optimizer interfaces.

The wrapped v4 interface exposes image-pair stages together with forms that connect image inputs to general transforms, displacement fields, and point-set meshes. These forms make the same fixed-versus-moving workflow available to language bindings across common rigid, affine, deformable, and point-set cases.

The virtual domain is the coordinate space for comparison. It can describe an image region without storing image pixels, so metrics and samplers must use its geometry and indices rather than assume that it has an allocated buffer. The numerical optimization and statistics page gives the related view of metrics and optimizers.

This diagram shows how a stage turns fixed and moving data into a transform that downstream stages can reuse.

flowchart LR
    F[Fixed image or point set] --> M[Metric]
    I[Moving image or point set] --> M
    V[Virtual domain or sampled points] --> M
    T[Initial and prior transforms] --> M
    M --> O[Optimizer]
    O --> U[Updated transform]
    C[Earlier composite transform] --> U
    U --> N[Next registration stage]

The fixed input defines the reference for the comparison. The moving input is evaluated through the current transform. An initial transform or a transform from an earlier stage supplies the starting alignment, and the stage returns the updated transform for resampling or for the next stage.

The stage also owns the lifetime boundary for temporary data. It uses protected copies when a filter may release its input data, so global release-data settings do not change the registration result or remove data needed by a later step. Current release-data checks cover SyN, B-spline SyN, and time-varying velocity methods with and without masks.

References: Modules/…/itkImageRegistrationMethodv4.h• L62-105 Modules/…/itkImageRegistrationMethodv4.h• L226-376 Modules/…/itkImageRegistrationMethodv4.h• L463-490 Modules/…/itkImageRegistrationMethodv4.h• L542-560 Modules/…/itkImageRegistrationMethodv4.hxx• L323-401 Modules/…/itkImageRegistrationMethodv4.hxx• L447-720 Modules/…/itkImageRegistrationMethodv4.hxx• L792-807 Modules/…/itkSyNImageRegistrationMethodReleaseDataGTest.cxx• L151-181 Modules/…/itkSyNImageRegistrationMethodReleaseDataGTest.cxx• L342-454 Modules/…/itkImageRegistrationMethodv4.wrap• L1-58

Metric and optimizer roles

A metric turns the current alignment into a measure and, when supported, a direction for improvement. An image metric maps fixed-domain samples through the transform, obtains moving values through an interpolator, applies masks and support checks, and can use image gradients for a derivative. An optimizer uses that measure or derivative to search the transform parameter space.

Metric evidence can be dense, sampled, sequential, or based on selected fixed indexes. Masks and intensity thresholds can narrow the evidence. For B-spline transforms, optional weight caching trades memory for faster repeated parameter support queries. The v4 method also accepts image metrics, point-set metrics, or a multi-metric that combines several measures while keeping them tied to the same transform parameters.

Dense evaluation visits virtual-domain indices, while sampled evaluation visits a virtual point set. Both paths must produce the same kind of value and derivative so the optimizer can use either full or reduced evidence. ANTS neighborhood correlation adds local image neighborhoods to this model, and joint-histogram mutual information builds its joint distribution from the same virtual-domain or sampled-point traversal.

Mattes mutual information is an image metric for data whose intensity patterns may differ. It estimates joint and marginal intensity distributions from sampled fixed and moving values, then supplies a measure and derivative for the registration search. Its current v4 form does not support local-support transforms.

References: Modules/…/itkImageToImageMetric.h• L33-46 Modules/…/itkImageToImageMetric.h• L117-158 Modules/…/itkImageToImageMetric.h• L204-245 Modules/…/itkImageToImageMetric.h• L252-350 Modules/…/itkImageToImageMetricv4GetValueAndDerivativeThreader.hxx• L29-67 Modules/…/itkANTSNeighborhoodCorrelationImageToImageMetricv4GetValueAndDerivativeThreader.h• L45-55 Modules/…/itkANTSNeighborhoodCorrelationImageToImageMetricv4GetValueAndDerivativeThreader.hxx• L54-104 Modules/…/itkJointHistogramMutualInformationComputeJointPDFThreader.hxx• L29-60 Modules/…/itkImageRegistrationMethodv4.hxx• L702-719 Modules/…/itkImageRegistrationMethodv4.hxx• L942-1029 Modules/…/itkImageRegistrationMethodv4.h• L164-224 Modules/…/itkImageRegistrationMethodv4.h• L294-353

Fixed and moving inputs

The framework accepts both image pairs and point-set pairs in one registration method. A virtual domain supplies the space in which the metric compares the data. When the caller does not set one, an image metric can derive it from the fixed image. Image metrics can also use masks and sampled locations, so a stage can focus its comparison on a region or on a controlled set of points rather than on every image location.

The same distinction applies to point clouds. A fixed point set supplies reference geometry, while a moving point set supplies geometry to place into that reference. A labeled point-set metric narrows the comparison to labels shared by both sets and combines the per-label measures into one value and derivative. The metric therefore preserves label structure without changing the fixed-versus-moving stage model.

References: Modules/…/itkImageRegistrationMethodv4.hxx• L170-225 Modules/…/itkImageRegistrationMethodv4.hxx• L567-700 Modules/…/itkImageToImageMetricv4.h• L37-59 Modules/…/itkImageToImageMetricv4.h• L85-109 Modules/…/itkLabeledPointSetToPointSetMetricv4.h• L27-46 Modules/…/itkLabeledPointSetToPointSetMetricv4.h• L91-113

Multi-resolution registration

Multi-resolution registration solves broad motion first and then refines it. Each level changes image resolution and smoothing, and it may also change the transform's useful detail. The result of one level becomes the starting state for the next.

v4 resolution levels

Each v4 level has a virtual-domain resolution, smoothing values for the fixed and moving inputs, and a transform adaptor. Shrink factors make early levels cheaper and less sensitive to small local variation. Smoothing reduces detail at those levels. The final level normally restores the finest spatial detail.

Transform adaptors carry the current solution into the next level when the transform needs a new shape or parameter layout. A time-varying B-spline velocity transform, for example, changes its control lattice for the new domain and resamples each coefficient component before it integrates the adapted velocity field. This preserves the coarse alignment while adding finer control.

When a stage starts, its initial transform describes the transform to optimize. The stage can also receive a moving initial transform from an earlier stage. This is the normal way to compose a linear stage with a later deformable stage.

References: Modules/…/itkImageRegistrationMethodv4.h• L68-103 Modules/…/itkImageRegistrationMethodv4.hxx• L323-441 Modules/…/itkImageRegistrationMethodv4.hxx• L447-720 Modules/…/itkTransformParametersAdaptorBase.h• L26-47 Modules/…/itkTimeVaryingBSplineVelocityFieldTransformParametersAdaptor.hxx• L123-179 Modules/…/itkTimeVaryingBSplineVelocityFieldTransformParametersAdaptor.hxx• L239-334 Modules/…/itkSyNImageRegistrationMethodReleaseDataGTest.cxx• L164-240

PDE resolution levels

The older PDE workflow has a matching coarse-to-fine pattern, but its state is a displacement field rather than a general v4 transform. It builds fixed and moving image pyramids, runs a deformable registration filter at each level, and resamples the field before the next finer level. A zero field is the default starting state when no initial field is supplied.

The wrapped Demons interface covers scalar image pairs with vector fields whose component count matches the image dimension. This keeps the PDE workflow's output as a spatial displacement that can move the image through the same coarse-to-fine path.

This diagram shows the field hand-off that links PDE levels.

flowchart LR
    F[Fixed image pyramid] --> R[PDE registration filter]
    M[Moving image pyramid] --> R
    D[Current displacement field] --> R
    R --> X[Field expansion to finer level]
    X --> D
    R --> O[Final displacement field]

References: Modules/…/itkMultiResolutionPDEDeformableRegistration.h• L29-63 Modules/…/itkMultiResolutionPDEDeformableRegistration.h• L163-229 Modules/…/itkDemonsRegistrationFilter.wrap• L1-27

Deformable registration families

Deformable methods differ in how they represent and update non-linear motion. They still use the same broad workflow: compare the current warped data, form an update, regularize that update, and accumulate it into the output transform.

PDE deformable registration

PDEDeformableRegistrationFilter estimates a displacement field that maps the moving image toward the fixed image. At each iteration, a PDE registration function produces an update. Optional smoothing regularizes the update field or the accumulated displacement field, which controls the balance between local flexibility and smooth motion.

The curvature variant adds a fast curvature regularizer for the displacement update. It uses a frequency-domain transform to apply the regularization across each vector component, then writes the filtered result back to the field. This path is available only when the required double-precision FFTW support is enabled. The multi-resolution wrapper can use this or another compatible PDE filter when the main need is a coarse-to-fine displacement field rather than a v4 stage with a separately configured optimizer.

References: Modules/…/itkPDEDeformableRegistrationFilter.h• L26-71 Modules/…/itkPDEDeformableRegistrationFilter.h• L121-197 Modules/…/itkCurvatureRegistrationFilter.h• L32-80 Modules/…/itkCurvatureRegistrationFilter.h• L97-184 Modules/…/itkCurvatureRegistrationFilter.hxx• L82-182 Modules/…/itkCurvatureRegistrationFilter.hxx• L200-275 Modules/…/itkMultiResolutionPDEDeformableRegistration.h• L34-75

SyN registration

SyN is a v4 deformable family that optimizes two displacement transforms, one from the fixed image and one from the moving image, toward a shared midpoint. At each iteration it forms metric-gradient updates for both sides, smooths and scales them, and stops when the measure is stable. The final output composes the midpoint-side transforms into a moving-to-fixed transform and its inverse, so the result can be added to an existing composite transform.

SyN can use image or point-set evidence, including a multi-metric that combines both kinds of input. For image evidence, it can either evaluate the source images through the active transforms or resample them into the current virtual domain before derivative evaluation. The method reuses those resampled images and masks within an iteration, then clears that cache before the next update. A metric must return a derivative with the expected virtual-domain field size because the method turns that derivative into a displacement update.

The family includes a direct displacement-field form and a B-spline-smoothed form. The direct form smooths updates and total fields with Gaussian rules. The B-spline variant uses a smooth field model for the update and total field, and it can fit point-set derivatives from their scattered locations. Both forms keep paired midpoint transforms and carry them across resolution levels through transform adaptors.

The update path protects field data from short filter pipelines before it composes, smooths, and inverts the two midpoint-side fields. This keeps the result valid when the pipeline releases intermediate data during an update. The release-data test also checks that image adaptors retain their selected channel and that velocity-field integration retains the field used by its interpolator.

This diagram shows how SyN keeps the fixed-side and moving-side paths separate during optimization, then combines them into the final forward and inverse transforms.

flowchart LR
    F[Fixed image or point set] --> UF[Fixed-side metric update]
    M[Moving image or point set] --> UM[Moving-side metric update]
    UF --> SF[Smoothed fixed-to-middle field]
    UM --> SM[Smoothed moving-to-middle field]
    SF --> IF[Fixed-side inverse field]
    SM --> IM[Moving-side inverse field]
    IF --> C[Forward and inverse composition]
    IM --> C
    C --> O[Output transform]

References: Modules/…/itkSyNImageRegistrationMethod.h• L31-55 Modules/…/itkSyNImageRegistrationMethod.h• L144-224 Modules/…/itkSyNImageRegistrationMethod.hxx• L61-128 Modules/…/itkSyNImageRegistrationMethod.hxx• L136-319 Modules/…/itkSyNImageRegistrationMethod.hxx• L327-579 Modules/…/itkSyNImageRegistrationMethod.hxx• L587-657 Modules/…/itkSyNImageRegistrationMethod.hxx• L889-924 Modules/…/itkBSplineSyNImageRegistrationMethod.hxx• L41-70 Modules/…/itkBSplineSyNImageRegistrationMethod.hxx• L81-215 Modules/…/itkBSplineSyNImageRegistrationMethod.hxx• L225-358 Modules/…/itkSyNImageRegistrationMethodReleaseDataGTest.cxx• L342-454

Time-varying velocity registration

Time-varying velocity methods describe motion as a field over both space and time. The method integrates that field to obtain the displacement used to compare the images, then turns the metric result into an update of the velocity field. Spatial and temporal smoothing can regularize both the update and the total field.

The B-spline velocity variant represents the time-varying field with a smooth control lattice. It can use image or point-set evidence and samples several time positions when it builds the update. At each time position it creates fixed-side and moving-side mappings, evaluates the metric in the virtual domain, and collects the resulting spatial or spatio-temporal updates. A B-spline fit converts those updates to control-point changes before the velocity field is integrated again.

Both variants remain v4 stages, so they use the same fixed and moving input roles, multi-resolution levels, and transform composition as other v4 methods. Their resolution adaptors must carry the time axis and spatial domain together. The completed stage integrates the full time range and retains the field used by its interpolator even when pipeline release is enabled.

References: Modules/…/itkTimeVaryingVelocityFieldImageRegistrationMethodv4.h• L28-77 Modules/…/itkTimeVaryingVelocityFieldImageRegistrationMethodv4.h• L143-182 Modules/…/itkTimeVaryingVelocityFieldImageRegistrationMethodv4.hxx• L65-128 Modules/…/itkTimeVaryingVelocityFieldImageRegistrationMethodv4.hxx• L142-355 Modules/…/itkTimeVaryingVelocityFieldImageRegistrationMethodv4.hxx• L410-431 Modules/…/itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx• L62-170 Modules/…/itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx• L228-335 Modules/…/itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx• L338-591 Modules/…/itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx• L602-812 Modules/…/itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx• L820-841 Modules/…/itkSyNImageRegistrationMethodReleaseDataGTest.cxx• L362-365 Modules/…/itkSyNImageRegistrationMethodReleaseDataGTest.cxx• L426-453

Point-set registration

Point-set registration aligns spatial samples without requiring a dense image. A point-set metric turns distances, labels, or other point relations into a scalar measure, and an optimizer changes the transform until the moving points agree with the fixed points.

Point-set input workflows

The v4 method can use point sets as fixed and moving objects while preserving the image-registration stage model. This supports simple affine alignment as well as deformable v4 methods when the metric and transform can work with point-set evidence. The virtual domain remains important because it gives the metric and parameter-scale logic a reference space for the point samples.

The older point-set methods expose a smaller, direct composition. Point-set-to-point-set registration requires a transform, metric, and optimizer. Point-set-to-image registration adds an interpolator because the metric samples the moving image at transformed point locations. These workflows are useful when the data types do not fit a dense image-to-image stage.

References: Modules/…/itkImageRegistrationMethodv4.h• L260-292 Modules/…/itkImageRegistrationMethodv4.hxx• L533-560 Modules/…/itkPointSetToPointSetRegistrationMethod.h• L28-60 Modules/…/itkPointSetToImageRegistrationMethod.h• L29-61 Modules/…/CMakeLists.txt• L105-114

Feature-point block matching

Block matching is a feature-point workflow that estimates a local displacement for each selected point by comparing a fixed image block with candidate blocks in the moving image. It produces a displacement point set and a matching-similarity point set, so later field or point-set workflows can use both the proposed motion and its support.

The feature points are physical locations shared by the two images. A block radius defines local evidence and a search radius defines candidate motion. The filter requires at least one feature point and does not stream its point-set outputs, because it assembles complete results for all points.

This diagram shows the local evidence path from selected features to displacement samples.

flowchart LR
    F[Fixed image] --> B[Block comparison]
    M[Moving image] --> B
    P[Feature points] --> B
    B --> D[Displacement point set]
    B --> S[Similarity point set]

References: Modules/…/itkBlockMatchingImageFilter.h• L31-57 Modules/…/itkBlockMatchingImageFilter.h• L129-169 Modules/…/itkBlockMatchingImageFilter.hxx• L122-190 Modules/…/itkBlockMatchingImageFilter.hxx• L301-367

Point-set and spatial-object demons

Point-set-to-spatial-object Demons registration uses a point set as the scene and a spatial object as the model. Point data carries sample locations and vectors that point outward from the model. The spatial object answers whether a queried location is inside or outside, which supplies the comparison signal for a derived transform update method.

This approach is distinct from point-set distance registration. It uses a model's inside/outside behavior instead of only matching two lists of points, so it fits shape-boundary alignment when a spatial object can express the target model. See Mesh and spatial objects for the broader spatial-object model.

References: Modules/…/itkPointSetToSpatialObjectDemonsRegistration.h• L28-44 Modules/…/itkPointSetToSpatialObjectDemonsRegistration.h• L49-94

Robust landmark registration

RANSAC registration is a robust model-fitting workflow for correspondence data that may contain outliers. It repeatedly estimates a model from a minimal sample, counts the data that agrees with that model, and refits the best-supported model with the agreeing data.

RANSAC model fitting

The RANSAC framework is independent of image metrics and iterative deformable fields. A parameter estimator defines the exact fit, the least-squares fit, and the agreement test. It can also provide batch agreement scores and optional correspondence checks for distance or edge length. A landmark estimator supplies this contract for point data.

RANSAC can use one data set to form random model hypotheses and a separate agreement data set to score those hypotheses. It returns transform parameters rather than a dense deformation. Those parameters can provide a robust initial alignment for a later registration stage when the correspondence data is sparse or noisy.

The Python wrapping makes this RANSAC workflow available through the public itk.RANSAC class. The package setup removes the lazy RANSAC submodule name after binding so that a parameterized class lookup such as itk.RANSAC[itk.Point[itk.D, 6], itk.D, itk.Similarity3DTransform.D] resolves to the class. The Python mesh example uses feature meshes to form correspondence hypotheses and separate meshes to score agreement, then reports the supported-data fraction, inlier error, and transform parameters.

This diagram shows how RANSAC turns correspondence data into a supported model before another registration workflow uses it.

flowchart LR
    D[Hypothesis data] --> E[Parameter estimator]
    E --> P[Candidate parameters]
    A[Agreement data] --> R[Agreement checks]
    P --> R
    R --> B[Best supported model]
    B --> L[Least-squares refit]
    L --> T[Transform parameters]

References: Modules/…/itkRANSAC.h• L34-60 Modules/…/itkRANSAC.h• L106-159 Modules/…/itkParametersEstimator.h• L30-40 Modules/…/itkParametersEstimator.h• L60-107 Modules/…/itkLandmarkRegistrationEstimator.h• L57-91 Modules/…/CMakeLists.txt• L1-11 Modules/…/__init_ransac__.py• L19-22 Modules/…/CMakeLists.txt• L1-19 Modules/…/itkRansacMeshTest.py• L42-118

Montage registration

Montage registration solves a different product problem: it places many overlapping image tiles into one mosaic. It estimates pairwise translations from image content, combines those candidates across the tile grid, and returns one transform per tile plus reliability information.

Phase-correlation registration

Phase correlation estimates a translation by comparing the frequency content of a fixed and moving image. The workflow requires compatible image spacing and direction before it runs. It then pads or crops the inputs as needed, forms a frequency-domain correlation surface, and finds one or more peaks. Peak selection can use integer or sub-pixel interpolation. The result becomes a translation transform or a set of offsets with confidence values.

The operator and optimizer are replaceable parts of the phase-correlation method. The operator shapes the frequency-domain correlation, while the optimizer selects peaks, merges nearby peaks, suppresses weak zero-shift results, and can limit the expected pixel distance. Cached Fourier transforms make repeated pairwise comparisons practical when one tile participates in several registrations.

This diagram shows the pairwise translation path used by montage workflows.

flowchart LR
    F[Fixed tile] --> P[Phase correlation]
    M[Moving tile] --> P
    P --> S[Correlation surface]
    S --> O[Peak and offset optimizer]
    O --> T[Translation candidate and confidence]
    T --> G[Global tile adjustment]

References: Modules/…/itkPhaseCorrelationImageRegistrationMethod.h• L62-119 Modules/…/itkPhaseCorrelationImageRegistrationMethod.h• L202-249 Modules/…/itkPhaseCorrelationImageRegistrationMethod.h• L330-391 Modules/…/itkPhaseCorrelationOptimizer.h• L73-107 Modules/…/itkPhaseCorrelationOptimizer.h• L157-235

Tile montage assembly

TileMontage treats the input as a regular rectangular n-dimensional tile array. A tile configuration supplies tile positions and file names, pairwise phase correlation supplies candidate offsets, and global adjustment selects a consistent placement across the mosaic. The output includes a translation for each tile and a reliability score that helps identify weak registrations.

The montage workflow depends on the assumed tile layout. Position tolerance constrains the expected motion, overlap cropping focuses pairwise comparison on shared content, and absolute or relative thresholds reduce the influence of inconsistent candidates. A separate merge step can then resample the placed tiles into one image.

The wrapped interface supports scalar tile images with either floating-point or double-precision tile transforms. This keeps the mosaic workflow available to language bindings while preserving the same per-tile placement and reliability outputs.

References: Modules/…/itkTileMontage.h• L33-43 Modules/…/itkTileMontage.h• L107-147 Modules/…/itkTileMontage.h• L187-226 Modules/…/itkTileMontage.h• L284-343 Modules/…/itkTileConfiguration.h• L37-69 Modules/…/itkTileMontage.wrap• L1-8

Change checklist

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

  • A new v4 input type must still map to the metric's virtual domain and to the transform being optimized.
  • A virtual-domain change must preserve both dense index traversal and sampled point traversal, including non-zero region indices and unallocated virtual images.
  • An image metric change must keep virtual-domain sampling, masks, transformed image support, interpolation, and derivative layout aligned.
  • A legacy image metric change must keep its transform, interpolator, image masks, sample selection, gradient path, and optional B-spline weight cache consistent.
  • A local-neighborhood metric change must keep dense scanning and sparse sampled evaluation equivalent at the value and derivative level.
  • A new multi-resolution level must keep its shrink factors, smoothing values, transform adaptor, and per-level iteration or sampling settings aligned.
  • A time-varying B-spline adaptor change must preserve the relation between transform-domain geometry, control-point lattice geometry, coefficient resampling, and the integrated field.
  • A new registration stage must pass the prior stage's transform in the correct composition order so the moving data sees the intended full alignment.
  • A new multi-metric setup must use one shared transform parameter space and compatible virtual-domain point samples.
  • A labeled point-set metric change must keep common-label selection and per-label value and derivative accumulation synchronized.
  • A feature-point block-matching change must preserve point identifiers, physical point locations, and the one-to-one relation between displacement and similarity outputs.
  • A SyN change must preserve the paired fixed-to-middle and moving-to-middle state and the final forward and inverse composition.
  • A SyN resampling change must keep image and mask interpolation distinct, clear cached results after input or transform changes, and keep derivative fields matched to the active virtual domain.
  • A SyN resolution change must provide a transform adaptor for every level and adapt both midpoint-side transforms.
  • A SyN or velocity-field pipeline change must protect fields, images, masks, and interpolator inputs from release-data behavior before a later step needs them.
  • A velocity-field change must keep the time-point transforms, integration bounds, control lattice, and final interpolator field synchronized.
  • A PDE curvature change must preserve the image-force update, displacement-field component filtering, regularization weight, and FFTW build requirement.
  • A simple image regression must allow the larger geometry and trajectory differences expected in single-precision space builds without hiding normal failures.
  • A Mattes mutual information workflow must use a transform type supported by that metric and a valid histogram-bin setting.
  • A change to the RANSAC estimator contract must preserve exact fitting, least-squares fitting, agreement checks, and any optional correspondence checks used by landmark registration.
  • A new RANSAC agreement-data path must preserve the link between hypothesis data, scoring data, and the final model support.
  • The Python RANSAC package setup must keep itk.RANSAC bound to the parameterized class rather than the lazy submodule name.
  • A Python RANSAC test change must keep feature correspondence data separate from agreement data and preserve the reported support and inlier measures.
  • A phase-correlation change must preserve the link between input geometry, correlation peaks, selected offsets, and confidence values.
  • A new montage candidate rule must preserve the link between pairwise offsets, global tile placement, and tile reliability.
  • A wrapper change must keep exposed image, point-set, displacement-field, transform, dimension, and numeric-type combinations aligned with the workflow's valid data contract.
  • A build change for legacy registration examples must keep each enabled executable linked to the registration test libraries and keep FFTW-only examples conditional.

Important failure modes

TriggerConsequenceGuard
The fixed and moving images do not have compatible spacing or direction before phase correlation.The estimated translation can be invalid even when the correlation peak is clear.Resample one image first and use compatible image geometry.
A v4 metric assumes that the virtual domain has pixels or uses the wrong region index.Dense or sampled evaluation can read invalid data or compare the wrong locations.Treat the virtual domain as geometry and traverse its indices or sampled points.
A v4 level lacks a matching transform adaptor or has inconsistent level settings.The transform cannot carry its solution safely to the next resolution.Define one adaptor and matching resolution data for every level.
A time-varying B-spline adaptor changes the lattice without carrying the domain and coefficient geometry together.The next level can distort the current velocity solution before integration.Adapt the control lattice from the required domain and integrate the adapted field.
A multi-metric combines metrics with different transform parameter spaces.The combined derivative does not describe one valid optimization problem.Make all component metrics evaluate the same transform parameters.
Mattes mutual information receives a local-support transform.Metric initialization throws an exception and the stage cannot start.Use a supported transform or choose a metric that supports local parameters.
A local correlation window contains no valid fixed and moving samples.The local measure and derivative cannot guide the optimizer.Keep the virtual domain and image support large enough for the selected neighborhood.
A feature point is too close to an image boundary for its block or search window.Block matching can read outside the intended image support or produce a poor displacement.Select interior features or enable boundary checks before matching.
Block matching receives no feature points.The filter cannot produce displacement or similarity outputs.Validate that the selected feature point set is non-empty.
A SyN metric returns a derivative whose size does not match the current virtual-domain field.The deformable update cannot be formed from the metric result.Preserve the metric derivative contract for the active virtual domain.
A SyN metric replaces the derivative buffer and the method assumes the original buffer still holds the result.The update field can contain stale or incomplete values.Copy the metric result into the field when the metric does not retain the field view.
SyN reuses a resampled image or mask after its input, transform, or reference changes.A later update uses data from an earlier iteration or level.Clear the resample cache whenever those objects change.
A filter releases a field, image, mask, or velocity-field input that a later registration step still needs.The update or final transform can use empty data or lose an interpolator input.Pass protected grafts into short pipelines and keep the needed output connected or detached at the correct boundary.
Fixed and moving labeled point sets share no labels.The labeled metric has no common evidence for alignment.Validate the common label set before starting registration.
RANSAC receives too few data objects, singular samples, or invalid outlier probability.Parameter estimation fails or returns no model.Provide the estimator's minimum sample and valid probability before computing.
Hypothesis data and agreement data do not represent the same correspondence model.RANSAC can select a model that fits the scoring data but cannot be refit from the selected support.Keep the estimator's data contract and agreement checks consistent across both inputs.
The Python package leaves the lazy RANSAC submodule visible as itk.RANSAC.Parameterized class construction can resolve to the module instead of the RANSAC class.Remove the lazy submodule binding after the wrapped class is loaded.
A phase-correlation peak is merged, suppressed, or limited with thresholds that do not fit the tile motion.The method returns a poor offset or no useful candidate.Set peak and distance controls to match the expected translation and overlap.
A montage pair exceeds all candidate quality thresholds.The pair is treated as having no useful translation and its influence is reduced.Set position and quality thresholds to match the tile overlap and expected motion.
A wrapped filter omits a valid image, vector-field, dimension, or numeric-type combination.A supported registration workflow is unavailable through the language binding or fails at wrapper generation.Keep wrapper combinations aligned with the filter's data contract and dimension rules.
A curvature PDE build lacks the required FFTW double-precision path.The fast curvature registration filter is unavailable for that build.Enable the supported FFTW configuration or use another PDE registration filter.
A curvature update uses unstable time-step or constraint values for its image-force scale.The displacement field can diverge or produce poor motion.Tune the time step and curvature weight for the image-force normalization.

Key files

FileWhy to read it
Modules/…/itkImageRegistrationMethodv4.hDefines the shared v4 stage model for inputs, transforms, metrics, optimizers, sampling, and levels.
Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.hxxShows how stages establish virtual-domain geometry, prepare inputs, sample evidence, protect temporary data, and start optimization.
Modules/Registration/RegistrationMethodsv4/wrapping/itkImageRegistrationMethodv4.wrapDefines the v4 image, mesh, displacement-field, and velocity-transform combinations exposed to language bindings.
Modules/…/itkImageToImageMetric.hDefines the legacy image metric contract for transformed image comparison, interpolation, masks, sampling, gradients, and B-spline support caching.
Modules/Registration/Metricsv4/include/itkImageToImageMetricv4GetValueAndDerivativeThreader.hxxShows the shared dense and sampled traversal model for image metric evaluation.
Modules/…/itkANTSNeighborhoodCorrelationImageToImageMetricv4GetValueAndDerivativeThreader.hDefines dense and sparse local-correlation evaluation over virtual-domain evidence.
Modules/Registration/Metricsv4/include/itkJointHistogramMutualInformationComputeJointPDFThreader.hxxShows how joint-histogram evidence uses dense or sampled virtual-domain traversal.
Modules/…/itkMattesMutualInformationImageToImageMetricv4.hDefines the mutual-information metric and its transform support limits.
Modules/…/itkLabeledPointSetToPointSetMetricv4.hDefines label-aware point-set evidence and common-label accumulation.
Modules/…/itkSyNImageRegistrationMethod.hShows the v4 deformable family, midpoint state, tunable convergence behavior, and resampling contract.
Modules/Registration/RegistrationMethodsv4/include/itkSyNImageRegistrationMethod.hxxShows the paired midpoint updates, virtual-domain resampling, derivative handling, convergence, final transform composition, and protected field pipelines.
Modules/Registration/RegistrationMethodsv4/include/itkBSplineSyNImageRegistrationMethod.hxxShows the B-spline update path for image and scattered point-set evidence.
Modules/Registration/RegistrationMethodsv4/include/itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxxShows time-point sampling, image and point-set derivative collection, B-spline control-lattice updates, and per-level optimization.
Modules/Registration/Common/include/itkTimeVaryingBSplineVelocityFieldTransformParametersAdaptor.hxxShows how a time-varying B-spline transform carries its domain and control lattice between resolution levels.
Modules/Registration/RegistrationMethodsv4/include/itkTimeVaryingVelocityFieldImageRegistrationMethodv4.hxxShows time-point integration, velocity updates, and release-safe temporary mappings.
Modules/Registration/RegistrationMethodsv4/test/itkSyNImageRegistrationMethodReleaseDataGTest.cxxVerifies multi-resolution deformable results, masks, image adaptors, velocity integration, and B-spline velocity results under release-data behavior.
Modules/…/CMakeLists.txtConnects the v4 registration tests and release-data checks to the test drivers.
Modules/…/itkMultiResolutionPDEDeformableRegistration.hDefines the coarse-to-fine PDE field workflow.
Modules/…/itkCurvatureRegistrationFilter.hDefines the optional FFTW-backed curvature PDE registration family and its field-update contract.
Modules/Registration/PDEDeformable/wrapping/itkDemonsRegistrationFilter.wrapDefines the image and dimension combinations exposed for Demons displacement-field registration.
Modules/…/itkBlockMatchingImageFilter.hDefines feature-point block matching and its displacement and similarity outputs.
Modules/Registration/Common/include/itkBlockMatchingImageFilter.hxxShows local block comparison, search-window selection, and complete point-set output assembly.
Modules/…/itkPointSetToPointSetRegistrationMethod.hDefines direct point-set-to-point-set registration.
Modules/…/itkParametersEstimator.hDefines the estimator contract for exact fits, least-squares fits, agreement, and correspondence checks.
Modules/…/itkRANSAC.hDefines robust model fitting, separate hypothesis and agreement data, and transform-parameter output.
Modules/…/CMakeLists.txtInstalls the Python package hook that fixes public itk.RANSAC class lookup.
Modules/…/__init_ransac__.pyRemoves the lazy submodule name so the wrapped RANSAC class is available through the public Python API.
Modules/…/itkRansacMeshTest.pyDemonstrates feature correspondence input, separate agreement data, robust fitting, and reported model support.
Modules/…/CMakeLists.txtBuilds the Python mesh workflow and checks parameterized RANSAC class construction.
Modules/…/itkPhaseCorrelationImageRegistrationMethod.hDefines pairwise translation estimation, input preparation, and offset output for image tiles.
Modules/…/itkPhaseCorrelationOptimizer.hDefines peak selection, interpolation, offset filtering, and confidence output.
Modules/…/itkTileMontage.hDefines global tile placement and per-tile registration outputs.
Modules/…/itkTileConfiguration.hDefines the regular tile-grid description used by montage assembly.
Modules/Registration/Montage/wrapping/itkTileMontage.wrapDefines the tile image and transform numeric types exposed to language bindings.
Modules/…/CMakeLists.txtShows which legacy image, deformable, and multi-resolution registration examples are built and when the FFTW-only example is enabled.