Next: areaconnect, Previous: area, Up: Internal Routines [Contents][Index]

`area2, `

`bitmap`, `data` [, seed=`seeds`,
numbers=`numbers`, diagonal=`diagonal`, sign=`sign`]

`area2, `

identifies all disjoint areas in
`bitmap`, `data``long`

array

(of arbitrary dimensions) which
have elements with value one, guided by the data values in numerical
array `bitmap`

, which must have one element for each element of
`data`

. Elements with values equal to zero or greater than
one in `bitmap`

are disregarded. Negative values are used
internally to indicate intermediate processing states, so these must not
be present in `bitmap`

! The identified areas in
`bitmap`

are filled with a number which uniquely label them.
`bitmap`

Those elements of

with values equal to 1 are
assigned to the same area that (1) share a vertex or face, according to
`bitmap`

(see below), and (2) are linked to the same local
appropriate extreme through steepest-gradient paths. If
`diagonal`

is specified and negative, then links to local minima
are sought, otherwise to local maxima. The second criterion ensures
that any given area contains at most one local extreme of the desired
kind.
`sign`

If

is specified, then it is assumed to contain indices
to `seed`

at which areas are to be sought. In that case,
only the areas found at those positions are identified.
`bitmap`

If

is specified, then it is assumed to contain area
numbers to assign to the areas found at the corresponding positions from
`number`

. `seed`

must have either one element or
the same number as `number`

. In the former case, area numbers
are incremented by one, starting at the value of `seed`

.
If no `number`

is specified, then assigned area numbers start
at 2.
`number`

If

is specified, then it must have one element per
data dimension and is taken as instructions on which nearest-neighbor
connections to recognize. A 2 means that nearest neighbors with their
`diagonal`

values equal to 1 are assigned to the same area if
they share any face or vertex in the corresponding dimension. A 1 means
that such neighbors are assigned to the same area only if they share a
face in the corresponding dimension. A 0 means that connections in the
corresponding dimension are ignored. If `bitmap`

is not
specified, then code 2 is assumed for all dimensions.
`diagonal`

For example, if

is equal to `diagonal``[2, 2, 0]`

, then
no connections in the third dimension are recognized, and the data is
treated as a set of unconnected two-dimensional images (but no area in
any of these images shares its area number with any area in any of the
other images). Within each of the images, connections in all four
directions (N-S, E-W, NE-SW, NW-SE) are recognized in this case. If

is equal to `diagonal``[1, 1, 0]`

, then only directions
in the orthogonal directions (N-S, E-W) are recognized. Likewise for
`[2, 1, 0]`

, because even though the first dimension allowes
vertices, the second one only accepts faces.

If

is a 2D array, and no `bitmap`

,
`seed`

, or `numbers`

is specified, then a
special-purpose version optimized for speed is used. Otherwise, a more
general-purpose version is used. On an sgi r5000 (200 MHz) running
Irix, for 2D data, the special-purpose version takes about 0.11
microseconds (23 cpu cycles) per data element, and the general-purpose
version about 0.12 microseconds (24 cpu cycles).
`diagonal`

See also: area, segment, areaconnect, Topology

Next: areaconnect, Previous: area, Up: Internal Routines [Contents][Index]