transpose: Image Transposition

View source: R/spatial.R

transposeR Documentation

Image Transposition

Description

Transposes an image by swapping its spatial dimensions.

Usage

transpose(x)

Arguments

x

an Image object or an array.

Details

The transposition of an image is performed by swapping the X and Y indices of its array representation.

Value

A transformed version of x with its first two dimensions transposed.

Note

The function is implemented using an efficient cash-oblivious algorithm which is typically faster than R's aperm and t functions.

Author(s)

Andrzej Oles, andrzej.oles@embl.de, 2012-2017

See Also

flip, flop, rotate

Examples

  x = readImage(system.file("images", "sample-color.png", package="EBImage"))
  y = transpose(x)
  
  display(x, title='Original')
  display(y, title='Transposed')

  ## performing the transposition of an image twice should result in the original image
  z = transpose(y)
  identical(x, z)

aoles/EBImage documentation built on March 18, 2024, 4:44 a.m.