code: def test_compare_8bit_unsigned_vs_signed_3d(self):
      # filters applied on 8-bit volume or 16-bit volume (having only real 8-bit
      # of dynamic) should be identical
  
      # Create signed int8 volume that and convert it to uint8
      np.random.seed(0)
      volume_s = np.random.randint(
          0, high=127, size=(10, 20, 30), dtype=np.int8
      )
      volume_u = img_as_ubyte(volume_s)
      assert_equal(volume_u, img_as_ubyte(volume_s))
  
      methods_3d = [
          "equalize",
          "otsu",
          "autolevel",
          "gradient",
          "majority",
          "maximum",
          "mean",
          "geometric_mean",
          "subtract_mean",
          "median",
          "minimum",
          "modal",
          "enhance_contrast",
          "pop",
          "sum",
          "threshold",
          "noise_filter",
          "entropy",
      ]
  
      for method in methods_3d:
          func = getattr(rank, method)
          out_u = func(volume_u, ball(3))
          with expected_warnings(["Possible precision loss"]):
              out_s = func(volume_s, ball(3))
          assert_equal(out_u, out_s)
  
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 18 for calling the TestRank obj's underlying member method code with example usage: obj.test_compare_8bit_unsigned_vs_signed_3d() without return types