code: def subsample(img, slice_object):
      """Subsample an image
  
      Please don't use this function, but use direct image slicing instead.  That
      is, replace::
  
          frame3 = subsample(im, slice_maker[:,:,:,3])
  
      with::
  
          frame3 = im[:,:,:,3]
  
      Parameters
      ----------
      img : Image
      slice_object: int, slice or sequence of slice
         An object representing a numpy 'slice'.
  
      Returns
      -------
      img_subsampled: Image
           An Image with data img.get_fdata()[slice_object] and an appropriately
           corrected CoordinateMap.
  
      Examples
      --------
      >>> from nipy.io.api import load_image
      >>> from nipy.testing import funcfile
      >>> from nipy.core.api import subsample, slice_maker
      >>> im = load_image(funcfile)
      >>> frame3 = subsample(im, slice_maker[:,:,:,3])
      >>> np.allclose(frame3.get_fdata(), im.get_fdata()[:,:,:,3])
      True
      """
      warnings.warn(
          "subsample is deprecated, please use image "
          "slicing instead (e.g. img[:,:,1]",
          DeprecationWarning,
          stacklevel=2,
      )
      return img.__getitem__(slice_object)
  
imports: import warnings
  from copy import copy
  from itertools import chain
  import numpy
  from nibabel.onetime import auto_attr
  from ..reference.array_coords import ArrayCoordMap
  from ..reference.coordinate_map import AffineTransform, CoordinateSystem, input_axis_index
label_desc: Use image node_id 1 for calling a global function with example usage: subsample(img, slice_object) and returns: img