Skip to contents

Create an ROI from an existing sf geometry

Usage

at_roi_from_sf(geometry, label, level = 0L, ..., call = rlang::caller_env())

Arguments

geometry

An sf, sfc, or sfg geometry in image pixel coordinates.

label

Single string class label.

level

Integer pyramid level the coordinates refer to. Default 0.

...

Additional named attributes stored on the ROI. The reserved names author, source, and id set those fields; all others become user attributes.

call

The calling environment, for error reporting.

Value

An annot_roi wrapping the supplied geometry.

Examples

g <- sf::st_point(c(3, 4))
r <- at_roi_from_sf(g, label = "imported", source = "imported")