Standard Library function that generates a square array in which each element equals the euclidean distance from the nearest corner.
m If this parameter is supplied, the function generates a rectangular Euclidean distance array.
The result of the DIST function is an n-by-n single-precision floating-point array, as defined by:
The DIST function is particularly useful for creating arrays that can be used for frequency domain filtering in image and signal processing applications.
TIP: DIST is an excellent choice when you need a two-dimensional array of any size for a fast test display.
mandril = BYTARR(512,512) OPENR, unit, !Data_dir + 'mandril.img', /Get_lun READU, unit, mandril FREE_LUN, unit
WINDOW, XSize=512, YSize=512 TV, mandril
d = DIST(512)
n = 1.0 d0 = 10.0
filter = 1.0 / (1.0 + (d/d0)^(2.0 * n))
filt_image = FFT(FFT(mandril, -1) * filter, 1)
TVSCL, filt_image
testarr = DIST(40) CONTOUR, testarr SURFACE, testarr LOADCT, 7 SHADE_SURF, testarr testimg = DIST(200) TVSCL, testimg
Figure 2-31 Surface view of an array.
Figure 2-32 Surface view of an array.