code: def test_image_xyza_slices():
      # Jonathan found some nastiness where xyz present in output but there was
      # not corresponding axis for x in the input
      arr = np.arange(24, dtype="float32").reshape((1, 2, 3, 4))
      aff = np.diag([2, 3, 4, 5, 1])
      img = Image(arr, vox2mni(aff))
      img0 = img[0]  # slice in X
      # The result does not have an input axis corresponding to x, and should
      # raise an error
      pytest.raises(AxesError, as_xyz_image, img0)
      img0r = img0.reordered_reference([1, 0, 2, 3]).reordered_axes(
          [2, 0, 1]
      )
      pytest.raises(AxesError, as_xyz_image, img0r)
  
file_path: nipy/nipy/core/image/tests/test_image_spaces.py
imports: import nibabel
  import numpy
  import pytest
  from nibabel.affines import from_matvec
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  from ...reference.coordinate_map import AffineTransform
  from ...reference.coordinate_system import CoordinateSystem
  from ...reference.spaces import AffineError, AxesError, SpaceError, XYZSpace, mni_space, talairach_space, vox2mni, vox2talairach, voxel_csm
  from ..image import Image, rollimg
  from ..image_spaces import as_xyz_image, is_xyz_affable, make_xyz_image, xyz_affine
label_desc: Use image node_id 3 for calling a global function with example usage: test_image_xyza_slices() without return types