Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

as.mask.psp

Convert Line Segment Pattern to Binary Pixel Mask


Description

Converts a line segment pattern to a binary pixel mask by determining which pixels intersect the lines.

Usage

as.mask.psp(x, W=NULL, ...)

Arguments

x

Line segment pattern (object of class "psp").

W

Optional window (object of class "owin") determining the pixel raster.

...

Optional extra arguments passed to as.mask to determine the pixel resolution.

Details

This function converts a line segment pattern to a binary pixel mask by determining which pixels intersect the lines.

The pixel raster is determined by W and the optional arguments .... If W is missing or NULL, it defaults to the window containing x. Then W is converted to a binary pixel mask using as.mask. The arguments ... are passed to as.mask to control the pixel resolution.

Value

A window (object of class "owin") which is a binary pixel mask (type "mask").

Author(s)

and Rolf Turner r.turner@auckland.ac.nz

See Also

Use pixellate.psp if you want to measure the length of line in each pixel.

Examples

X <- psp(runif(10), runif(10), runif(10), runif(10), window=owin())
  plot(as.mask.psp(X))
  plot(X, add=TRUE, col="red")

spatstat.geom

Geometrical Functionality of the 'spatstat' Family

v2.1-0
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Tilman Davies [ctb], Ute Hahn [ctb], Abdollah Jalilian [ctb], Sebastian Meyer [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Waagepetersen [ctb]
Initial release
2021-04-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.