Reconstruct polygon from point pattern density
Source:R/reconstructShapePPP.R
reconstructShapeDensity.Rd
This function estimates the density of a spatial point pattern (ppp
),
thresholds the density to create a binary image, and then converts it
to a valid sf
object (polygons).
Examples
spe <- imcdatasets::Damond_2019_Pancreas("spe", full_dataset = FALSE)
#> see ?imcdatasets and browseVignettes('imcdatasets') for documentation
#> loading from cache
ppp <- SPE2ppp(spe, marks = "cell_category", image_col = "image_name", image_id = "E04")
thres <- findIntensityThreshold(ppp, mark_select = "islet", dim = 500)
islet_poly <- reconstructShapeDensity(ppp, mark_select = "islet", thres = thres, dim = 500)
plot(islet_poly)