distmap | R Documentation |
Compute the distance map of an object, and return it as a pixel image. Generic.
distmap(X, ...)
X |
Any suitable dataset representing a two-dimensional
object, such as a point pattern (object of class |
... |
Arguments passed to |
The “distance map” of a set of points A
is the function
f
whose value f(x)
is defined for any two-dimensional
location x
as the shortest distance from x
to A
.
This function computes the distance map of the set X
and returns the distance map as a pixel image.
This is generic. Methods are provided for
point patterns (distmap.ppp
),
line segment patterns (distmap.psp
)
and windows (distmap.owin
) as well as other classes.
A pixel image (object of class "im"
) whose grey scale values
are the values of the distance map.
The pixel values in the image distmap(X)
are distances,
expressed as multiples of the unit of length of the spatial
coordinates in X
.
The unit of length is given by unitname(X)
.
Note that, if the unit of length in X
is a composite expression
such as ‘2 microns’,
then the values in distmap(X)
are expressed as multiples
of 2 microns, rather than being expressed in microns.
and \rolf
distmap.ppp
,
distmap.psp
,
distmap.owin
,
distfun
U <- distmap(cells)
V <- distmap(letterR)
if(interactive()) {
plot(U)
plot(V)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.