ImageDev

Flip2d

Flips X or Y or X and Y coordinates of a two-dimensional image.

Access to parameter description

This algorithm generates an output image according to the selected flip mode, as explained in the flipMode parameter description.

See also

Function Syntax

This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > flip2d( std::shared_ptr< iolink::ImageView > inputImage, Flip2d::FlipMode flipMode, std::shared_ptr< iolink::ImageView > outputImage = nullptr );
This function returns outputImage.
// Function prototype.
flip_2d(input_image: idt.ImageType,
        flip_mode: Flip2d.FlipMode = Flip2d.FlipMode.X_FLIP,
        output_image: idt.ImageType = None) -> idt.ImageType
This function returns outputImage.
// Function prototype.
public static IOLink.ImageView
Flip2d( IOLink.ImageView inputImage,
        Flip2d.FlipMode flipMode = ImageDev.Flip2d.FlipMode.X_FLIP,
        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
flipMode
The flip operation type.
X_FLIP The transformation flips the X coordinates of the input image. The result is given by: $$ O(x,y)=I(Sx-1-x,y) $$ where Sx is the X image size.
Y_FLIP The transformation flips the Y coordinates of the input image. The result is given by: $$ O(x,y)=I(x,Sy-1-y) $$ where Sy is the Y image size.
XY_FLIP The transformation flips the X and Y coordinates of the input image. The result is given by: $$ O(x,y)=I(Sx-1-x,Sy-1-y) $$ where Sx and Sy are the X and Y image sizes.
Enumeration X_FLIP
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
flip_mode
The flip operation type.
X_FLIP The transformation flips the X coordinates of the input image. The result is given by: $$ O(x,y)=I(Sx-1-x,y) $$ where Sx is the X image size.
Y_FLIP The transformation flips the Y coordinates of the input image. The result is given by: $$ O(x,y)=I(x,Sy-1-y) $$ where Sy is the Y image size.
XY_FLIP The transformation flips the X and Y coordinates of the input image. The result is given by: $$ O(x,y)=I(Sx-1-x,Sy-1-y) $$ where Sx and Sy are the X and Y image sizes.
enumeration X_FLIP
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
flipMode
The flip operation type.
X_FLIP The transformation flips the X coordinates of the input image. The result is given by: $$ O(x,y)=I(Sx-1-x,y) $$ where Sx is the X image size.
Y_FLIP The transformation flips the Y coordinates of the input image. The result is given by: $$ O(x,y)=I(x,Sy-1-y) $$ where Sy is the Y image size.
XY_FLIP The transformation flips the X and Y coordinates of the input image. The result is given by: $$ O(x,y)=I(Sx-1-x,Sy-1-y) $$ where Sx and Sy are the X and Y image sizes.
Enumeration X_FLIP
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" );

Flip2d flip2dAlgo;
flip2dAlgo.setInputImage( polystyrene );
flip2dAlgo.setFlipMode( Flip2d::FlipMode::X_FLIP );
flip2dAlgo.execute();

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

flip_2d_algo = imagedev.Flip2d()
flip_2d_algo.input_image = polystyrene
flip_2d_algo.flip_mode = imagedev.Flip2d.X_FLIP
flip_2d_algo.execute()

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

Flip2d flip2dAlgo = new Flip2d
{
    inputImage = polystyrene,
    flipMode = Flip2d.FlipMode.X_FLIP
};
flip2dAlgo.Execute();

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

Function Examples

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

auto result = flip2d( polystyrene, Flip2d::FlipMode::X_FLIP );

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

result = imagedev.flip_2d(polystyrene, imagedev.Flip2d.X_FLIP)

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

IOLink.ImageView result = Processing.Flip2d( polystyrene, Flip2d.FlipMode.X_FLIP );

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





© 2025 Thermo Fisher Scientific Inc. All rights reserved.