The flip*() family mirror inverts the current image or coordinates of spatial aspects or everything. See details for more information.

NOTE: flipImage() only flips the image and lets everything else as is. Only use it if you want to flip the image because it is not aligned with the spatial coordinates. If you want to flip the image while maintaining alignment with the spatial aspects in the spata2 object use flipAll()!

flipAll(object, axis, verbose = FALSE)

flipCoordinates(object, axis, verbose = FALSE)

flipCoordsDf(object, axis, verbose = FALSE)

flipImage(object, axis, img_name = NULL, verbose = FALSE)

flipSpatialAnnotations(object, axis, verbose = NULL)

flipSpatialTrajectories(object, axis, verbose = NULL)

Arguments

object

An object of class SPATA2 or, in case of S4 generics, objects of classes for which a method has been defined.

axis

Character value. The axis around which the content is flipped. Either 'horizontal', 'h', 'vertical' or 'v'.

verbose

Logical. If TRUE, informative messages regarding the computational progress will be printed.

(Warning messages will always be printed.)

img_name

Character value. The name of the image of interest. If NULL, the active image is chosen by default. Either way, must be one of getImageNames().

Details

The flip*() functions can be used to flip the complete SPATA2 object or to flip single aspects.

  • flipAll(): Flips everything.

  • flipImage(): Flips only the image.

  • flipCoordinates(): Flips the coordinates data.frame, spatial annotations and spatial trajectories.

  • flipCoordsDf(): Flips the coordinates data.frame.

  • flipSpatialAnnotations(): Flips spatial annotations.

  • flipSpatialTrajectories(): Flips spatial trajectories.

Examples

library(SPATA2)
library(tidyverse)

data("example_data")

object <- example_data$object_UKF275T_diet

plotSurface(object, display_image = T)

object <- flipImage(object, axis = "h")

plotSurface(object, display_image = T)

object <- flipCoordinates(object, axis = "h")

plotSurface(object, display_image = T)

object <- flipAll(object, axis = "v")

plotSurface(object, display_image = T)