S4 class that represents annotations for spatial data, allowing users to define and store polygons that outline areas of interest within images or datasets. It serves as the overarching class for different spatial annotation methods.

Details

The following classes are derivatives of this class: GroupAnnotation, ImageAnnotation, NumericAnnotation

Slots

area

list. A named list of data.frames with the numeric variables x_orig and y_orig. Observations correspond to the vertices of the polygons that are needed to represent the spatial annotation. Must contain a slot named outer which sets the outer border of the spatial annotation. Can contain multiple slots named inner (suffixed) with numbers that correspond to inner polygons - holes within the annotation.

Upon extraction via getSpatAnnOutlineDf() or extraction of the whole annotation via getSpatialAnnotation() and getSpatialAnnotations() the variables x and y are created by scaling x_orig and y_orig to the current resolution of the active image to ensure alignment. This is achieved by using the coords scale factor of the listslot @scale_factors of the HistoImage object of the active image.

id

character. String to identify the object in a list of multiple objects of the same class.

image

A cropped version of an image that focuses solely on the area containing the annotation, along with an expansion margin. This slot is designed to remain empty until the annotation object is explicitly extracted or used, contributing to efficient data storage. Extraction through functions like getSpatialAnnotation() or getSpatialAnnotation() populates this slot with the cropped image. The parameters used for cropping the image are stored in the @image_info slot.

image_info

A list containing information related to the image stored in the @image slot. This information pertains to the cropped image obtained and set using functions like getSpatialAnnotation() or getSpatialAnnotations(). It serves as metadata around the cropped image and may include parameters or details about the cropping process.

misc

list. A flexible list for miscellaneous input such as meta data or to implement new ideas..

sample

Character string. The sample to which the annotation belongs.

tags

character. Vector of arbitrary length. Contains tags that can be used to group and select spatial annotations in different manners.

version

A list of three slots denoting the version of SPATA2 under which the object has been created.

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.

See also

The following functions can be used to create spatial annotations: