code: def test_bounding_box():
      vol = np.zeros((100, 100, 50), dtype=int)
  
      # Check the more usual case
      vol[10:90, 11:40, 5:33] = 3
      mins, maxs = bounding_box(vol)
      assert_equal(mins, [10, 11, 5])
      assert_equal(maxs, [90, 40, 33])
  
      # Check a 2d case
      mins, maxs = bounding_box(vol[10])
      assert_equal(mins, [11, 5])
      assert_equal(maxs, [40, 33])
  
      vol[:] = 0
      with warnings.catch_warnings(record=True) as w:
          warnings.simplefilter("always")
          # Trigger a warning.
          num_warns = len(w)
          mins, maxs = bounding_box(vol)
          # Assert number of warnings has gone up by 1
          assert_equal(len(w), num_warns + 1)
  
          # Check that an empty array returns zeros for both min & max
          assert_equal(mins, [0, 0, 0])
          assert_equal(maxs, [0, 0, 0])
  
          # Check the 2d case
          mins, maxs = bounding_box(vol[0])
          assert_equal(len(w), num_warns + 2)
          assert_equal(mins, [0, 0])
          assert_equal(maxs, [0, 0])
  
file_path: dipy/dipy/segment/tests/test_mask.py
imports: import warnings
  import numpy
  from scipy.ndimage import generate_binary_structure, binary_dilation
  from scipy.ndimage import median_filter
  from dipy.segment.mask import otsu, bounding_box, crop, applymask, multi_median, median_otsu
  from numpy.testing import assert_equal, assert_almost_equal, assert_raises
  from dipy.data import get_fnames
  from dipy.io.image import load_nifti_data
label_desc: Use image node_id 2 for calling a global function with example usage: test_bounding_box() without return types