closeImage {beadarray} | R Documentation

## Close Image

### Description

Find the closure of a set of beads on an array.

### Usage

    closeImage(IDs, neighbours, cinvasions = 10)

### Arguments

`IDs` | IDs of beads to be closed.
`neighbours` | A Neighbours matrix - obtained from `generateNeighbours`.
`cinvasions` | The number of invasions used when dilating and eroding.

### Details

This function "closes" the set of beads supplied, as used in the `BASH` functions. It dilates (expands) the image, and then erodes (contracts) it. Each is done via an invasion process - if we let the set of beads supplied be called S, then dilation considers all neighbours of beads in S, and adds them to S. Erosion finds all beads in S with neighbours outside of S, and removes them from S.

The result of this process is to close "holes" in the group of specified beads during the dilation. These are not reopened during the erosion.

### Value

An updated vector of bead IDs (of which the argument `IDs` will be a subset).

### Author(s)

Jonathan Cairns

### See Also

`generateNeighbours`

### Examples

    data(BLData)

    ##This process is equivalent to one iteration of BASHCompact.
    ##o <- findAllOutliers(BLData,4)
    ##neighbours <- generateNeighbours(BLData,4)
    ##o.clusters <- chooseClusters(o, neighbours)
    ##o.compact <- closeImage(o.clusters, neighbours)

[Package beadarray version 1.12.1 Index]