Extracts the coordinates of the vertices polygons that represent the borders of the image annotation.

getImgAnnBorderDf(...)

getImageAnnotationAreaDf(...)

getImgAnnOutlineDf(
  object,
  ids = NULL,
  tags = NULL,
  test = "any",
  outer = TRUE,
  inner = TRUE,
  add_tags = FALSE,
  sep = " & ",
  last = " & "
)

Arguments

...

Used to absorb deprecated arguments or functions.

object

An object of class spata2.

ids

Character vector or NULL. If character, specifies the IDs of the image annotations of interest. If numeric, the image annotations are picked by number. If NULL, all image annotations are included - subsequent selection with tags and test is possible.

tags

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

test

Character value. One of any. all, identical, not_identical and none. Specifies how input for tags is used to select image annotations. See section Selection of image annotation with tags 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.

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 encircle the structure createImageAnnotations(). These vertices correspond to the border of the annotation.

Selection of image annotations with tags

Input for argument tags specifies the tags of interest. Argument test decides about how the specified tags are used to select the image annotations of interest. 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.

Note that the filtering process happens after the filtering by input for argument ids. You can first select a group of image annotations by naming their IDs and then select among them via tags and test. If ids is NULL, you select among all image annotations via tags and test. And if tags is also NULL, the function uses all image annoations.