psp2mask | R Documentation |
Converts a line segment pattern to a binary pixel mask by determining which pixels intersect the lines.
psp2mask(x, W=NULL, ...)
as.mask.psp(x, W=NULL, ...)
x |
Line segment pattern (object of class |
W |
Optional window (object of class |
... |
Optional extra arguments passed to |
The functions psp2mask
and as.mask.psp
are currently
identical. In future versions of the package, as.mask.psp
will be deprecated, and then removed.
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.
A window (object of class "owin"
)
which is a binary pixel mask (type "mask"
).
and \rolf
pixellate.psp
,
as.mask
.
Use pixellate.psp
if you want to measure the
length of line in each pixel.
X <- psp(runif(10), runif(10), runif(10), runif(10), window=owin())
plot(psp2mask(X))
plot(X, add=TRUE, col="red")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.