code: def test_croptobbox():
      X, Y = np.meshgrid(np.arange(16) - 8, np.arange(16) - 8)
      ball = ((X**2 + Y**2) < 32).astype(np.uint8)
      assert mahotas.croptobbox(ball).sum() == ball.sum()
      assert mahotas.croptobbox(ball, border=2).sum() == ball.sum()
      assert mahotas.croptobbox(ball, border=256).sum() == ball.sum()
      assert mahotas.croptobbox(ball, border=256).size == ball.size
      assert mahotas.croptobbox(ball.T).sum() == ball.sum()
  
      assert mahotas.croptobbox(ball[::2]).sum() == ball[::2].sum()
      assert mahotas.croptobbox(ball[::2].T).sum() == ball[::2].sum()
      assert mahotas.croptobbox(ball.T, border=2).sum() == ball.sum()
      assert mahotas.croptobbox(ball.T, border=256).sum() == ball.sum()
      assert mahotas.croptobbox(ball.T, border=256).size == ball.size
  
file_path: mahotas/mahotas/tests/test_bbox.py
imports: import numpy
  import mahotas
  import mahotas
  from mahotas import bbox
label_desc: Use image node_id 1 for calling a global function with example usage: test_croptobbox() without return types