code: def test_channel_wise(self, p):
      scaler = RandScaleIntensity(
          factors=0.5, channel_wise=True, prob=1.0
      )
      scaler.set_random_state(seed=0)
      im = p(self.imt)
      result = scaler(im)
      np.random.seed(0)
      # simulate the randomize() of transform
      np.random.random()
      channel_num = self.imt.shape[0]
      factor = [
          np.random.uniform(low=-0.5, high=0.5)
          for _ in range(channel_num)
      ]
      expected = p(
          np.stack(
              [
                  np.asarray((self.imt[i]) * (1 + factor[i]))
                  for i in range(channel_num)
              ]
          ).astype(np.float32)
      )
      assert_allclose(
          result, expected, atol=0, rtol=1e-5, type_test=False
      )
  
file_path: MONAI/tests/test_rand_scale_intensity.py
imports: from __future__ import annotations
  import unittest
  import numpy
  from parameterized import parameterized
  from monai.transforms import RandScaleIntensity
  from tests.utils import TEST_NDARRAYS, NumpyImageTestCase2D, assert_allclose
label_desc: Use image node_id 2 for calling the TestRandScaleIntensity obj's underlying member method code with example usage: obj.test_channel_wise(p) without return types