code: def test_resample_vector_field_2d():
      r"""
      Expand a vector field by 2, then subsample by 2, the resulting
      field should be the original one
      """
      domain_shape = np.array((64, 64), dtype=np.int32)
      reduced_shape = np.array((32, 32), dtype=np.int32)
      factors = np.array([0.5, 0.5])
      d, dinv = vfu.create_harmonic_fields_2d(
          reduced_shape[0], reduced_shape[1], 0.3, 6
      )
      d = np.array(d, dtype=floating)
  
      expanded = vfu.resample_displacement_field_2d(
          d, factors, domain_shape
      )
      subsampled = expanded[::2, ::2, :]
  
      assert_array_almost_equal(d, subsampled)
  
imports: import numpy
  from numpy.testing import assert_array_equal, assert_array_almost_equal, assert_almost_equal, assert_equal, assert_raises
  from scipy.ndimage import map_coordinates
  from nibabel.affines import apply_affine, from_matvec
  from dipy.core import geometry
  from dipy.align import floating
  from dipy.align import imwarp
  from dipy.align import vector_fields
  from dipy.align.transforms import regtransforms
  from dipy.align.parzenhist import sample_domain_regular
  from dipy.testing.decorators import set_random_number_generator
label_desc: Use image node_id 15 for calling a global function with example usage: test_resample_vector_field_2d() without return types