Skip to contents

Nearest-neighbour downsample only (interpolating a label mask would invent labels that do not exist).

Usage

sg_roi_mask_preview(mask, max_dim = 1024L, call = rlang::caller_env())

Arguments

mask

An sg_roi_mask.

max_dim

Integer maximum dimension of the preview. Default 1024.

call

The calling environment, for error reporting.

Value

A downsampled sg_roi_mask with the legend pixel counts recomputed.

Examples

lyr <- sg_roi_layer_add(sg_roi_layer("tissue"),
                        sg_roi_rect(20, 20, 80, 80, label = "tissue"))
m <- sg_roi_mask(sg_roi_project(sg_roi_frame(c(100, 100)), lyr), "labelled")
dim(sg_roi_mask_preview(m, max_dim = 25))
#> [1] 25 25