random_resized_crop
RandomResizedCrop3D
Bases: Transform
Combines monai's random spatial crop followed by resize to the desired size.
Modifications: 1. The spatial crop is done with the same dimensions for all the axes. 2. Handles cases where the image_size is less than the crop_size by choosing the smallest dimension as the random scale.
Source code in fmcib/transforms/random_resized_crop.py
__call__(image)
Call method to apply random scale cropping and resizing to an image.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image
|
Tensor
|
The input image. |
required |
Returns:
Type | Description |
---|---|
torch.Tensor: The transformed image. |
Source code in fmcib/transforms/random_resized_crop.py
__init__(prob=1, size=50, scale=[0.5, 1.0])
Parameters:
Name | Type | Description | Default |
---|---|---|---|
scale
|
List[int]
|
Specifies the lower and upper bounds for the random area of the crop, before resizing. The scale is defined with respect to the area of the original image. |
[0.5, 1.0]
|