Cropping Nifti (3d volume) images by coordinates


I’m trying to figure out a way to crop 3d Nifti images.
They are loaded using the @MONAI data loaders, and currently, my objective is to crop an area of the image.
Say, the img/volume is 320x320*12 and I would like to remove the ‘border’ outside of the x- [100,220] and y-[90,220] of each slice of the volume.

I could do that manually using numpy or even torch if the image/volume is transformed into a tensor, but is there any built-in cropping tool either in @MONAI or maybe torchvision that given a [xmin,ymin,xmax,ymax] set of coordinates, like a bounding box, it would crop the image?

MONAI supports some transformations such as monai.transforms.SpatialCrop, which might be useful.
Would any of them work for you?

Looking at the descriptions they provide for the transforms it doesn’t look to be what I needed.

However, SimpleITK did have such a thing with the RegionOfInterest method which solved my problem.

image_ct = sitk.ReadImage(path_ct, sitk.sitkInt16)
origin_indx = [zmin, xmin, ymin] #crop area start
size_bounding_box = [(zmax-zmin), (xmax-xmin), (ymax-ymin)]
cropped_volume = sitk.RegionOfInterest(image_ct, size_bounding_box, origin_indx)