class_docstr: Slicing interface that returns a new image with an updated affine
  
  Checks that an image's first three axes are spatial
class_docstr_tok: ["Slicing","interface","that","returns","a","new","image","with","an","updated","affine","Checks","that","an","image","'s","first","three","axes","are","spatial"]
code: def __getitem__(self, slicer: object) -> SpatialImgT:
      try:
          slicer = self.check_slicing(slicer)
      except ValueError as err:
          raise IndexError(*err.args)
  
      dataobj = self.img.dataobj[slicer]
      if any(dim == 0 for dim in dataobj.shape):
          raise IndexError("Empty slice requested")
  
      affine = self.slice_affine(slicer)
      return self.img.__class__(dataobj.copy(), affine, self.img.header)
  
imports: from __future__ import annotations
  import io
  import typing
  from collections.abc import Sequence
  from typing import Literal
  import numpy
  from .arrayproxy import ArrayLike
  from .casting import sctypes_aliases
  from .dataobj_images import DataobjImage
  from .filebasedimages import FileBasedHeader, FileBasedImage
  from .fileholders import FileMap
  from .fileslice import canonical_slicers
  from .orientations import apply_orientation, inv_ornt_aff
  from .viewers import OrthoSlicer3D
  from .volumeutils import shape_zoom_affine
label_desc: Use image node_id 2 for calling the SpatialFirstSlicer obj's underlying member method code with example usage: obj.__getitem__(slicer) and returns: self