code: def bounding_box(vol):
      """Compute the bounding box of nonzero intensity voxels in the volume.
  
      Parameters
      ----------
      vol : ndarray
          Volume to compute bounding box on.
  
      Returns
      -------
      npmins : list
          Array containing minimum index of each dimension
      npmaxs : list
          Array containing maximum index of each dimension
      """
      # Find bounds on first dimension
      temp = vol
      for i in range(vol.ndim - 1):
          temp = temp.any(-1)
      mins = [temp.argmax()]
      maxs = [len(temp) - temp[::-1].argmax()]
      # Check that vol is not all 0
      if mins[0] == 0 and temp[0] == 0:
          warn(
              "No data found in volume to bound. Returning empty bounding box."
          )
          return [0] * vol.ndim, [0] * vol.ndim
      # Find bounds on remaining dimensions
      if vol.ndim > 1:
          a, b = bounding_box(vol.any(0))
          mins.extend(a)
          maxs.extend(b)
      return mins, maxs
  
file_path: dipy/dipy/segment/mask.py
imports: from warnings import warn
  import numpy
  from dipy.reconst.dti import fractional_anisotropy, color_fa
  from scipy.ndimage import median_filter
  from scipy.ndimage import binary_dilation, generate_binary_structure
label_desc: Use image node_id 3 for calling a global function with example usage: bounding_box(vol) and returns: mins,  maxs, unknown,  unknown