Extracts the coordinates of the vertices of the polygon that represents the borders of the spatial annotation.

getSpatAnnOutlineDf(object, ...)

# S4 method for class 'SPATA2'
getSpatAnnOutlineDf(
  object,
  ids = NULL,
  class = NULL,
  tags = NULL,
  test = "any",
  outer = TRUE,
  inner = TRUE,
  incl_edge = FALSE,
  add_tags = FALSE,
  sep = " & ",
  last = " & "
)

# S4 method for class 'SpatialData'
getSpatAnnOutlineDf(
  object,
  ids = NULL,
  class = NULL,
  tags = NULL,
  test = "any",
  outer = TRUE,
  inner = TRUE,
  incl_edge = FALSE,
  add_tags = FALSE,
  sep = " & ",
  last = " & "
)

# S4 method for class 'SpatialAnnotation'
getSpatAnnOutlineDf(
  object,
  add_tags = TRUE,
  sep = " & ",
  last = " & ",
  expand_outline = NULL,
  ...
)

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.

tags

Character vector or NULL. If character, the tags for the image annotation selection. See section Selection of spatial annotations for more information.

test

Character value. One of c('any'. 'all', 'identical', 'not_identical', 'none'). Specifies how input for tags is used to select spatial annotations. See section Selection of spatial annotations for more information.

outer

Logical value. Only applies if an image annotation contains a secondary image annotation within its own area. If FALSE, the outer border of the image annotation is not included in the output.

inner

Logical value. Only applies if an image annotation contains a secondary image annotation within its own area. If FALSE, the inner borders of the image annotation are not included in the output.

incl_edge

Logical value. If TRUE, the function includes the tissue edge (see identifyTissueOutline()) in the visualization and removes the parts of the outline that transgress the tissues edge.

expand_outline

Distance measure by which the outline of the area is expanded.

Value

A data.frame that contains variables id, border, and the numeric variables x, y and tags.

Details

The variables x and y give the position of the vertices of the polygon that was drawn to used the area via createGroupAnnotations(), createImageAnnotations() or createNumericAnnotations(). These vertices correspond to the border of the annotation.

Selection of spatial annotations

Selection of spatial annotations via the arguments ids, class, tags and test works in three steps:

First, if ids is a character it prefilters the annotations by ID and only the specified ones are submitted to the next steps. If it is NULL, all annotations are submitted to the next steps.

Secondd, if class is a character it filters the annotations remaining after the first step by their class. If NULL, the step is skipped.

Third, if tags is a character it is used in combination with test to select from the spatial annotations that remain after the second step based on the meta data they are tagged with. There are multiple options:

  1. Argument test set to 'any' or 1: To be included, an image annotation must be tagged with at least one of the input tags.

  2. Argument test set to 'all' or 2: To be included, an image annotation must be tagged with all of the input tags. Can contain tags that are not specified.

  3. Argument test set to 'identical' or 3: To be included, an image annotation must be tagged with all of the input tags. Can not be tagged with anything else.

  4. Argument test set to not_identical or 4: To be included, an image annotation must not be tagged with the combination of input tags.

  5. Argument test set to 'none' or 5: To be included, an image annotation must not contain any of the input tags.

If tags is NULL, the step is skipped. Therefore, if ids, class and tags are all NULL, which is the default, all annotations are selected as all subsetting steps are skipped. Eventually, the remaining spatial annotations are submitted to whatever the respective function does.