Skip to contents

Add an ROI to a layer

Usage

at_layer_add(layer, roi, call = rlang::caller_env())

Arguments

layer

An annot_layer.

roi

An annot_roi.

call

The calling environment, for error reporting.

Value

A new annot_layer with the ROI appended. The label vocabulary and colour mapping are extended if the ROI introduces a new label. A colliding ROI identifier is re-minted to preserve uniqueness. The input is unchanged.

Examples

lyr <- at_layer("tumour", labels = "tumour")
lyr <- at_layer_add(lyr, at_roi_rect(0, 0, 10, 10, label = "tumour"))
at_layer_n(lyr)
#> [1] 1