docstr: Inversion error of the displacement fields
  
  Estimates the inversion error of the displacement fields by computing
  statistics of the residual vectors obtained after composing the forward
  and backward displacement fields.
  
  Returns
  -------
  residual : array, shape (R, C) or (S, R, C)
      the displacement field resulting from composing the forward and
      backward displacement fields of this transformation (the residual
      should be zero for a perfect diffeomorphism)
  stats : array, shape (3,)
      statistics from the norms of the vectors of the residual
      displacement field: maximum, mean and standard deviation
  
  Notes
  -----
  Since the forward and backward displacement fields have the same
  discretization, the final composition is given by
  
  comp[i] = forward[ i + Dinv * backward[i]]
  
  where Dinv is the space-to-grid transformation of the displacement
  fields
code: def compute_inversion_error(self):
      """Inversion error of the displacement fields
  
      Estimates the inversion error of the displacement fields by computing
      statistics of the residual vectors obtained after composing the forward
      and backward displacement fields.
  
      Returns
      -------
      residual : array, shape (R, C) or (S, R, C)
          the displacement field resulting from composing the forward and
          backward displacement fields of this transformation (the residual
          should be zero for a perfect diffeomorphism)
      stats : array, shape (3,)
          statistics from the norms of the vectors of the residual
          displacement field: maximum, mean and standard deviation
  
      Notes
      -----
      Since the forward and backward displacement fields have the same
      discretization, the final composition is given by
  
      comp[i] = forward[ i + Dinv * backward[i]]
  
      where Dinv is the space-to-grid transformation of the displacement
      fields
  
      """
      Dinv = self.disp_world2grid
      if self.dim == 2:
          compose_f = vfu.compose_vector_fields_2d
      else:
          compose_f = vfu.compose_vector_fields_3d
  
      residual, stats = compose_f(
          self.backward, self.forward, None, Dinv, 1.0, None
      )
  
      return np.asarray(residual), np.asarray(stats)
  
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 18 for calling the DiffeomorphicMap obj's underlying member method code with example usage: obj.compute_inversion_error() and returns: np,  np