ImageDev

RotateCenterImage2d

Applies a centered rotation of a given angle on a two-dimensional image.

Access to parameter description

This command is deprecated, it will be removed in ImageDev 2024.2.
You can use Rotate2d instead.

RotateCenterImage2d performs a rotation of an image by a user-defined angle using the image center as axis of rotation.

See also

Function Syntax

This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > rotateCenterImage2d( std::shared_ptr< iolink::ImageView > inputImage, double rotationAngle, RotateCenterImage2d::InterpolationType interpolationType, std::shared_ptr< iolink::ImageView > outputImage = nullptr );
This function returns outputImage.
// Function prototype.
rotate_center_image_2d(input_image: idt.ImageType,
                       rotation_angle: float = 10,
                       interpolation_type: RotateCenterImage2d.InterpolationType = RotateCenterImage2d.InterpolationType.NEAREST_NEIGHBOR,
                       output_image: idt.ImageType = None) -> idt.ImageType
This function returns outputImage.
// Function prototype.
public static IOLink.ImageView
RotateCenterImage2d( IOLink.ImageView inputImage,
                     double rotationAngle = 10,
                     RotateCenterImage2d.InterpolationType interpolationType = ImageDev.RotateCenterImage2d.InterpolationType.NEAREST_NEIGHBOR,
                     IOLink.ImageView outputImage = null );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Binary, Label, Grayscale or Multispectral nullptr
input
rotationAngle
The angle of the rotation in degrees. Float64 Any value 10
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
Parameter Name Description Type Supported Values Default Value
input
input_image
The input image. image Binary, Label, Grayscale or Multispectral None
input
rotation_angle
The angle of the rotation in degrees. float64 Any value 10
input
interpolation_type
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
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
input
inputImage
The input image. Image Binary, Label, Grayscale or Multispectral null
input
rotationAngle
The angle of the rotation in degrees. Float64 Any value 10
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 null

Object Examples

auto polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" );

RotateCenterImage2d rotateCenterImage2dAlgo;
rotateCenterImage2dAlgo.setInputImage( polystyrene );
rotateCenterImage2dAlgo.setRotationAngle( 10.0 );
rotateCenterImage2dAlgo.setInterpolationType( RotateCenterImage2d::InterpolationType::NEAREST_NEIGHBOR );
rotateCenterImage2dAlgo.execute();

std::cout << "outputImage:" << rotateCenterImage2dAlgo.outputImage()->toString();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))

rotate_center_image_2d_algo = imagedev.RotateCenterImage2d()
rotate_center_image_2d_algo.input_image = polystyrene
rotate_center_image_2d_algo.rotation_angle = 10.0
rotate_center_image_2d_algo.interpolation_type = imagedev.RotateCenterImage2d.NEAREST_NEIGHBOR
rotate_center_image_2d_algo.execute()

print("output_image:", str(rotate_center_image_2d_algo.output_image))
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" );

RotateCenterImage2d rotateCenterImage2dAlgo = new RotateCenterImage2d
{
    inputImage = polystyrene,
    rotationAngle = 10.0,
    interpolationType = RotateCenterImage2d.InterpolationType.NEAREST_NEIGHBOR
};
rotateCenterImage2dAlgo.Execute();

Console.WriteLine( "outputImage:" + rotateCenterImage2dAlgo.outputImage.ToString() );

Function Examples

auto polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" );

auto result = rotateCenterImage2d( polystyrene, 10.0, RotateCenterImage2d::InterpolationType::NEAREST_NEIGHBOR );

std::cout << "outputImage:" << result->toString();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))

result = imagedev.rotate_center_image_2d(polystyrene, 10.0, imagedev.RotateCenterImage2d.NEAREST_NEIGHBOR)

print("output_image:", str(result))
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" );

IOLink.ImageView result = Processing.RotateCenterImage2d( polystyrene, 10.0, RotateCenterImage2d.InterpolationType.NEAREST_NEIGHBOR );

Console.WriteLine( "outputImage:" + result.ToString() );