BOUNDARY Function

Standard Library function that computes the boundary of a region in an array.

enabled.

Usage

    result = BOUNDARY(a,r)

Input Parameters

a—An array of n dimensions.

r—A vector of indices defining the region of a.

Returned Value

result—A vector of indices defining the boundary of r.

Keywords

k—A positive integer (less than or equal to n) defining connectivity. A boundary element of r is an element of r with neighbors not in r; two array cells are neighbors if they share a common boundary point and their centroids are within the square root of k of each other. k = 1 by default, which implies neighbors share a common face.

Example

a = INDGEN( 5, 4 )
PM, a
; PV-WAVE prints:
; 0       5      10      15
; 1       6      11      16
; 2       7      12      17
; 3       8      13      18
; 4       9      14      19
PRINT, FIX(BOUNDARY(a, [1,2,3,6,7,8,12,13]))
; PV-WAVE prints:
; 1       2       3       6       8      12      13
PRINT, FIX(BOUNDARY(a, [1,2,3,6,7,8,12,13], k=2))
; PV-WAVE prints:
; 1       2       3       6       7       8      12      13
a = BYTSCL( DIST(500) )
r = WHERE( 150 LE a AND a LE 200 )
a( BOUNDARY(a,r) ) = 0
TV, a

See Also

BLOBBLOBCOUNTNEIGHBORS