Name
- pad - To increase an image ( could be 1D, 2D or 3D) to a larger size with the image center (nx/2, ny/2, nz/2) as the reference point. The padded part (called padded background) will be filled in with specified value. By default, the program will fill the padded part with image average.
Usage
- output = pad(image, new_nx, new_ny, new_nz,[ background, ix, iy, iz ])
Input
- image
- Input image which needs to be padded.
- new_nx
- X-dimension size of the padded image.(required)
- new_ny
- Y-dimension size of the padded image.(dependent on input image)
- new_nz
- Z-dimension size of the padded image.(dependent on input image)
- background
- Option to specify how to set the value filled in the padded part. ( default="average") background has three options:
- Any integer or float number.
- "average"
- "circumference"
- ix
- The X coordinate to specify the center of input image appears in the padded one. (optional: default=0)
- iy
- The Y coordinate to specify the center of input image appears in the padded one. (optional: default=0)
- iz
- The Z coordinate to specify the center of input image appear in the padded one. (optional: default=0)
Output
- output
- Padded image of size (new_nx, new_ny, new_nz)
Options
- background: can be set as:
- "average"
- Pads with the average value of the input image.
- "circumference"
- Pads with the average of the sum of the circumference value of the input image.
- value
- Takes any integer or float values.
Description
The input parameters are checked for consistency and if new image size is less than the input image size an error is reported.
Author / Maintainer
Bharath K Narayanan/Zhong Huang
Keywords
- category 1
- UTILITIES
Files
utilities.py
See also
Maturity
- stable
- works for most people, has been tested; test cases/examples available.
Bugs
None. It is perfect.