This algorithm re-assigns the position of the image on the grid according to user-defined vectors.
During a translation, there are usually two phenomena: part of the image is out of the window, while
another part has no values, as illustrated in Figure 1.
Figure 1. Translation of an image
A translation is denoted by a vector (tx,ty,tz). A pixel M of coordinates (x,y,z) is translated to the
new coordinates in the output image as:
{x′=tx+xy′=ty+yz′=tz+z
or using matrix notation:
[x′y′z′]=[txtytz]+[xyz]
The output image is a discrete space of finite dimensions where the new X, Y, and Z coordinates may be outside
the image.
There are two possible ways to manage data out of the bounding box:
The information moved outside of the image area is lost, and a padding value is assigned to the blank
area counterpart.
Figure 2. Translation of an image in FIXED mode
The image is perceived as a cylinder, where the information outside the image area wraps around and is
placed in the blank area.
// Command constructor.TranslateImage3d();/// Gets the inputImage parameter./// The input image.
std::shared_ptr< iolink::ImageView> inputImage()const;/// Sets the inputImage parameter./// The input image.void setInputImage( std::shared_ptr< iolink::ImageView> inputImage );/// Gets the translationVector parameter./// The translation vector in voxels.
iolink::Vector3i32 translationVector()const;/// Sets the translationVector parameter./// The translation vector in voxels.void setTranslationVector(const iolink::Vector3i32& translationVector );/// Gets the backgroundMode parameter./// The mode for managing outside information.TranslateImage3d::BackgroundMode backgroundMode()const;/// Sets the backgroundMode parameter./// The mode for managing outside information.void setBackgroundMode(constTranslateImage3d::BackgroundMode& backgroundMode );/// Gets the paddingValue parameter./// The background value, used only in fixed background mode.double paddingValue()const;/// Sets the paddingValue parameter./// The background value, used only in fixed background mode.void setPaddingValue(constdouble& paddingValue );/// Gets the outputImage parameter./// The output image. Its dimensions and type are forced to the same values as the input.
std::shared_ptr< iolink::ImageView> outputImage()const;/// Sets the outputImage parameter./// The output image. Its dimensions and type are forced to the same values as the input.void setOutputImage( std::shared_ptr< iolink::ImageView> outputImage );// Method to launch the command.void execute();
# Property of the inputImage parameter.TranslateImage3d.input_image
# Property of the translationVector parameter.TranslateImage3d.translation_vector
# Property of the backgroundMode parameter.TranslateImage3d.background_mode
# Property of the paddingValue parameter.TranslateImage3d.padding_value
# Property of the outputImage parameter.TranslateImage3d.output_image
// Method to launch the command.
execute()
// Command constructor.TranslateImage3d()// Property of the inputImage parameter.TranslateImage3d.inputImage
// Property of the translationVector parameter.TranslateImage3d.translationVector
// Property of the backgroundMode parameter.TranslateImage3d.backgroundMode
// Property of the paddingValue parameter.TranslateImage3d.paddingValue
// Property of the outputImage parameter.TranslateImage3d.outputImage
// Method to launch the command.Execute()
Parameters
Parameter Name
Description
Type
Supported Values
Default Value
inputImage
The input image.
Image
Binary, Label, Grayscale or Multispectral
nullptr
translationVector
The translation vector in voxels.
Vector3i32
Any value
{100, 100, 100}
backgroundMode
The mode for managing outside information.
FIXED
The information outside of the image area is lost, and a value is assigned to the otherwise blank area.
LOOPED
The image is perceived as a cylinder, where the information outside the image area wraps around and is placed in the blank part.
Enumeration
FIXED
paddingValue
The background value, used only in fixed background mode.
Float64
Any value
1
outputImage
The output image. Its dimensions and type are forced to the same values as the input.
Image
nullptr
Parameter Name
Description
Type
Supported Values
Default Value
input_image
The input image.
image
Binary, Label, Grayscale or Multispectral
None
translation_vector
The translation vector in voxels.
vector3i32
Any value
[100, 100, 100]
background_mode
The mode for managing outside information.
FIXED
The information outside of the image area is lost, and a value is assigned to the otherwise blank area.
LOOPED
The image is perceived as a cylinder, where the information outside the image area wraps around and is placed in the blank part.
enumeration
FIXED
padding_value
The background value, used only in fixed background mode.
float64
Any value
1
output_image
The output image. Its dimensions and type are forced to the same values as the input.
image
None
Parameter Name
Description
Type
Supported Values
Default Value
inputImage
The input image.
Image
Binary, Label, Grayscale or Multispectral
null
translationVector
The translation vector in voxels.
Vector3i32
Any value
{100, 100, 100}
backgroundMode
The mode for managing outside information.
FIXED
The information outside of the image area is lost, and a value is assigned to the otherwise blank area.
LOOPED
The image is perceived as a cylinder, where the information outside the image area wraps around and is placed in the blank part.
Enumeration
FIXED
paddingValue
The background value, used only in fixed background mode.
Float64
Any value
1
outputImage
The output image. Its dimensions and type are forced to the same values as the input.