code: def test_3d_fallback_black_tophat():
      image = np.ones((7, 7, 7), dtype=bool)
      image[2, 2:4, 2:4] = 0
      image[3, 2:5, 2:5] = 0
      image[4, 3:5, 3:5] = 0
  
      with expected_warnings([r"operator.*deprecated|\A\Z"]):
          new_image = gray.black_tophat(image)
      footprint = ndi.generate_binary_structure(3, 1)
      with expected_warnings([r"operator.*deprecated|\A\Z"]):
          image_expected = ndi.black_tophat(
              image.view(dtype=np.uint8), footprint=footprint
          )
      assert_array_equal(new_image, image_expected)
  
imports: import inspect
  import numpy
  import pytest
  from scipy import ndimage
  from numpy.testing import assert_allclose, assert_array_equal, assert_equal
  from skimage import color, data, transform
  from skimage._shared._warnings import expected_warnings
  from skimage._shared.testing import fetch
  from skimage.morphology import gray, footprints
  from skimage.util import img_as_uint, img_as_ubyte
label_desc: Use image node_id 7 for calling a global function with example usage: test_3d_fallback_black_tophat() without return types