code: def test_slicing_returns_image():
      data = np.ones((2, 3, 4))
      img = Image(data, AffineTransform("kji", "zyx", np.eye(4)))
      assert isinstance(img, Image)
      assert img.ndim == 3
      # 2D slice
      img2D = img[:, :, 0]
      assert isinstance(img2D, Image)
      assert img2D.ndim == 2
      # 1D slice
      img1D = img[:, 0, 0]
      assert isinstance(img1D, Image)
      assert img1D.ndim == 1
  
imports: import warnings
  from itertools import chain
  import nibabel
  import numpy
  import pytest
  from numpy.testing import assert_almost_equal, assert_array_almost_equal, assert_array_equal
  from ...api import data_generator, parcels, write_data
  from ...reference.coordinate_map import AffineTransform, AxisError
  from ...reference.coordinate_system import CoordinateSystem
  from ..None import image
  from ..image import Image, is_image, iter_axis, rollimg
label_desc: Use image node_id 13 for calling a global function with example usage: test_slicing_returns_image() without return types