Skip to contents

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).

Usage

reconstructShapeDensity(
  ppp,
  mark_select = NULL,
  bndw = NULL,
  thres = NULL,
  dim
)

Arguments

ppp

point pattern object of class ppp

mark_select

character; name of mark that is to be selected for the reconstruction

bndw

bandwidth of kernel density estimator

thres

intensity threshold for the reconstruction

dim

numeric; x dimension of the final reconstruction.

Value

sf object of class POLYGON

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)