code: def test_isolation(self):
      # Test image isolated from external changes to header and affine
      img_klass = self.image_class
      arr = np.arange(24, dtype=np.int16).reshape((2, 3, 4))
      aff = np.eye(4)
      img = img_klass(arr, aff)
      assert (img.affine == aff).all()
      aff[0, 0] = 99
      assert not np.all(img.affine == aff)
      # header, created by image creation
      ihdr = img.header
      # Pass it back in
      img = img_klass(arr, aff, ihdr)
      # Check modifying header outside does not modify image
      ihdr.set_zooms((4, 5, 6))
      assert img.header != ihdr
  
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 1 for calling the TestSpatialImage obj's underlying member method code with example usage: obj.test_isolation() without return types