AnnotatedImage-class {Cardinal} | R Documentation

## AnnotatedImage: Optical images with annotations

### Description

`AnnotatedImage` extends the `Image` class from the `EBImage` package with metadata columns and plotting in arbitrary coordinate systems. This facilitates annotations such as region-of-interest labeling, and plotting with axes reflective of real-world coordinates.

### Usage

    AnnotatedImage(data = array(0, dim=c(1,1)), dim, colormode, ...)

### Arguments

`data` | A vector or array with pixel intensities of an image.
`dim` | The final dimensions of the image.
`colormode` | Either 'Grayscale' or 'Color'.
`...` | Additional arguments passed to the constructor. May be used to set the `offset` or `resolution` slots.

### Details

`AnnotatedImage` is extends `Image`, so all methods defined on that class also work here.

Metadata columns with annotations can be set via `mcols()`. The object's `length` is defined as the product of the first two dimensions. It is assumed any additional frames represent different measurement channels on the same spatial locations.

`AnnotatedImage` also facilitates integration with other imaging data such as a `SparseImagingExperiment` or `MSImagingExperiment` by allowing plotting of the image on arbitrary coordinate systems. This is controlled via an `offset` slot designating the absolute position of the top-left corner of the image in the current plotting coordinates. The height and width of the image (as plotted) are then controlled by its `resolution`. This is most easily changed by setting the `height()` and `width()` of the object.

### Slots

`.Data`:

  An array with the image data.

`offset`:

  The absolute offset of the x/y position of the top-left corner of the image when plotted.

`resolution`:

  The absolute offset of the x/y position of the top-left corner of the image when plotted.

`colormode`:

  The color mode of the image. Either 'Grayscale' or 'Color'.

`elementMetadata`:

  An optional `DataFrame` containing pixel-level annotations.

`metadata`:

  A `list` containing general metadata (such as filename, etc.).

### Methods

All methods for `Image` also work on `AnnotatedImage` objects. Additional methods are documented below:

`mcols(x)`, `mcols(x) <- value`:

  Get or set the metadata columns.

`coord(object)`, `coord(object) <- value`:

  Get or set the absolute offset of the top-left corner of the image.

`resolution(object)`, `resolution(object) <- value`:

  Get or set the pixel resolution of the image. This corresponds to the number of pixels per unit step on the x/y axes when plotted.

`height(x)`, `height(x) <- value`:

  Get or set the height of the image (as plotted).

`width(x)`, `width(x) <- value`:

  Get or set the width of the image (as plotted).

### Author(s)

Kylie A. Bemis

### See Also

`Image`

[Package Cardinal version 2.12.0 Index]