Layer ROI table
Usage
sg_roi_layer_rois(layer, image = NULL, call = rlang::caller_env())Arguments
- layer
An sg_roi_layer.
- image
Optional sg_roi_frame for accurate level-0 coordinate transforms.
- call
The calling environment, for error reporting.
Value
An ROI table (see sg_roi_rois() for the column contract). A 0-row table
with the same columns when the layer has no ROIs.
See also
Other layers:
sg_roi_layer(),
sg_roi_layer_add(),
sg_roi_layer_n(),
sg_roi_layer_remove(),
sg_roi_style()
Examples
lyr <- sg_roi_layer_add(sg_roi_layer("tissue"),
sg_roi_rect(0, 0, 4, 4, label = "tumour"))
lyr <- sg_roi_layer_add(lyr, sg_roi_rect(5, 5, 8, 8, label = "stroma"))
sg_roi_layer_rois(lyr)[, c("label", "area_px")]
#> # A tibble: 2 × 2
#> label area_px
#> <chr> <dbl>
#> 1 tumour 16
#> 2 stroma 9