ROI area
Usage
at_roi_area(
roi,
level = 0L,
units = c("px", "physical"),
call = rlang::caller_env(),
image = NULL
)Arguments
- roi
An annot_roi.
- level
Integer pyramid level at which to express the area. Default
0.- units
Either
"px"(pixels squared, the default) or"physical". Physical area usesimagecalibration at level zero, in squaredimage$pixel_unit, and is invariant to reporting level. Unknown or pixel-only image calibration rejects. Without an image, legacy ROIpixel_size=c(x,y)is supported at stored level zero, in squared calibration units. Nonzero ROI levels require explicitpixel_size_levelandpixel_unit; differing calibration and stored levels require an image for the geometric transform. Pixel sizes must be finite and positive. Geometric area is not raster support count.- call
The calling environment, for error reporting.
- image
Optional annot_image defining actual pyramid dimensions. Required when
leveldiffers from the ROI's stored level.
Examples
at_roi_area(at_roi_rect(0, 0, 10, 5, label = "a"))
#> [1] 50