code: def test_scaling(self):
      img = self.imt[0]
      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)
      scaler = ScaleIntensityRangePercentiles(
          lower=lower,
          upper=upper,
          b_min=b_min,
          b_max=b_max,
          dtype=np.uint8,
      )
      for p in TEST_NDARRAYS:
          result = scaler(p(img))
          assert_allclose(
              result, p(expected), type_test="tensor", rtol=1e-4
          )
  
file_path: MONAI/tests/test_scale_intensity_range_percentiles.py
imports: from __future__ import annotations
  import unittest
  import numpy
  from monai.transforms.intensity.array import ScaleIntensityRangePercentiles
  from tests.utils import TEST_NDARRAYS, NumpyImageTestCase2D, assert_allclose
label_desc: Use image node_id 1 for calling the TestScaleIntensityRangePercentiles obj's underlying member method code with example usage: obj.test_scaling() without return types