Skip to contents

Build a band straddling an ROI's boundary – the natural shape for a "penumbra" region along an injury or wound margin. The ring extends outer units outside the boundary and inner units inside it, formed as the set difference of the outward and inward buffers.

Usage

sg_roi_ring(
  roi,
  outer,
  inner = 0,
  label = roi$label,
  call = rlang::caller_env()
)

Arguments

roi

An sg_roi.

outer

Non-negative outward width (dilation) of the ring.

inner

Non-negative inward width (erosion) of the ring. Default 0, a purely external band.

label

Label for the derived ring ROI. Default the source ROI's label.

call

The calling environment, for error reporting.

Value

A derived sg_roi (an annulus) with source = "derived".

Examples

inj <- sg_roi_rect(10, 10, 20, 20, label = "injury")
sg_roi_ring(inj, outer = 3, label = "penumbra")
#> <sg_roi> penumbra (POLYGON)
#> id: "roi_000000044"  |  level: 0  |  source: derived
#> bbox: [7, 7] - [23, 23]