Processing math: 100%
ImageDev

RotateImage3d

Applies a rotation of a given angle on a three-dimensional image.

Access to parameter description

This algorithm rotates a 3D image of a user-defined angle (θx,θy,θz) in Euler angles notation.
The new coordinates (x,y,z) can be expressed as a function of the old coordinates (x,y,z): [xyz]=Rx(θx)Ry(θy)Rz(θz)[xyz] where: Rx(θ)=[1000cosθsinθ0sinθcosθ] Ry(θ)=[cosθ0sinθ010sinθ0cosθ] Rz(θ)=[cosθsinθ0sinθcosθ0001] See also

Function Syntax

This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > rotateImage3d( std::shared_ptr< iolink::ImageView > inputImage, double rotationAngleX, double rotationAngleY, double rotationAngleZ, RotateImage3d::InterpolationType interpolationType, std::shared_ptr< iolink::ImageView > outputImage = NULL );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input grayscale image. Image Binary, Label, Grayscale or Multispectral nullptr
input
rotationAngleX
The angle of rotation in degrees for the OX axis. Float64 Any value 90
input
rotationAngleY
The angle of rotation in degrees for the OY axis. Float64 Any value 0
input
rotationAngleZ
The angle of rotation in degrees for the OZ axis. Float64 Any value 0
input
interpolationType
The interpolation mode. Method used to calculate the intensity of each pixel in the result image.
NEAREST_NEIGHBOR Assign the gray level of the nearest pixel.
LINEAR Assign the bilinear interpolation from the four nearest pixels.
Enumeration NEAREST_NEIGHBOR
output
outputImage
The output image. Its dimensions and type are forced to the same values as the input. Image nullptr

Object Examples

auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" );

RotateImage3d rotateImage3dAlgo;
rotateImage3dAlgo.setInputImage( foam );
rotateImage3dAlgo.setRotationAngleX( 90.0 );
rotateImage3dAlgo.setRotationAngleY( 0.0 );
rotateImage3dAlgo.setRotationAngleZ( 0.0 );
rotateImage3dAlgo.setInterpolationType( RotateImage3d::InterpolationType::NEAREST_NEIGHBOR );
rotateImage3dAlgo.execute();

std::cout << "outputImage:" << rotateImage3dAlgo.outputImage()->toString();

Function Examples

auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" );

auto result = rotateImage3d( foam, 90.0, 0.0, 0.0, RotateImage3d::InterpolationType::NEAREST_NEIGHBOR );

std::cout << "outputImage:" << result->toString();