code: def test_get_data(self):
      # Test array image and proxy image interface
      img_klass = self.image_class
      in_data_template = np.arange(24, dtype=np.int16).reshape(
          (2, 3, 4)
      )
      in_data = in_data_template.copy()
      img = img_klass(in_data, None)
      assert in_data is img.dataobj
      with pytest.deprecated_call():
          out_data = img.get_data()
      assert in_data is out_data
      # and that uncache has no effect
      img.uncache()
      assert in_data is out_data
      assert (out_data == in_data_template).all()
      # If we can save, we can create a proxy image
      if not self.can_save:
          return
      rt_img = bytesio_round_trip(img)
      assert in_data is not rt_img.dataobj
      assert (rt_img.dataobj == in_data).all()
      with pytest.deprecated_call():
          out_data = rt_img.get_data()
      assert (out_data == in_data).all()
      assert rt_img.dataobj is not out_data
      # cache
      with pytest.deprecated_call():
          assert rt_img.get_data() is out_data
      out_data[:] = 42
      rt_img.uncache()
      with pytest.deprecated_call():
          assert rt_img.get_data() is not out_data
      with pytest.deprecated_call():
          assert (rt_img.get_data() == in_data).all()
  
imports: from io import BytesIO
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal
  from ..None import load
  from ..imageclasses import spatial_axes_first
  from ..spatialimages import HeaderDataError, SpatialHeader, SpatialImage
  from ..testing import bytesio_round_trip, expires, memmap_after_ufunc
  from ..tmpdirs import InTemporaryDirectory
label_desc: Use image node_id 11 for calling the TestSpatialImage obj's underlying member method code with example usage: obj.test_get_data() without return types