Add an ROI to a project layer
Usage
sg_roi_add_roi(project, layer, roi, call = rlang::caller_env())Arguments
- project
An sg_roi_project.
- layer
Single string name of the target layer.
- roi
An sg_roi.
- call
The calling environment, for error reporting.
Value
A new sg_roi_project with the ROI added to the layer. A colliding ROI identifier is re-minted to keep identifiers unique across the project. The input is unchanged.
Examples
proj <- sg_roi_project(sg_roi_frame(c(20, 20)), sg_roi_layer("tissue"))
proj <- sg_roi_add_roi(proj, "tissue", sg_roi_rect(2, 2, 8, 8, label = "tissue"))
sg_roi_rois(proj)$area_px
#> [1] 36