expandSpatialAnnotation.Rd
Expands or shrinks the outer outline of a spatial annotation.
expandSpatialAnnotation(object, id, expand, new_id = FALSE, overwrite = FALSE)
An object of class SPATA2
or, in case of S4 generics,
objects of classes for which a method has been defined.
Character value. The ID of the spatial annotation of interest.
Distance measure with which to expand the border. Negative values shrink the outline.
Character value or FALSE
. If character, the resulting
spatial annotation is stored under a new ID.
Logical value. Must be TRUE
to allow overwriting.
The updated input object, containing the added, removed or computed results.
library(SPATA2)
library(tidyverse)
data("example_data")
object <- loadExampleObject("UKF275T")
plotImage(object) + ggpLayerSpatAnnOutline(object, ids = "vessel1", line_color = "red")
plotSpatialAnnotations(object, "vessel1")
object <- expandSpatialAnnotation(object, id = "vessel1", expand = "50um", new_id = "vessel1_exp")
plotSpatialAnnotations(object, ids = c("vessel1", "vessel1_exp"))