class_docstr: A class to represent a generic intensity-based image registration
  algorithm.
class_docstr_tok: ["A","class","to","represent","a","generic","intensity-based","image","registration","algorithm","."]
docstr: Evaluate the gradient of the similarity function wrt
  transformation parameters.
  
  The gradient is approximated using central finite differences
  at the transformation specified by `T`. The input
  transformation object `T` is modified in place unless it has a
  ``copy`` method.
  
  Parameters
  ----------
  T : Transform
      Transform object implementing ``apply`` method
  epsilon : float
      Step size for finite differences in units of the
      transformation parameters
  
  Returns
  -------
  g : ndarray
      Similarity gradient estimate
docstr_tok: ["Evaluate","the","gradient","of","the","similarity","function","wrt","transformation","parameters",".","The","gradient","is","approximated","using","central","finite","differences","at","the","transformation","specified","by","`","T","`",".","The","input","transformation","object","`","T","`","is","modified","in","place","unless","it","has","a","``","copy","``","method",".","Parameters","--","--","--","--","--","T",":","Transform","Transform","object","implementing","``","apply","``","method","epsilon",":","float","Step","size","for","finite","differences","in","units","of","the","transformation","parameters","Returns","--","--","--","-","g",":","ndarray","Similarity","gradient","estimate"]
code: def eval_gradient(self, T, epsilon=1e-1):
      """
      Evaluate the gradient of the similarity function wrt
      transformation parameters.
  
      The gradient is approximated using central finite differences
      at the transformation specified by `T`. The input
      transformation object `T` is modified in place unless it has a
      ``copy`` method.
  
      Parameters
      ----------
      T : Transform
          Transform object implementing ``apply`` method
      epsilon : float
          Step size for finite differences in units of the
          transformation parameters
  
      Returns
      -------
      g : ndarray
          Similarity gradient estimate
      """
      param0 = T.param.copy()
      if hasattr(T, "copy"):
          T = T.copy()
  
      def simi(param):
          T.param = param
          return self.eval(T)
  
      return approx_gradient(simi, param0, epsilon)
  
imports: import numpy
  import scipy.ndimage
  from ...core.image.image_spaces import as_xyz_image, make_xyz_image, xyz_affine
  from ._registration import _joint_histogram
  from .affine import affine_transforms, inverse_affine, subgrid_affine
  from .chain_transform import ChainTransform
  from .optimizer import configure_optimizer
  from .similarity_measures import similarity_measures
label_desc: Use image node_id 10 for calling the HistogramRegistration obj's underlying member method code with example usage: obj.eval_gradient(T, epsilon) and returns: approx_gradient, self