code: def test_orientation(self, array, affine, reader_param, expected):
      test_image = make_nifti_image(array, affine)
  
      # read test cases
      loader = LoadImage(**reader_param)
      load_result = loader(test_image)
      data_array = load_result.numpy()
      if reader_param.get("image_only", False):
          header = None
      else:
          header = load_result.meta
          header["affine"] = header["affine"].numpy()
      if os.path.exists(test_image):
          os.remove(test_image)
  
      # write test cases
      writer_obj = NibabelWriter()
      writer_obj.set_data_array(data_array, channel_dim=None)
      if header is not None:
          writer_obj.set_metadata(header)
      elif affine is not None:
          writer_obj.set_metadata({"affine": affine})
      writer_obj.write(test_image, verbose=True)
      saved = nib.load(test_image)
      saved_affine = saved.affine
      saved_data = saved.get_fdata()
      if os.path.exists(test_image):
          os.remove(test_image)
  
      if affine is not None:
          assert_allclose(saved_affine, affine, type_test=False)
      assert_allclose(saved_data, expected, type_test=False)
  
file_path: MONAI/tests/test_nifti_rw.py
imports: from __future__ import annotations
  import os
  import tempfile
  import unittest
  import nibabel
  import numpy
  from parameterized import parameterized
  from monai.data import NibabelWriter
  from monai.transforms import LoadImage, Orientation, Spacing
  from tests.utils import TEST_NDARRAYS, assert_allclose, make_nifti_image
label_desc: Use image node_id 1 for calling the TestNiftiLoadRead obj's underlying member method code with example usage: obj.test_orientation(array, affine, reader_param, expected) without return types