def __call__(self, img, label=None):
        """
        Args:
            img (numpy ndarray): Image to be cropped and resized.
        Returns:
            numpy ndarray: Randomly cropped and resized image.
        """

        i, j, k, d, h, w = self.get_params(img, self.scale, self.ratio,
                                           self.size)

        img = F.crop_4d(img, i, j, k, d, h, w)
        if label is not None:
            label = F.crop_3d(label, i, j, k, d, h, w)

        return img, label

        Args:
            img (numpy ndarray): Image to be cropped and resized.
        Returns:
            numpy ndarray: Randomly cropped and resized image.
        
contrib/MedicalSeg/medicalseg/transforms/transform.py