PD - Pad Image/volume with borders

(11/03/11)

PURPOSE

To pad an image/volume to make a larger image/volume. Places the input image at specified position and pads the input with a specified background value.   Example.

SEE ALSO

PA [Patch image into a larger existing image/volume]
IN [Insert - image into a larger image]
IN S [Insert - image into a larger image and contrast Stretch]

USAGE

.OPERATION: PD
   <or>
PD [paddingval]

.INPUT FILE: PIC001
[Enter the name of the file containing image to be padded.]

.OUTPUT FILE: IMG041
[Enter name for the output file.]

.DIMENSIONS (NX,NY,NZ): 40,40,40
[Enter the dimensions of the output file. Each dimension has to be equal to or larger than the corresponding input file dimension.]

.PAD TYPE= AVERAGE, SET, BORDER, MIN, OR CIRCULAR (A/S/B/M/C): A
[Sets background (padding) value of the output image.
Enter 'A' to set background to the input file's overall average.
Enter 'S' to set background to a specified value.
Enter 'B' to set background value equal to the average density value of the perimeter (border) pixels in the input file.
Enter 'M' to set background to to the minimum density in the input file.

Enter a 'C' in second character of answer if you have an image of periodic arrays and want the padding to be circularly continuous as required in Fourier filtering of lattices; i.e., the parts of the small image that extend beyond the border of the large image will be wrapped around. Without the 'C' option these parts would just be left out. The option 'C' only works on 2D images.]

If the 'S' option is selected SPIDER asks:


.BACKGROUND: 1.2
[Background (padding) value.]

In all cases the SPIDER will ask:

.TOP LEFT COORDINATES: 10, 15, 2
[Enter the coordinates in the output image where the top left corner of the input image is to be placed.]

NOTES

  1. Except when the Circular 'C' option is selected, the optional register variable will receive the value used for the background padding.

  2. Operation still accepts obsolete 'Y' response for padding type: average and 'N' response for padding type: set value.

SUBROUTINES

PATCH

CALLER

UTIL2