# laslett

##### Laslett's Transform

Apply Laslett's Transform to a spatial region, returning the original and transformed regions, and the original and transformed positions of the lower tangent points. This is a diagnostic for the Boolean model.

##### Usage

```
laslett(X, …, verbose = FALSE, plotit = TRUE, discretise = FALSE,
type=c("lower", "upper", "left", "right"))
```

##### Arguments

- X
Spatial region to be transformed. A window (object of class

`"owin"`

) or a logical-valued pixel image (object of class`"im"`

).- …
Graphics arguments to control the plot (passed to

`plot.laslett`

when`plotit=TRUE`

) or arguments determining the pixel resolution (passed to`as.mask`

).- verbose
Logical value indicating whether to print progress reports.

- plotit
Logical value indicating whether to plot the result.

- discretise
Logical value indicating whether polygonal windows should first be converted to pixel masks before the Laslett transform is computed. This should be set to

`TRUE`

for very complicated polygons.- type
Type of tangent points to be detected. This also determines the direction of contraction in the set transformation. Default is

`type="lower"`

.

##### Details

This function finds the lower tangent points of the spatial region `X`

,
then applies Laslett's Transform to the space,
and records the transformed positions of the lower tangent points.

Laslett's transform is a diagnostic for the Boolean Model. A test of the Boolean model can be performed by applying a test of CSR to the transformed tangent points. See the Examples.

The rationale is that, if the region `X`

was generated by a
Boolean model with convex grains, then the lower tangent points of
`X`

, when subjected to Laslett's transform,
become a Poisson point process (Cressie, 1993, section 9.3.5;
Molchanov, 1997; Barbour and Schmidt, 2001).

Intuitively, Laslett's transform is a way to account for the fact that
tangent points of `X`

cannot occur *inside* `X`

.
It treats the interior of `X`

as empty space, and collapses
this empty space so that only the *exterior* of `X`

remains.
In this collapsed space, the tangent points are completely random.

Formally, Laslett's transform is a random (i.e. data-dependent)
spatial transformation which maps each spatial
location \((x,y)\) to a new location \((x',y)\) at the same height
\(y\). The transformation is defined so that \(x'\)
is the total *uncovered* length of the line segment from \((0,y)\) to
\((x,y)\), that is, the total length of the parts of this segment that
fall outside the region `X`

.

In more colourful terms, suppose we use an abacus to display a
pixellated version of `X`

. Each wire of the abacus represents one
horizontal line in the pixel image. Each pixel lying *outside*
the region `X`

is represented by a bead of the abacus; pixels
*inside* `X`

are represented by the absence of a bead. Next
we find any beads which are lower tangent points of `X`

, and
paint them green. Then Laslett's Transform is applied by pushing all
beads to the left, as far as possible. The final locations of all the
beads provide a new spatial region, inside which is the point pattern
of tangent points (marked by the green-painted beads).

If `plotit=TRUE`

(the default), a before-and-after plot is
generated, showing the region `X`

and the tangent points
before and after the transformation. This plot can also be generated
by calling `plot(a)`

where `a`

is the object returned by
the function `laslett`

.

If the argument `type`

is given, then this determines the
type of tangents that will be detected, and also the direction of
contraction in Laslett's transform. The computation is performed
by first rotating `X`

, applying Laslett's transform for lower
tangent points, then rotating back.

There are separate algorithms for polygonal windows and
pixellated windows (binary masks). The polygonal algorithm may be slow
for very complicated polygons. If this happens, setting
`discretise=TRUE`

will convert the polygonal window to a binary
mask and invoke the pixel raster algorithm.

##### Value

A list, which also belongs to the class `"laslett"`

so that it can immediately be printed and plotted.

The list elements are:

- oldX:
the original dataset

`X`

;- TanOld:
a point pattern, whose window is

`Frame(X)`

, containing the lower tangent points of`X`

;- TanNew:
a point pattern, whose window is the Laslett transform of

`Frame(X)`

, and which contains the Laslett-transformed positions of the tangent points;- Rect:
a rectangular window, which is the largest rectangle lying inside the transformed set;

- df:
a data frame giving the locations of the tangent points before and after transformation.

- type:
character string specifying the type of tangents.

##### References

Barbour, A.D. and Schmidt, V. (2001)
On Laslett's Transform for the Boolean Model.
*Advances in Applied Probability*
**33**(1), 1--5.

Cressie, N.A.C. (1993)
*Statistics for spatial data*, second edition.
John Wiley and Sons.

Molchanov, I. (1997)
*Statistics of the Boolean Model for Practitioners and Mathematicians*.
Wiley.

##### See Also

##### Examples

```
# NOT RUN {
a <- laslett(heather$coarse)
with(a, clarkevans.test(TanNew[Rect], correction="D", nsim=39))
X <- discs(runifpoint(15) %mark% 0.2, npoly=16)
b <- laslett(X, type="left")
b
# }
```

*Documentation reproduced from package spatstat, version 1.61-0, License: GPL (>= 2)*