PAD_IMAGE Function
Places a constant border around a volume, image, or signal.
Usage
result = PAD_IMAGE(image, xdim[, ydim[, zdim]])
Input Parameters
image—A 1D, 2D, or 3D array containing a signal; point or signal-interleaved signals; an image; image, row or pixel interleaved images; or a volume.
xdim—The width setting for the padded volume, image or signal.
ydim—(optional) The height setting for the padded volume or image. (Required for images and volumes.)
zdim—(optional) The depth setting for the padded volume. (Required for volumes.)
Returned Value
result—An array of the same data type as image, whose dimensions are set using the xdim and, optionally, the ydim, and zdim parameters.
Keywords
Center—If set, the original image is centered in the padding.
Intleave—A scalar string indicating the type of interleaving of 2D input signals and 3D image arrays. Valid strings and the corresponding interleaving methods are:
*'point'—The 2D input array arrangement is (px) for p  point-interleaved signals of length x.
*'signal'—The 2D input image array arrangement is (xp) for p  signal-interleaved signals of length x.
*'pixel'—The input array arrangement is (pxy) for p  pixel-interleaved images of x-by-y.
*'row'—The 3D image array arrangement is (xpy) for p  row-interleaved images of x-by-y.
*'image'—The 3D image array arrangement is (xyp) for p  image-interleaved images of x-by-y.
*'volume'—The input image array is treated as a single entity.
Pad_Value—A scalar constant used for padding the image. (Default: 0)
Discussion
It is often useful to increase the dimensions of an image before applying image processing operations to the image. The PAD_IMAGE function surrounds an image with a constant valued border. The image may be either centered or placed in the upper left hand corner of the border, by using the Center keyword.
Example
; Read in an image.
image = IMAGE_READ(!IP_Data + 'photo.tif')
; Zero-pad the image to a square size that is a power of 2 before
; computing the FFT.
square_image = PAD_IMAGE(image('pixels'), 512, 512, /Center)
; Compute the image FFT.
image_fft = FFT(square_image, -1)
See Also