# as.mask

From spatstat v1.1-3
by Adrian Baddeley

##### Pixel Image Approximation of a Window

Obtain a discrete (pixel image) approximation of a given window

- Keywords
- spatial

##### Usage

`as.mask(w, eps=NULL, dimyx=NULL)`

##### Arguments

- w
- A window (object of class
`"owin"`

). - eps
- Width and height of a pixel.
- dimyx
- Two integers giving the pixel array dimensions

##### Details

The shape of the window `w`

will be approximated
by a binary pixel image. See `owin.object`

for
explanation of binary image masks.

The pixel raster will be an $m \times n$ rectangular grid
where $m, n$ are given by `dimyx[2], dimyx[1]`

respectively (if the argument `dimyx`

is given)
or by the constraint that
pixel widths and heights should be approximately `eps`

.
If neither `eps`

nor `dimyx`

is given,
the default is to set `eps`

equal to 1/100 of the window
width or height.

There is no inverse of this function!

##### Value

- A window (object of class
`"owin"`

) of type`"mask"`

representing a binary pixel image.

##### See Also

##### Examples

```
library(spatstat)
w <- owin(c(0,10),c(0,10), poly=list(x=c(1,2,3,2,1), y=c(2,3,4,6,7)))
plot(w)
m <- as.mask(w)
plot(m)
```

*Documentation reproduced from package spatstat, version 1.1-3, License: GPL version 2 or newer*

### Community examples

Looks like there are no examples yet.