code: def get_bounds(shape, affine):
      """Return the world-space bounds occupied by an array given an affine.
  
      The coordinates returned correspond to the **center** of the corner voxels.
  
      Parameters
      ----------
      shape : tuple
          shape of the array. Must have 3 integer values.
  
      affine : numpy.ndarray
          affine giving the linear transformation
          between :term:`voxel` coordinates
          and world-space coordinates.
  
      Returns
      -------
      coord : list of tuples
          coord[i] is a 2-tuple giving minimal and maximal coordinates along
          i-th axis.
  
      """
      adim, bdim, cdim = shape
      adim -= 1
      bdim -= 1
      cdim -= 1
      # form a collection of vectors for each 8 corners of the box
      box = np.array(
          [
              [0.0, 0, 0, 1],
              [adim, 0, 0, 1],
              [0, bdim, 0, 1],
              [0, 0, cdim, 1],
              [adim, bdim, 0, 1],
              [adim, 0, cdim, 1],
              [0, bdim, cdim, 1],
              [adim, bdim, cdim, 1],
          ]
      ).T
      box = np.dot(affine, box)[:3]
      return list(zip(box.min(axis=-1), box.max(axis=-1)))
  
file_path: nilearn/nilearn/image/resampling.py
imports: import numbers
  import warnings
  import numpy
  from scipy import linalg
  from scipy.ndimage import affine_transform, find_objects
  from ..None import _utils
  from .._utils import stringify_path
  from .._utils.niimg import _get_data
  from .image import copy_img, crop_img
label_desc: Use image node_id 4 for calling a global function with example usage: get_bounds(shape, affine) and returns: list