Transform an image using an Affine transform with
        shear parameters randomly generated from the user-specified
        range.  Return the transform if X=None.

        Arguments
        ---------
        X : ANTsImage
            Image to transform

        y : ANTsImage (optional)
            Another image to transform

        Returns
        -------
        ANTsImage if y is None, else a tuple of ANTsImage types

        Examples
        --------
        >>> import ants
        >>> img = ants.image_read(ants.get_data('ch2'))
        >>> tx = ants.contrib.RandomShear3D(shear_range=(-10,10))
        >>> img2 = tx.transform(img)

def transform(self, X=None, y=None):
        """
        Transform an image using an Affine transform with
        shear parameters randomly generated from the user-specified
        range.  Return the transform if X=None.

        Arguments
        ---------
        X : ANTsImage
            Image to transform

        y : ANTsImage (optional)
            Another image to transform

        Returns
        -------
        ANTsImage if y is None, else a tuple of ANTsImage types

        Examples
        --------
        >>> import ants
        >>> img = ants.image_read(ants.get_data('ch2'))
        >>> tx = ants.contrib.RandomShear3D(shear_range=(-10,10))
        >>> img2 = tx.transform(img)
        """
        # random draw in shear range
        shear_x = random.gauss(self.shear_range[0], self.shear_range[1])
        shear_y = random.gauss(self.shear_range[0], self.shear_range[1])
        shear_z = random.gauss(self.shear_range[0], self.shear_range[1])
        self.params = (shear_x, shear_y, shear_z)

        tx = Shear3D((shear_x, shear_y, shear_z),
                     reference=self.reference,
                     lazy=self.lazy)

        return tx.transform(X,y)