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 __init__(self, img: SpatialImgT):
      # Local import to avoid circular import on module load
      from .imageclasses import spatial_axes_first
  
      if not spatial_axes_first(img):
          raise ValueError(
              "Cannot predict position of spatial axes for image type {img.__class__.__name__}"
          )
      self.img = img
  
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 1 to create a new SpatialFirstSlicer object from inherited base classes: ty.Generic with example: obj = SpatialFirstSlicer(img)