code: def test_data_dtype():
      hdr = SpatialHeader()
      assert hdr.get_data_dtype() == np.dtype(np.float32)
      hdr.set_data_dtype(np.float64)
      assert hdr.get_data_dtype() == np.dtype(np.float64)
      hdr.set_data_dtype("u2")
      assert hdr.get_data_dtype() == np.dtype(np.uint16)
  
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 6 for calling a global function with example usage: test_data_dtype() without return types