docstr: testing default kwargs and obj_kwargs
docstr_tok: ["testing","default","kwargs","and","obj_kwargs"]
code: def test_write_rgb(self):
      """testing default kwargs and obj_kwargs"""
      with tempfile.TemporaryDirectory() as out_dir:
          image_name = os.path.join(out_dir, "test.png")
          img = np.random.rand(2, 3, 3)
          img_save_val = (255 * img).astype(np.uint8)
          writer_obj = PILWriter(output_dtype=np.uint8)
          writer_obj.set_data_array(img, channel_dim=-1)
          writer_obj.write(image_name)
          out = np.asarray(Image.open(image_name))
          out = np.moveaxis(out, 0, 1)
          np.testing.assert_allclose(out, img_save_val)
  
file_path: MONAI/tests/test_png_rw.py
imports: from __future__ import annotations
  import os
  import tempfile
  import unittest
  import numpy
  from PIL import Image
  from monai.data.image_writer import PILWriter
label_desc: Use image node_id 4 for calling the TestPngWrite obj's underlying member method code with example usage: obj.test_write_rgb() without return types