mergeSpatialAnnotations | R Documentation |
Merges the spatial extent of two or more spatial annotations into one.
mergeSpatialAnnotations(
object,
ids,
id,
tags = NULL,
tags_expand = TRUE,
concavity = 2,
remove_old = FALSE,
overwrite = FALSE
)
object |
An object of class |
ids |
Character vector of ids from spatial annotations to merge. |
id |
Character value. The ID of the new spatial annotation that results from the merging. |
tags |
A character vector of tags for the spatial annotation. |
tags_expand |
Logical value. If |
concavity |
Numeric value. Given to argument |
remove_old |
Logical value. If |
overwrite |
Logical value. Must be |
The updated input object, containing the added, removed or computed results.
getSpatAnnIds()
library(SPATA2)
library(tidyverse)
object <- loadExampleObject("UKF275T")
r <- getSpatAnnRange(object, id = "img_ann_1")
plotImage(object) +
ggpLayerSpatAnnOutline(object, ids = c("vessel2", "img_ann_1"), use_colors = T)
plotImage(object, xrange = r$x, yrange = r$y) +
ggpLayerSpatAnnOutline(object, ids = c("vessel2", "img_ann_1"), use_colors = T)
object <-
mergeSpatialAnnotations(
object = object,
ids = c("img_ann_1", "vessel2"),
id = "new_img_ann",
)
plotSpatialAnnotations(object)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.