Union of Discs

Share:

Description

Make a spatial region composed of discs with given centres and radii.

Usage

1
2
3
  discs(centres, radii = marks(centres)/2, ...,
        separate = FALSE, mask = FALSE, trim = TRUE,
        delta = NULL, npoly=NULL)

Arguments

centres

Point pattern giving the locations of centres for the discs.

radii

Vector of radii for each disc, or a single number giving a common radius. (Notice that the default assumes that the marks of X are diameters.)

...

Optional arguments passed to as.mask to determine the pixel resolution, if mask=TRUE.

separate

Logical. If TRUE, the result is a list containing each disc as a separate entry. If FALSE (the default), the result is a window obtained by forming the union of the discs.

mask

Logical. If TRUE, the result is a binary mask window. If FALSE, the result is a polygonal window. Applies only when separate=FALSE.

trim

Logical value indicating whether to restrict the result to the original window of the centres. Applies only when separate=FALSE.

delta

Argument passed to disc to determine the tolerance for the polygonal approximation of each disc. Applies only when mask=FALSE. Incompatible with npoly.

npoly

Argument passed to disc to determine the number of edges in the polygonal approximation of each disc. Applies only when mask=FALSE. Incompatible with delta.

Details

This command is typically applied to a marked point pattern dataset X in which the marks represent the sizes of objects. The result is a spatial region representing the space occupied by the objects.

If the marks of X represent the diameters of circular objects, then the result of discs(X) is a spatial region constructed by taking discs, of the specified diameters, centred at the points of X, and forming the union of these discs. If the marks of X represent the areas of objects, one could take discs(X, sqrt(marks(X)/pi)) to produce discs of equivalent area.

A fast algorithm is used to compute the result as a binary mask, when mask=TRUE. This option is recommended unless polygons are really necessary.

If mask=FALSE, the discs will be constructed as polygons by the function disc. To avoid computational problems, by default, the discs will all be constructed using the same physical tolerance value delta passed to disc. The default is such that the smallest disc will be approximated by a 16-sided polygon. (The argument npoly should not normally be used, to avoid computational problems arising with small radii.)

Value

If separate=FALSE, a window (object of class "owin").

If separate=TRUE, a list of windows.

Author(s)

\spatstatAuthors

.

See Also

disc, union.owin

Examples

1
  plot(discs(anemones, mask=TRUE, eps=0.5))

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.