transpose: Image Transposition

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/spatial.R

Description

Transposes an image by swapping its spatial dimensions.

Usage

1

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

1
2
3
4
5
6
7
8
9
  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)

Example output

[1] TRUE

EBImage documentation built on Nov. 8, 2020, 5:41 p.m.