docstr: Test the normal functioning of the method.
docstr_tok: ["Test","the","normal","functioning","of","the","method","."]
code: def test_Method(self):
      """Test the normal functioning of the method."""
      # test training with good and bad images
      irs = IntensityRangeStandardization()
      irs.train(
          TestIntensityRangeStandardization.good_trainingset
          + [TestIntensityRangeStandardization.bad_image]
      )
      irs.transform(TestIntensityRangeStandardization.bad_image)
  
      # test equal methods
      irs = IntensityRangeStandardization()
      irs_ = irs.train(
          TestIntensityRangeStandardization.good_trainingset
      )
      self.assertEqual(irs, irs_)
  
      irs = IntensityRangeStandardization()
      irs.train(TestIntensityRangeStandardization.good_trainingset)
      timages = []
      for i in TestIntensityRangeStandardization.good_trainingset:
          timages.append(irs.transform(i))
  
      irs = IntensityRangeStandardization()
      irs_, timages_ = irs.train_transform(
          TestIntensityRangeStandardization.good_trainingset
      )
  
      self.assertEqual(
          irs,
          irs_,
          "instance returned by transform() method is not the same as the once initialized",
      )
      for ti, ti_ in zip(timages, timages_):
          numpy.testing.assert_allclose(
              ti,
              ti_,
              err_msg="train_transform() failed to produce the same results as transform()",
          )
  
      # test pickling
      irs = IntensityRangeStandardization()
      irs_ = irs.train(
          TestIntensityRangeStandardization.good_trainingset
      )
      timages = []
      for i in TestIntensityRangeStandardization.good_trainingset:
          timages.append(irs.transform(i))
  
      with tempfile.TemporaryFile() as f:
          pickle.dump(irs, f)
          f.seek(0, 0)
          irs_ = pickle.load(f)
  
      timages_ = []
      for i in TestIntensityRangeStandardization.good_trainingset:
          timages_.append(irs_.transform(i))
  
      for ti, ti_ in zip(timages, timages_):
          numpy.testing.assert_allclose(
              ti,
              ti_,
              err_msg="pickling failed to preserve the instances model",
          )
  
file_path: medpy/tests/filter_/IntensityRangeStandardization.py
imports: import unittest
  import tempfile
  import pickle
  import numpy
  from medpy.filter import IntensityRangeStandardization, UntrainedException, InformationLossException, SingleIntensityAccumulationError
label_desc: Use image node_id 5 for calling the TestIntensityRangeStandardization obj's underlying member method code with example usage: obj.test_Method() without return types