Skip to contents

Return a tidy table of ROIs, optionally filtered by layer and/or label.

Usage

at_rois(project, layer = NULL, label = NULL, call = rlang::caller_env())

Arguments

project

An annot_project.

layer

Optional single layer name to filter to.

label

Optional character vector of labels to filter to.

call

The calling environment, for error reporting.

Value

A tibble::tibble with one row per ROI and, in this exact order, the columns:

roi_id

Unique identifier (character).

layer

Layer name (character).

label

Class label (character).

geom_type

Geometry type, e.g. "POLYGON" (character).

level

Reference pyramid level (integer).

area_px

Area in level-0 pixels (double); NA for points/lines.

centroid_x,centroid_y

Centroid at level 0 (double).

n_vertices

Vertex count (integer).

created,modified

Timestamps (POSIXct).

author

Author (character).

source

Provenance source (character).

geometry

The sf geometry column (sfc), at level 0.

Returns a 0-row tibble with these columns if no ROIs match.

Details

Coordinates in the geometry column, together with area_px and the centroid, are expressed at pyramid level 0; the level column records the level at which each ROI was originally defined.

Examples

# proj <- at_example_project()
# at_rois(proj)