Next: area2, Previous: andif, Up: Internal Routines [Contents][Index]

`area, `

`bitmap` [, seed=`seed`, numbers=`numbers`,
diagonal=`diagonal`]

`area, `

identifies all disjoint areas in `bitmap``long`

array

(of arbitrary dimensions) which have elements
with value one. Elements with values equal to zero or greater than one
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`

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 `area`

is called with

a two-dimensional
`bitmap``long`

array and with no other arguments, then a special-purpose
version of the routine is called which is optimized for this case for
speed. Otherwise, a more versatile but somewhat slower version is used.

On an SGI R5000 (200 MHz) running Irix, for 2D data, the special-purpose version takes about 0.14 microseconds (27 CPU cycles) per data element, and the general version about 0.15 microseconds (30 CPU cycles) per data element. If the special-purpose version cannot be speeded up more, then it may be discarded.

See also: area2, segment, areaconnect, Topology

Next: area2, Previous: andif, Up: Internal Routines [Contents][Index]