code: def transform(self, X=None, y=None):
          
          # random draw in rotation range
          rotation = random.gauss(self.rotation_range[0], self.rotation_range[1])
          self.params = rotation
  
          tx = Rotate2D(rotation,
                      reference=self.reference,
                      lazy=self.lazy)
  
          return tx.transform(X,y)
docs: Transform an image using an Affine transform with
          rotation 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('r16'))
          >>> tx = ants.contrib.RandomRotate2D(rotation_range=(-10,10))
          >>> img2 = tx.transform(img)