CenterCrop3D

Crop the center of 3D volume. Args: size (tuple[int, int, int]): Desired output size of the crop in format (depth, height, width) pad_if_needed (bool): Whether to pad if the volume is smaller than desired crop size. Default: False fill (ColorType): Padding value for image if pad_if_needed is True. Default: 0 fill_mask (ColorType): Padding value for mask if pad_if_needed is True. Default: 0 p (float): probability of applying the transform. Default: 1.0 Targets: volume, mask3d, keypoints Image types: uint8, float32 Note: If you want to perform cropping only in the XY plane while preserving all slices along the Z axis, consider using CenterCrop instead. CenterCrop will apply the same XY crop to each slice independently, maintaining the full depth of the volume.

Supported Targets

  • Volume
  • Mask3D
  • Keypoints

Parameters

size
Type: tuple[int, int, int]Default: null
pad_if_needed
Type: boolDefault: false
fill
Type: float | Sequence[float]Default: 0
fill_mask
Type: float | Sequence[float]Default: 0
p
Type: floatDefault: 1