buffer_area | R Documentation |
Buffers the area of a polygon.
buffer_area(df, buffer, close_plg = TRUE)
df |
Data.frame with variables x and y describing the
vertices of the polygon that encircles the area based on which the barcode-spots
are binned. E.g. slot @area of |
buffer |
The distance by which to consecutively expand the
area that covers the image annotation screening. Given to argument
|
library(ggplot2)
object <- downloadSpataObject("313_T")
object <- setImageAnnotation(object, img_ann = image_annotations[["313_T"]][["necrotic_center"]])
outline1 <- getImgAnnOutlineDf(object, ids = "necrotic_center")
print(outline1)
outline2 <- buffer_area(outline1, buffer = 20)
print(outline2)
plotSurface(object) +
geom_polygon(data = outline1, mapping = aes(x = x, y = y), color = "black", fill = NA, size = 2) +
geom_polygon(data = outline2, mapping = aes(x = x, y = y), color = "red" , fill = NA, size = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.