Extracts the image as an object of class Image as specified in the package EBImage.

getImage(object, ...)

# S4 method for class 'SPATA2'
getImage(
  object,
  img_name = activeImage(object),
  xrange = NULL,
  yrange = NULL,
  expand = 0,
  transform = TRUE,
  scale_fct = 1,
  ...
)

# S4 method for class 'SpatialData'
getImage(
  object,
  img_name = activeImage(object),
  xrange = NULL,
  yrange = NULL,
  expand = 0,
  transform = TRUE,
  scale_fct = 1,
  ...
)

# S4 method for class 'HistoImage'
getImage(
  object,
  xrange = NULL,
  yrange = NULL,
  expand = 0,
  transform = TRUE,
  scale_fct = 1,
  ...
)

Arguments

object

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

...

Used to absorb deprecated arguments or functions.

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().

xrange, yrange

Distance vector of length two or NULL. If not NULL, specifies the x- and y-range to which the spatial output is cropped. E.g. xrange = c(200, 500) results in the two dimensional space being cropped from x-coordinate 200px up to x-coordinate 500px. If NULL, the original range is used.

expand

Specifies image expansion. An image that is cropped based on an image annotation centers around the image annotation. If expand = 0, the default, the dimensions of the image, that is width/x-axis and height/y-axis, are set to include only the image annotation area and nothing more. Using expand, the cropped image section can be adjusted. See section Expansion of cropped image sections for more information.

transform

Logical value. Ignored if no images exist in the object. If TRUE, spatial transformation instructions saved during image alignment of the image img_name are applied. Only relevant if there are any images registered in the SPATA2 object.

Value

Object of class Image.