Skip to contents

Remove an ROI from a project

Usage

sg_roi_remove_roi(project, id, call = rlang::caller_env())

Arguments

project

An sg_roi_project.

id

Single string ROI identifier.

call

The calling environment, for error reporting.

Value

A new sg_roi_project without the identified ROI. Warns and returns the project unchanged if the identifier is not found.

Examples

lyr <- sg_roi_layer_add(sg_roi_layer("tissue"),
                        sg_roi_rect(2, 2, 8, 8, label = "tissue", id = "r1"))
proj <- sg_roi_project(sg_roi_frame(c(20, 20)), lyr)
nrow(sg_roi_rois(sg_roi_remove_roi(proj, "r1")))
#> [1] 0