code: def test_rank_filters_3D(self, filter, outdt):
      @run_in_parallel(warnings_matching=["Possible precision loss"])
      def check():
          expected = self.refs_3d[filter]
          if outdt is not None:
              out = np.zeros_like(expected, dtype=outdt)
          else:
              out = None
          result = getattr(rank, filter)(
              self.volume, self.footprint_3d, out=out
          )
          if outdt is not None:
              # Avoid rounding issues comparing to expected result
              if filter == "sum":
                  # sum test data seems to be 8-bit disguised as 16-bit
                  datadt = np.uint8
              else:
                  datadt = expected.dtype
              # Take modulus first to avoid undefined behavior for
              # float->uint8 conversions.
              result = np.mod(result, 256.0).astype(datadt)
          assert_array_almost_equal(expected, result)
  
      check()
  
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 4 for calling the TestRank obj's underlying member method code with example usage: obj.test_rank_filters_3D(filter, outdt) without return types