Add segmentation polygons to an Atera field of view, for only the cells currently present in it
Source:R/preprocessing.R
LoadAteraSegmentations.RdLoadAtera(..., segmentations = "cell") builds a Polygons
object (via sp::SpatialPolygons()) for every cell up front, which
doesn't scale to bundles with many hundreds of thousands of cells – that
machinery gets impractically slow, and can overflow R's protection stack,
well before reaching cell counts typical of a whole-tissue Atera run. This
function instead builds segmentation polygons only for the cells already
present in object[[fov]], so a bundle too large to load
segmentations for up front (LoadAtera(..., segmentations = NULL))
can still get polygons for a Cropped
region-of-interest FOV, which typically has orders of magnitude fewer
cells.