ImageDev

TransposeImage2d

Swaps coordinates of a two-dimensional image.

Access to parameter description

This algorithm performs a transposition of the image grid along both the X and Y axes. It effectively flips the input image $I$ from left to right and rotates it $90^\circ$ counterclockwise. $$ O(n,m) = I(m,n)$$ See also

Function Syntax

This function returns the outputImage output parameter.
// Function prototype.
std::shared_ptr< iolink::ImageView >
transposeImage2d( std::shared_ptr< iolink::ImageView > inputImage, std::shared_ptr< iolink::ImageView > outputImage = NULL );
This function returns the outputImage output parameter.
// Function prototype.
transpose_image_2d( input_image, output_image = None )
This function returns the outputImage output parameter.
// Function prototype.
public static IOLink.ImageView
TransposeImage2d( IOLink.ImageView inputImage, IOLink.ImageView outputImage = null );

Class Syntax

Parameters

Class Name TransposeImage2d

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Binary, Label, Grayscale or Multispectral nullptr
output
outputImage
The output image. Its type is forced to the same values as the input. Its X and Y dimensions are switched. Image nullptr

Object Examples

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

TransposeImage2d transposeImage2dAlgo;
transposeImage2dAlgo.setInputImage( polystyrene );
transposeImage2dAlgo.execute();

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

transpose_image_2d_algo = imagedev.TransposeImage2d()
transpose_image_2d_algo.input_image = polystyrene
transpose_image_2d_algo.execute()

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

TransposeImage2d transposeImage2dAlgo = new TransposeImage2d
{
    inputImage = polystyrene
};
transposeImage2dAlgo.Execute();

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

Function Examples

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

auto result = transposeImage2d( polystyrene );

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

result = imagedev.transpose_image_2d( polystyrene )

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

IOLink.ImageView result = Processing.TransposeImage2d( polystyrene );

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