code: def _table_lookup(image, table):
      """
      Perform a morphological transform on an image, directed by its
      neighbors
  
      Parameters
      ----------
      image : ndarray
          A binary image
      table : ndarray
          A 512-element table giving the transform of each pixel given
          the values of that pixel and its 8-connected neighbors.
  
      Returns
      -------
      result : ndarray of same shape as `image`
          Transformed image
  
      Notes
      -----
      The pixels are numbered like this::
  
        0 1 2
        3 4 5
        6 7 8
  
      The index at a pixel is the sum of 2**<pixel-number> for pixels
      that evaluate to true.
      """
      #
      # We accumulate into the indexer to get the index into the table
      # at each point in the image
      #
      if image.shape[0] < 3 or image.shape[1] < 3:
          image = image.astype(bool)
          indexer = np.zeros(image.shape, int)
          indexer[1:, 1:] += image[:-1, :-1] * 2**0
          indexer[1:, :] += image[:-1, :] * 2**1
          indexer[1:, :-1] += image[:-1, 1:] * 2**2
  
          indexer[:, 1:] += image[:, :-1] * 2**3
          indexer[:, :] += image[:, :] * 2**4
          indexer[:, :-1] += image[:, 1:] * 2**5
  
          indexer[:-1, 1:] += image[1:, :-1] * 2**6
          indexer[:-1, :] += image[1:, :] * 2**7
          indexer[:-1, :-1] += image[1:, 1:] * 2**8
      else:
          indexer = _table_lookup_index(
              np.ascontiguousarray(image, np.uint8)
          )
      image = table[indexer]
      return image
  
file_path: scikit-image/skimage/morphology/_skeletonize.py
imports: import numpy
  from scipy import ndimage
  from .._shared.utils import check_nD
  from ..util import crop
  from ._skeletonize_3d_cy import _compute_thin_image
  from ._skeletonize_cy import _fast_skeletonize, _skeletonize_loop, _table_lookup_index
label_desc: Use image node_id 7 for calling a global function with example usage: _table_lookup(image, table) and returns: image