This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.


Configurations for intensity-based registration


  • [optimizer,metric] = imregconfig(modality)



[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.


collapse all

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

collapse all

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

collapse all

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

collapse 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.

Introduced in R2012a

Was this topic helpful?