docstr: Symmetric Diffeomorphic Registration (SyN) Algorithm
  
  Performs the multi-resolution optimization algorithm for non-linear
  registration using a given similarity metric.
  
  Parameters
  ----------
  metric : SimilarityMetric object
      the metric to be optimized
  level_iters : list of int
      the number of iterations at each level of the Gaussian Pyramid (the
      length of the list defines the number of pyramid levels to be
      used)
  opt_tol : float
      the optimization will stop when the estimated derivative of the
      energy profile w.r.t. time falls below this threshold
  inv_iter : int
      the number of iterations to be performed by the displacement field
      inversion algorithm
  step_length : float
      the length of the maximum displacement vector of the update
      displacement field at each iteration
  ss_sigma_factor : float
      parameter of the scale-space smoothing kernel. For example, the
      std. dev. of the kernel will be factor*(2^i) in the isotropic case
      where i = 0, 1, ..., n_scales is the scale
  inv_tol : float
      the displacement field inversion algorithm will stop iterating
      when the inversion error falls below this threshold
  callback : function(SymmetricDiffeomorphicRegistration)
      a function receiving a SymmetricDiffeomorphicRegistration object
      to be called after each iteration (this optimizer will call this
      function passing self as parameter)
code: def __init__(
      self,
      metric,
      level_iters=None,
      step_length=0.25,
      ss_sigma_factor=0.2,
      opt_tol=1e-5,
      inv_iter=20,
      inv_tol=1e-3,
      callback=None,
  ):
      """Symmetric Diffeomorphic Registration (SyN) Algorithm
  
      Performs the multi-resolution optimization algorithm for non-linear
      registration using a given similarity metric.
  
      Parameters
      ----------
      metric : SimilarityMetric object
          the metric to be optimized
      level_iters : list of int
          the number of iterations at each level of the Gaussian Pyramid (the
          length of the list defines the number of pyramid levels to be
          used)
      opt_tol : float
          the optimization will stop when the estimated derivative of the
          energy profile w.r.t. time falls below this threshold
      inv_iter : int
          the number of iterations to be performed by the displacement field
          inversion algorithm
      step_length : float
          the length of the maximum displacement vector of the update
          displacement field at each iteration
      ss_sigma_factor : float
          parameter of the scale-space smoothing kernel. For example, the
          std. dev. of the kernel will be factor*(2^i) in the isotropic case
          where i = 0, 1, ..., n_scales is the scale
      inv_tol : float
          the displacement field inversion algorithm will stop iterating
          when the inversion error falls below this threshold
      callback : function(SymmetricDiffeomorphicRegistration)
          a function receiving a SymmetricDiffeomorphicRegistration object
          to be called after each iteration (this optimizer will call this
          function passing self as parameter)
      """
      super(SymmetricDiffeomorphicRegistration, self).__init__(metric)
      if level_iters is None:
          level_iters = [100, 100, 25]
  
      if len(level_iters) == 0:
          raise ValueError("The iterations list cannot be empty")
  
      self.set_level_iters(level_iters)
      self.step_length = step_length
      self.ss_sigma_factor = ss_sigma_factor
      self.opt_tol = opt_tol
      self.inv_tol = inv_tol
      self.inv_iter = inv_iter
      self.energy_window = 12
      self.energy_list = []
      self.full_energy_profile = []
      self.verbosity = VerbosityLevels.STATUS
      self.callback = callback
      self.moving_ss = None
      self.static_ss = None
      self.static_direction = None
      self.moving_direction = None
      self.mask0 = metric.mask0
  
imports: import logging
  import abc
  import numpy
  import numpy.linalg
  import nibabel
  from nibabel.streamlines import ArraySequence
  from dipy.align import vector_fields
  from dipy.align import floating
  from dipy.align import VerbosityLevels
  from dipy.align import Bunch
  from dipy.align.scalespace import ScaleSpace
label_desc: Use image node_id 1 to create a new SymmetricDiffeomorphicRegistration object from inherited base classes: DiffeomorphicRegistration with example: obj = SymmetricDiffeomorphicRegistration(metric, level_iters, step_length, ss_sigma_factor, opt_tol, inv_iter, inv_tol, callback)