Remove an ROI from a layer
Usage
sg_roi_layer_remove(layer, id, call = rlang::caller_env())Arguments
- layer
An sg_roi_layer.
- id
Single string ROI identifier.
- call
The calling environment, for error reporting.
Value
A new sg_roi_layer without the identified ROI. Warns if the ROI is not present and returns the layer unchanged.
See also
Other layers:
sg_roi_layer(),
sg_roi_layer_add(),
sg_roi_layer_n(),
sg_roi_layer_rois(),
sg_roi_style()
Examples
lyr <- sg_roi_layer_add(sg_roi_layer("tissue"),
sg_roi_rect(0, 0, 4, 4, label = "tissue", id = "r1"))
sg_roi_layer_n(sg_roi_layer_remove(lyr, "r1"))
#> [1] 0