Documentation Center

  • Trial Software
  • Product Updates


Configurations for intensity-based registration


  • [optimizer,metric] = imregconfig(modality) example



[optimizer,metric] = imregconfig(modality) creates optimizer and metric configurations that you pass to imregister to perform intensity-based image registration. imregconfig returns optimizer and metric with default settings to provide a basic registration configuration.


expand all

Create Optimizer and Metric Configurations to Register Images Captured on the Same Device

Load the images into the workspace and display them.

fixed  = imread('pout.tif');
moving = imrotate(fixed, 5, 'bilinear', 'crop');
imshowpair(fixed, moving,'Scaling','joint');

Create the optimizer and metric. The two images in this example were captured on the same device, so we'll set the modality to'monomodal'.

 [optimizer, metric]  = imregconfig('monomodal')
optimizer = 


    GradientMagnitudeTolerance: 1.000000e-04
             MinimumStepLength: 1.000000e-05
             MaximumStepLength: 6.250000e-02
            MaximumIterations: 100
            RelaxationFactor: 5.000000e-01

metric = 


  This class has no properties.

Pass optimizer and metric to imregister to perform the registration.

movingRegistered = imregister(moving,fixed,'rigid',optimizer, metric);

View the registered images

imshowpair(fixed, movingRegistered,'Scaling','joint');

Input Arguments

expand all

modality — Image capture modality'monomodal' | 'multimodal'

Image capture modality describes how your images have been captured, specified as either 'monomodal' (captured on the same device) or 'multimodal' (captured on different devices).

Output Arguments

expand all

optimizer — Optimization configurationoptimizer object

Optimization configuration describes the method for optimizing the similarity metric, returned as one of the optimizer objects, registration.optimizer.RegularStepGradientDescent or registration.optimizer.OnePlusOneEvolutionary

metric — Metric configurationmetric object

Metric configuration describes the image similarity metric to be optimized during registration, returned as one of the metric objects, registration.metric.MeanSquares or registration.metric.MattesMutualInformation.

More About

expand all


Images captured on the same device. Monomodal images have similar brightness ranges.


Images captured on different devices. Multimodal images usually have different brightness ranges.


  • Your registration results can improve if you adjust the optimizer or metric settings. For example, if you increase the number of iterations in the optimizer, reduce the optimizer step size, or change the number of samples in a stochastic metric, the registration improves to a point, at the expense of performance.

See Also

| | | | |

Was this topic helpful?