code: def _local_max(data, affine, min_distance):
      """Find all local maxima of the array, separated by at least min_distance.
  
      Adapted from https://stackoverflow.com/a/22631583/2589328
  
      Parameters
      ----------
      data : array_like
          3D array of with masked values for cluster.
  
      affine : np.ndarray
          Square matrix specifying the position of the image array data
          in a reference space.
  
      min_distance : int
          Minimum distance between local maxima in ``data``, in terms of mm.
  
      Returns
      -------
      ijk : `numpy.ndarray`
          (n_foci, 3) array of local maxima indices for cluster.
  
      vals : `numpy.ndarray`
          (n_foci,) array of values from data at ijk.
  
      """
      ijk, vals = _identify_subpeaks(data)
      xyz, ijk, vals = _sort_subpeaks(ijk, vals, affine)
      ijk, vals = _pare_subpeaks(xyz, ijk, vals, min_distance)
      return ijk, vals
  
file_path: nilearn/nilearn/reporting/get_clusters_table.py
imports: import warnings
  from string import ascii_lowercase
  import nibabel
  import numpy
  import pandas
  from scipy.ndimage import center_of_mass, generate_binary_structure, label, maximum_filter, minimum_filter
  from nilearn._utils import check_niimg_3d
  from nilearn._utils.niimg import safe_get_data
  from nilearn.image import new_img_like, threshold_img
  from nilearn.image.resampling import coord_transform
label_desc: Use image node_id 1 for calling a global function with example usage: _local_max(data, affine, min_distance) and returns: ijk,  vals