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

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

Arguments

roi

An annot_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 annot_roi (an annulus) with source = "derived".

Examples

inj <- at_roi_rect(10, 10, 20, 20, label = "injury")
at_roi_ring(inj, outer = 3, label = "penumbra")
#> <annot_roi> penumbra (POLYGON)
#> id: "roi_000000067"  |  level: 0  |  source: derived
#> bbox: [7, 7] - [23, 23]