patchSize | R Documentation |
This function constructs polygons around patch cells and computes their area.
patchSize(
object,
patch_name = "patch_id",
coords = c("Pos_X", "Pos_Y"),
convex = FALSE
)
object |
a |
patch_name |
single character indicating the |
coords |
character vector of length 2 specifying the names of the
|
convex |
should the convex hull be computed to construct the polygon? Default: the concave hull is computed. |
A DataFrame object containing the patch identifier, the constructed polygon and the polygon size.
Nils Eling (nils.eling@dqbm.uzh.ch)
library(cytomapper)
data(pancreasSCE)
# Build interaction graph
pancreasSCE <- buildSpatialGraph(pancreasSCE, img_id = "ImageNb",
type = "expansion", threshold = 20)
# Detect patches of "celltype_B" cells
pancreasSCE <- patchDetection(pancreasSCE,
patch_cells = pancreasSCE$CellType == "celltype_B",
expand_by = 5, img_id = "ImageNb",
colPairName = "expansion_interaction_graph")
# Compute the patch area
patchSize(pancreasSCE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.