Learn R Programming

spatstat.geom (version 3.7-0)

levelset.distfun: Level Set of a Distance Function

Description

Given a distance function, find the spatial region where the function value is less than a specified threshold value (or greater than a threshold, etc),

Usage

# S3 method for distfun
levelset(X, thresh, compare="

Value

A spatial window (object of class "win").

Arguments

X

Object of class "distfun" representing the distance function of a spatial object.

thresh

Single numeric value of distance, defining the level set.

compare

Character string specifying one of the comparison operators "<", ">", "==", "<=", ">=", "!=".

...

Arguments passed to as.mask if it is necessary to convert the result to a binary mask.

Author

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner rolfturner@posteo.net and Ege Rubak rubak@math.aau.dk.

Details

This is a method for the generic function levelset which computes level sets of a spatial variable.

A distance function (object of class "distfun" created by distfun) is a function of spatial location which measures the distance to a given spatial object.

If f <- distfun(B), where B is some object, then the level set of f consisting of all spatial locations u where f(u) <= thresh, is simply the dilation of the original object B by a distance equal to thresh. The command levelset(X, thresh) computes this dilation as a spatial window.

In some cases the object must be converted to a binary pixel mask and the computation performed by levelset.im. In that case, any arguments ... are passed to as.mask to determine the pixel resolution.

See Also

distfun, methods.distfun, levelset

Examples

Run this code
  f <- distfun(cells)
  V <- levelset(f, 0.05)
  plot(V)
  plot(cells, add=TRUE)

Run the code above in your browser using DataLab