code: def apply_to_image(self, image, reference=None, interpolation='linear'):
          
          if reference is None:
              reference = image.clone()
  
          tform_fn = utils.get_lib_fn('transformImage%s%s' % (self._libsuffix, image._libsuffix))
          reference = reference.clone(image.pixeltype)
  
          img_ptr = tform_fn(self.pointer, image.pointer, reference.pointer, interpolation)
          return iio.ANTsImage(pixeltype=image.pixeltype,
                              dimension=image.dimension,
                              components=image.components,
                              pointer=img_ptr)
docs: Apply transform to an image
  
          Arguments
          ---------
          image : ANTsImage
              image to which the transform will be applied
  
          reference : ANTsImage
              target space for transforming image
  
          interpolation : string
              type of interpolation to use
  
          Returns
          -------
          list : transformed vector