code: def test_transform(rng=None):
      temp = rng.random((30, 31, 32))
      temp2, new_affine, ori_shape = transform_img(
          temp,
          np.eye(4),
          init_shape=(32, 32, 32),
          voxsize=np.ones(3) * 2,
      )
      with warnings.catch_warnings():
          scipy_affine_txfm_msg = (
              "The behavior of affine_transform with a 1-D "
              "array supplied for the matrix parameter has changed in "
              "SciPy 0.18.0."
          )
          warnings.filterwarnings(
              "ignore",
              message=scipy_affine_txfm_msg,
              category=UserWarning,
          )
          temp2 = recover_img(
              temp2,
              new_affine,
              ori_shape,
              temp.shape,
              init_shape=(32, 32, 32),
              voxsize=np.ones(3) * 2,
          )
      np.testing.assert_almost_equal(
          np.array(temp.shape), np.array(temp2.shape)
      )
  
imports: import warnings
  import numpy
  from dipy.nn.utils import normalize, unnormalize, transform_img, recover_img
  from dipy.testing.decorators import set_random_number_generator
label_desc: Use image node_id 2 for calling a global function with example usage: test_transform(rng) without return types