Need help or have feedback?

Join DiscordCreate Issue
...
PadIfNeeded3D

Pads the sides of a 3D volume if its dimensions are less than specified minimum dimensions. If the pad_divisor_zyx is specified, the function additionally ensures that the volume dimensions are divisible by these values. Args: min_zyx (tuple[int, int, int] | None): Minimum desired size as (depth, height, width). Ensures volume dimensions are at least these values. If not specified, pad_divisor_zyx must be provided. pad_divisor_zyx (tuple[int, int, int] | None): If set, pads each dimension to make it divisible by corresponding value in format (depth_div, height_div, width_div). If not specified, min_zyx must be provided. position (Literal["center", "random"]): Position where the volume is to be placed after padding. Default is 'center'. fill (tuple[float, ...] | float): Value to fill the border voxels for volume. Default: 0 fill_mask (tuple[float, ...] | float): Value to fill the border voxels for masks. Default: 0 p (float): Probability of applying the transform. Default: 1.0 Targets: volume, mask3d, keypoints Image types: uint8, float32 Note: Input volume should be a numpy array with dimensions ordered as (z, y, x) or (depth, height, width), with optional channel dimension as the last axis.

Supported Targets
keypoints
Parameters
min_zyx
type:
tuple[int, int, int] | None
Default:
null
pad_divisor_zyx
type:
tuple[int, int, int] | None
Default:
null
position
type:
center
random
Default:
"center"
fill
type:
tuple[float, ...] | float
Default:
0
fill_mask
type:
tuple[float, ...] | float
Default:
0