distmap.owin {spatstat}R Documentation

Distance Map of Window

Description

Computes the distance from each pixel to the nearest point in the given window.

Usage

  ## S3 method for class 'owin':
  distmap(X, ...)

Arguments

X A window (object of class "owin").
... Arguments passed to as.mask to control pixel resolution.

Details

The ``distance map'' of a window W is the function f whose value f(u) is defined for any two-dimensional location u as the shortest distance from u to W.

This function computes the distance map of the window X and returns the distance map as a pixel image. The greyscale value at a pixel u equals the distance from u to the nearest pixel in X.

Additionally, the return value has an attribute "bdry" which is also a pixel image. The grey values in "bdry" give the distance from each pixel to the bounding rectangle of the image.

If the window X is not already a pixellated window (a binary image mask), it is converted into one. The arguments ... control the pixel resolution in this case, but will otherwise be ignored.

This function is a method for the generic distmap.

Value

A pixel image (object of class "im") whose greyscale values are the values of the distance map. The return value has an attribute "bdry" which is a pixel image.

Author(s)

Adrian Baddeley adrian@maths.uwa.edu.au http://www.maths.uwa.edu.au/~adrian/ and Rolf Turner rolf@math.unb.ca http://www.math.unb.ca/~rolf

See Also

distmap, distmap.ppp

Examples

  data(letterR)
  U <- distmap(letterR)
  ## Not run: 
  plot(U)
  plot(attr(U, "bdry"))
  
## End(Not run)

[Package spatstat version 1.11-3 Index]