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:
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:
- If the centers mode is selected, only a translation is estimated.
- If the input data sets cannot fit in memory, this algorithm will fail during its computation.
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 );
This function returns outputTransform.
// Function prototype. image_prealignment_3d(input_moving_image: idt.ImageType, input_fixed_image: idt.ImageType, alignment_mode: ImagePrealignment3d.AlignmentMode = ImagePrealignment3d.AlignmentMode.CENTERS) -> Union[idt.NDArrayFloat, None]
This function returns outputTransform.
// Function prototype. public static IOLink.Matrix4d ImagePrealignment3d( IOLink.ImageView inputMovingImage, IOLink.ImageView inputFixedImage, ImagePrealignment3d.AlignmentMode alignmentMode = ImageDev.ImagePrealignment3d.AlignmentMode.CENTERS );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |||||
---|---|---|---|---|---|---|---|---|---|
![]() |
inputMovingImage |
The input moving image, also known as the model image. | Image | Grayscale | nullptr | ||||
![]() |
inputFixedImage |
The input fixed image, also known as the reference image. | Image | Grayscale | nullptr | ||||
![]() |
alignmentMode |
The type of pre-alignment to perform.
|
Enumeration | CENTERS | |||||
![]() |
outputTransform |
The output transformation, which pre-aligns the moving image onto the fixed image. It is represented by a 4x4 matrix.
It is important to note that this transformation is a direct transformation, which means that it maps a point from the moving image to the fixed image. It should be inverted before applying it to the moving image using the ResampleAffine3d algorithm in order to match it to the fixed image. |
Matrix4d | IDENTITY |
Parameter Name | Description | Type | Supported Values | Default Value | |||||
---|---|---|---|---|---|---|---|---|---|
![]() |
input_moving_image |
The input moving image, also known as the model image. | image | Grayscale | None | ||||
![]() |
input_fixed_image |
The input fixed image, also known as the reference image. | image | Grayscale | None | ||||
![]() |
alignment_mode |
The type of pre-alignment to perform.
|
enumeration | CENTERS | |||||
![]() |
output_transform |
The output transformation, which pre-aligns the moving image onto the fixed image. It is represented by a 4x4 matrix.
It is important to note that this transformation is a direct transformation, which means that it maps a point from the moving image to the fixed image. It should be inverted before applying it to the moving image using the ResampleAffine3d algorithm in order to match it to the fixed image. |
matrix | _np.identity(4) |
Parameter Name | Description | Type | Supported Values | Default Value | |||||
---|---|---|---|---|---|---|---|---|---|
![]() |
inputMovingImage |
The input moving image, also known as the model image. | Image | Grayscale | null | ||||
![]() |
inputFixedImage |
The input fixed image, also known as the reference image. | Image | Grayscale | null | ||||
![]() |
alignmentMode |
The type of pre-alignment to perform.
|
Enumeration | CENTERS | |||||
![]() |
outputTransform |
The output transformation, which pre-aligns the moving image onto the fixed image. It is represented by a 4x4 matrix.
It is important to note that this transformation is a direct transformation, which means that it maps a point from the moving image to the fixed image. It should be inverted before applying it to the moving image using the ResampleAffine3d algorithm in order to match it to the fixed image. |
Matrix4d | IDENTITY |
Object Examples
auto 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();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif")) image_prealignment_3d_algo = imagedev.ImagePrealignment3d() image_prealignment_3d_algo.input_moving_image = polystyrene image_prealignment_3d_algo.input_fixed_image = polystyrene image_prealignment_3d_algo.alignment_mode = imagedev.ImagePrealignment3d.CENTERS image_prealignment_3d_algo.execute() print("output_transform:", str(image_prealignment_3d_algo.output_transform))
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" ); ImagePrealignment3d imagePrealignment3dAlgo = new ImagePrealignment3d { inputMovingImage = polystyrene, inputFixedImage = polystyrene, alignmentMode = ImagePrealignment3d.AlignmentMode.CENTERS }; imagePrealignment3dAlgo.Execute(); Console.WriteLine( "outputTransform:" + imagePrealignment3dAlgo.outputTransform.ToString() );
Function Examples
auto polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); auto result = imagePrealignment3d( polystyrene, polystyrene, ImagePrealignment3d::AlignmentMode::CENTERS ); std::cout << "outputTransform:" << result.toString();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif")) result = imagedev.image_prealignment_3d(polystyrene, polystyrene, imagedev.ImagePrealignment3d.CENTERS) print("output_transform:", str(result))
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" ); IOLink.Matrix4d result = Processing.ImagePrealignment3d( polystyrene, polystyrene, ImagePrealignment3d.AlignmentMode.CENTERS ); Console.WriteLine( "outputTransform:" + result.ToString() );
© 2025 Thermo Fisher Scientific Inc. All rights reserved.