Skip to content

Dilation and Window Definition in Spatstat

2 messages · Rolf Turner, Adrian Baddeley

#
It is hard to tell without reproducible code, but I suspect (since you 
use the word
"dilate") that you have used the function dilation() and are not getting 
the window
that you think you are getting.  Try:

     W <- owin(poly=as.owin(demopat)$bdry[[1]])
     WD <- dilation(W,100)
     set.seed(42)
     X <- runifpoint(100,WD)
     plot(X)

and you will see what I mean.

You *probably* want to use expand.owin().

     cheers,

     Rolf Turner
On 11/01/13 04:40, Ted Rosenbaum wrote:
#
In spatstat 1.34-0 there appears to be a bug in union.owin which also affects dilation.owin.

A fix will be distributed shortly.

Until this is fixed, the fastest way to do what you want is to convert the window
 to a pixel mask (using as.mask) before applying the dilation.

Adrian Baddeley 

Prof Adrian Baddeley FAA
University of Western Australia  /and/ CSIRO Mathematics, Informatics & Statistics
Mail: <cet.uwa.edu.au>             Skype: adrian.baddeley
________________________________________
On 11/01/13 04:40, Ted Rosenbaum wrote: