Extracts the polygons necessary to outline the tissue. See vignette about tissue outline for more information.

getTissueOutlineDf(object, ...)

# S4 method for class 'SPATA2'
getTissueOutlineDf(
  object,
  method = "obs",
  img_name = activeImage(object),
  by_section = TRUE,
  section_subset = NULL,
  transform = TRUE,
  ...
)

# S4 method for class 'SpatialData'
getTissueOutlineDf(
  object,
  method = NULL,
  img_name = activeImage(object),
  by_section = TRUE,
  section_subset = NULL,
  transform = TRUE
)

# S4 method for class 'HistoImage'
getTissueOutlineDf(
  object,
  by_section = TRUE,
  section_subset = NULL,
  transform = TRUE
)

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.

method

Character value. Either 'obs' or 'image'. Decides whether the tissue outline used based on the observations or the image is used. If method = NULL, the function checks first if any HistoImage is registered. If so, the outline from the image specified with img_name is returned. If there are no images, the outline computed with identifyTissueOutline(..., method = 'obs') is used.

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

by_section

Logical value. If TRUE, the outline is used which acknowledges the potential for multiple tissue sections. If FALSE, the outline is used which simply outlines everything with one single polygon.

section_subset

Character vector or NULL. If character, specifies the tissue sections of interest and filters the output accordingly.

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

Data.frame of vertices with x- and y-coordinates. If by_section = TRUE, the data.frame contains an additional variable which indicates the tissue section which the polygon to which the vertex belongs outlines.