docstr: Composition of the current displacement field with the given field
  
  Interpolates new displacement at the locations defined by
  current_displacement. Equivalently, computes the composition C of the
  given displacement fields as C(x) = B(A(x)), where A is
  current_displacement and B is new_displacement. This function is
  intended to be used with deformation fields of the same sampling
  (e.g. to be called by a registration algorithm).
  
  Parameters
  ----------
  current_displacement : array, shape (R', C', 2) or (S', R', C', 3)
      the displacement field defining where to interpolate
      new_displacement
  new_displacement : array, shape (R, C, 2) or (S, R, C, 3)
      the displacement field to be warped by current_displacement
  disp_world2grid : array, shape (dim+1, dim+1)
      the space-to-grid transform associated with the displacements'
      grid (we assume that both displacements are discretized over the
      same grid)
  time_scaling : float
      scaling factor applied to d2. The effect may be interpreted as
      moving d1 displacements along a factor (`time_scaling`) of d2.
  
  Returns
  -------
  updated : array, shape (the same as new_displacement)
      the warped displacement field
  mean_norm : the mean norm of all vectors in current_displacement
code: def update(
      self,
      current_displacement,
      new_displacement,
      disp_world2grid,
      time_scaling,
  ):
      """Composition of the current displacement field with the given field
  
      Interpolates new displacement at the locations defined by
      current_displacement. Equivalently, computes the composition C of the
      given displacement fields as C(x) = B(A(x)), where A is
      current_displacement and B is new_displacement. This function is
      intended to be used with deformation fields of the same sampling
      (e.g. to be called by a registration algorithm).
  
      Parameters
      ----------
      current_displacement : array, shape (R', C', 2) or (S', R', C', 3)
          the displacement field defining where to interpolate
          new_displacement
      new_displacement : array, shape (R, C, 2) or (S, R, C, 3)
          the displacement field to be warped by current_displacement
      disp_world2grid : array, shape (dim+1, dim+1)
          the space-to-grid transform associated with the displacements'
          grid (we assume that both displacements are discretized over the
          same grid)
      time_scaling : float
          scaling factor applied to d2. The effect may be interpreted as
          moving d1 displacements along a factor (`time_scaling`) of d2.
  
      Returns
      -------
      updated : array, shape (the same as new_displacement)
          the warped displacement field
      mean_norm : the mean norm of all vectors in current_displacement
      """
      sq_field = np.sum((np.array(current_displacement) ** 2), -1)
      mean_norm = np.sqrt(sq_field).mean()
      # We assume that both displacement fields have the same
      # grid2world transform, which implies premult_index=Identity
      # and premult_disp is the world2grid transform associated with
      # the displacements' grid
      self.compose(
          current_displacement,
          new_displacement,
          None,
          disp_world2grid,
          time_scaling,
          current_displacement,
      )
  
      return np.array(current_displacement), np.array(mean_norm)
  
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 2 for calling the SymmetricDiffeomorphicRegistration obj's underlying member method code with example usage: obj.update(current_displacement, new_displacement, disp_world2grid, time_scaling) and returns: np,  np