monai.transforms.croppad.array#

A collection of “vanilla” transforms for crop and pad operations.

Classes

BorderPad(spatial_border[, mode, lazy])

Pad the input data by adding specified borders to every dimension.

BoundingRect([select_fn])

Compute coordinates of axis-aligned bounding rectangles from input image img.

CenterScaleCrop(roi_scale[, lazy])

Crop at the center of image with specified scale of ROI size.

CenterSpatialCrop(roi_size[, lazy])

Crop at the center of image with specified ROI size.

Crop([lazy])

Perform crop operations on the input image.

CropForeground([select_fn, channel_indices, ...])

Crop an image using a bounding box.

DivisiblePad(k[, mode, method, lazy])

Pad the input data, so that the spatial sizes are divisible by k.

Pad([to_pad, mode, lazy])

Perform padding for a given an amount of padding in each dimension.

RandCropByLabelClasses(spatial_size[, ...])

Crop random fixed sized regions with the center being a class based on the specified ratios of every class. The label data can be One-Hot format array or Argmax data. And will return a list of arrays for all the cropped images. For example, crop two (3 x 3) arrays from (5 x 5) array with ratios=[1, 2, 3, 1]::.

RandCropByPosNegLabel(spatial_size[, label, ...])

Crop random fixed sized regions with the center being a foreground or background voxel based on the Pos Neg Ratio. And will return a list of arrays for all the cropped images. For example, crop two (3 x 3) arrays from (5 x 5) array with pos/neg=1::.

RandScaleCrop(roi_scale[, max_roi_scale, ...])

Subclass of monai.transforms.RandSpatialCrop.

RandSpatialCrop(roi_size[, max_roi_size, ...])

Crop image with random size or specific size ROI.

RandSpatialCropSamples(roi_size, num_samples)

Crop image with random size or specific size ROI to generate a list of N samples.

RandWeightedCrop(spatial_size[, ...])

Samples a list of num_samples image patches according to the provided weight_map.

ResizeWithPadOrCrop(spatial_size[, method, ...])

Resize an image to a target spatial size by either centrally cropping the image or padding it evenly with a user-specified mode.

SpatialCrop([roi_center, roi_size, ...])

General purpose cropper to produce sub-volume region of interest (ROI).

SpatialPad(spatial_size[, method, mode, lazy])

Performs padding to the data, symmetric for all sides or all on one side for each dimension.