https://github.com/cran/spatstat
Revision 4fe059206e698a4b7135d792f3d533b173ecfe77 authored by Adrian Baddeley on 16 May 2012, 12:44:15 UTC, committed by cran-robot on 16 May 2012, 12:44:15 UTC
1 parent df59a11
Raw File
Tip revision: 4fe059206e698a4b7135d792f3d533b173ecfe77 authored by Adrian Baddeley on 16 May 2012, 12:44:15 UTC
version 1.27-0
Tip revision: 4fe0592
as.mask.psp.Rd
\name{as.mask.psp}
\alias{as.mask.psp}
\title{
  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{
  \item{x}{
    Line segment pattern (object of class \code{"psp"}).
  }
  \item{W}{
    Optional window (object of class \code{"owin"})
    determining the pixel raster.
  }
  \item{\dots}{
    Optional extra arguments passed to \code{\link{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 \code{W}
  and the optional arguments \code{\dots}.
  If \code{W} is missing or \code{NULL}, it defaults to the window
  containing \code{x}.
  Then \code{W} is converted to a
  binary pixel mask using \code{\link{as.mask}}. The arguments
  \code{\dots} are passed to \code{\link{as.mask}} to
  control the pixel resolution.
}
\value{
  A window (object of class \code{"owin"})
  which is a binary pixel mask (type \code{"mask"}).
}
\seealso{
  \code{\link{pixellate.psp}},
  \code{\link{as.mask}}.

  Use \code{\link{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")
}
\author{Adrian Baddeley
  \email{Adrian.Baddeley@csiro.au}
  \url{http://www.maths.uwa.edu.au/~adrian/}
  and Rolf Turner
  \email{r.turner@auckland.ac.nz}
}
\keyword{spatial}
\keyword{manip}

back to top