ImageDev

ImagePrealignment3d

Estimates a transformation (translation and rotation) that roughly aligns a moving image with a fixed image based on their intensity values.

Access to parameter description

This estimate can be used as the initial transformation of the AffineRegistration algorithm.

ImagePrealignment3d first computes the centers of gravity and (optionally) the moments of inertia of both images (model and reference) using the image intensity.
In a second step, the translation and the rotation that align the centers of gravity and the principal axes (corresponding to the principal moments of inertia) of both images are estimated.

Notices: See also

Function Syntax

This function returns outputTransform.
// Function prototype
iolink::Matrix4d imagePrealignment3d( std::shared_ptr< iolink::ImageView > inputMovingImage, std::shared_ptr< iolink::ImageView > inputFixedImage, ImagePrealignment3d::AlignmentMode alignmentMode );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputMovingImage
The input moving image, also known as the model image. Image Grayscale nullptr
input
inputFixedImage
The input fixed image, also known as the reference image. Image Grayscale nullptr
input
alignmentMode
The type of prealignment to perform.
CENTERS In this mode, the centers of gravity of the input images are aligned.
PRINCIPAL_AXES In this mode, the centers of gravity and the principal axes of the input images are aligned.
Enumeration CENTERS
output
outputTransform
The output transformation prealigning both input data sets (a 4x4 matrix). Matrix4d IDENTITY

Object Examples

std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" );

ImagePrealignment3d imagePrealignment3dAlgo;
imagePrealignment3dAlgo.setInputMovingImage( polystyrene );
imagePrealignment3dAlgo.setInputFixedImage( polystyrene );
imagePrealignment3dAlgo.setAlignmentMode( ImagePrealignment3d::AlignmentMode::CENTERS );
imagePrealignment3dAlgo.execute();

std::cout << "outputTransform:" << imagePrealignment3dAlgo.outputTransform().toString();

Function Examples

std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" );

auto result = imagePrealignment3d( polystyrene, polystyrene, ImagePrealignment3d::AlignmentMode::CENTERS );

std::cout << "outputTransform:" << result.toString();