Skip to contents

Add a layer to a project

Usage

sg_roi_add_layer(project, layer, call = rlang::caller_env())

Arguments

project

An sg_roi_project.

layer

An sg_roi_layer with a name not already used in the project.

call

The calling environment, for error reporting.

Value

A new sg_roi_project with the layer added. The input is unchanged.

Examples

proj <- sg_roi_project(sg_roi_frame(c(20, 20)))
proj <- sg_roi_add_layer(proj, sg_roi_layer("tissue"))
names(proj$layers)
#> [1] "tissue"