code: def test_compare_8bit_vs_16bit(self, method):
      # filters applied on 8-bit image or 16-bit image (having only real 8-bit
      # of dynamic) should be identical
      image8 = util.img_as_ubyte(data.camera())[::2, ::2]
      image16 = image8.astype(np.uint16)
      assert_equal(image8, image16)
  
      np.random.seed(0)
      volume8 = np.random.randint(
          128, high=256, size=(10, 10, 10), dtype=np.uint8
      )
      volume16 = volume8.astype(np.uint16)
  
      methods_3d = [
          "equalize",
          "otsu",
          "autolevel",
          "gradient",
          "majority",
          "maximum",
          "mean",
          "geometric_mean",
          "subtract_mean",
          "median",
          "minimum",
          "modal",
          "enhance_contrast",
          "pop",
          "sum",
          "threshold",
          "noise_filter",
          "entropy",
      ]
  
      func = getattr(rank, method)
      f8 = func(image8, disk(3))
      f16 = func(image16, disk(3))
      assert_equal(f8, f16)
  
      if method in methods_3d:
          f8 = func(volume8, ball(3))
          f16 = func(volume16, ball(3))
  
          assert_equal(f8, f16)
  
imports: import numpy
  import pytest
  from skimage import data, morphology, util
  from skimage._shared._warnings import expected_warnings
  from skimage._shared.testing import assert_allclose, assert_array_almost_equal, assert_equal, fetch, run_in_parallel
  from skimage.filters import rank
  from skimage.filters.rank import __all__
  from skimage.filters.rank import subtract_mean
  from skimage.morphology import ball, disk, gray
  from skimage.util import img_as_float, img_as_ubyte
label_desc: Use image node_id 19 for calling the TestRank obj's underlying member method code with example usage: obj.test_compare_8bit_vs_16bit(method) without return types