code: def test_relative_scaling(self):
      img = self.imt
      data = {"img": img}
      lower = 10
      upper = 99
      b_min = 100
      b_max = 300
      scaler = ScaleIntensityRangePercentilesd(
          keys=data.keys(),
          lower=lower,
          upper=upper,
          b_min=b_min,
          b_max=b_max,
          relative=True,
      )
  
      expected_a_min = np.percentile(img, lower)
      expected_a_max = np.percentile(img, upper)
      expected_b_min = ((b_max - b_min) * (lower / 100.0)) + b_min
      expected_b_max = ((b_max - b_min) * (upper / 100.0)) + b_min
      expected_img = (img - expected_a_min) / (
          expected_a_max - expected_a_min
      )
      expected_img = (
          expected_img * (expected_b_max - expected_b_min)
      ) + expected_b_min
  
      np.testing.assert_allclose(
          expected_img, scaler(data)["img"], rtol=1e-3, atol=0.1
      )
  
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 2 for calling the TestScaleIntensityRangePercentilesd obj's underlying member method code with example usage: obj.test_relative_scaling() without return types