code: def _crop(X, tol=1.0e-10):
      """
      Find a bounding box for support of fabs(X) > tol and returned
      crop region.
      """
      aX = np.fabs(X)
      n = len(X.shape)
      I = np.indices(X.shape)[:, np.greater(aX, tol)]
      if I.shape[1] > 0:
          m = [I[i].min() for i in range(n)]
          M = [I[i].max() for i in range(n)]
          slices = [slice(m[i], M[i] + 1, 1) for i in range(n)]
          return X[tuple(slices)]
      else:
          return np.zeros((1,) * n)
  
file_path: nipy/nipy/algorithms/kernel_smooth.py
imports: import gc
  import numpy
  import numpy.linalg
  from numpy import fft
  from nipy.core.api import AffineTransform, Image
  from nipy.core.reference.coordinate_map import product
  from nipy.utils import seq_prod
label_desc: Use image node_id 3 for calling a global function with example usage: _crop(X, tol) and returns: X, np