docstr: Expands the displacement fields from current shape to new_shape
  
  Up-samples the discretization of the displacement fields to be of
  new_shape shape.
  
  Parameters
  ----------
  expand_factors : array, shape (dim,)
      the factors scaling current spacings (voxel sizes) to spacings in
      the expanded discretization.
  new_shape : array, shape (dim,)
      the shape of the arrays holding the up-sampled discretization
code: def expand_fields(self, expand_factors, new_shape):
      """Expands the displacement fields from current shape to new_shape
  
      Up-samples the discretization of the displacement fields to be of
      new_shape shape.
  
      Parameters
      ----------
      expand_factors : array, shape (dim,)
          the factors scaling current spacings (voxel sizes) to spacings in
          the expanded discretization.
      new_shape : array, shape (dim,)
          the shape of the arrays holding the up-sampled discretization
  
      """
      if self.dim == 2:
          expand_f = vfu.resample_displacement_field_2d
      else:
          expand_f = vfu.resample_displacement_field_3d
  
      expanded_forward = expand_f(
          self.forward, expand_factors, new_shape
      )
      expanded_backward = expand_f(
          self.backward, expand_factors, new_shape
      )
  
      expand_factors = np.append(expand_factors, [1])
      expanded_grid2world = mult_aff(
          self.disp_grid2world, np.diag(expand_factors)
      )
      expanded_world2grid = npl.inv(expanded_grid2world)
      self.forward = expanded_forward
      self.backward = expanded_backward
      self.disp_shape = new_shape
      self.disp_grid2world = expanded_grid2world
      self.disp_world2grid = expanded_world2grid
  
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 17 for calling the DiffeomorphicMap obj's underlying member method code with example usage: obj.expand_fields(expand_factors, new_shape) without return types