code: def test_scaling(self):
      img = self.imt
      lower = 10
      upper = 99
      b_min = 0
      b_max = 255
  
      a_min = np.percentile(img, lower)
      a_max = np.percentile(img, upper)
      expected = (
          ((img - a_min) / (a_max - a_min)) * (b_max - b_min) + b_min
      ).astype(np.uint8)
  
      for p in TEST_NDARRAYS:
          data = {"img": p(img)}
          scaler = ScaleIntensityRangePercentilesd(
              keys=data.keys(),
              lower=lower,
              upper=upper,
              b_min=b_min,
              b_max=b_max,
              dtype=np.uint8,
          )
          assert_allclose(
              scaler(data)["img"],
              p(expected),
              type_test="tensor",
              rtol=1e-4,
          )
  
file_path: MONAI/tests/test_scale_intensity_range_percentilesd.py
imports: from __future__ import annotations
  import unittest
  import numpy
  from monai.transforms.intensity.dictionary import ScaleIntensityRangePercentilesd
  from tests.utils import TEST_NDARRAYS, NumpyImageTestCase2D, assert_allclose
label_desc: Use image node_id 1 for calling the TestScaleIntensityRangePercentilesd obj's underlying member method code with example usage: obj.test_scaling() without return types