code: def test_seg_nrrd(self, args, input_data):
      args.update({"nibabel": False})
      input_data["pred"] = MULTI_CHANNEL_DATA
      input_data["result_extension"] = ".seg.nrrd"
      input_data["labels"] = ["heart", "lung"]
      input_data["color_map"] = COLOR_MAP
  
      output_file, data = Writer(**args)(input_data)
      self.assertEqual(os.path.exists(output_file), True)
      arr_full, header = nrrd.read(output_file)
  
      self.assertEqual(arr_full.shape, (CHANNELS, WIDTH, HEIGHT, 1))
  
      # TODO:: This depends on later versions of numpy (fix the input/output comparisons for nans)
      space_directions_expected = np.array(
          [
              [np.nan, np.nan, np.nan],
              [-1.0, 0.0, 0.0],
              [0.0, -1.0, 0.0],
              [0.0, 0.0, 1.0],
          ]
      )
      # self.assertTrue(np.array_equal(header["space directions"], space_directions_expected, equal_nan=True))
  
      self.assertEqual(
          header["kinds"], ["list", "domain", "domain", "domain"]
      )
      self.assertEqual(header["Segment1_ID"], "lung")
      self.assertEqual(
          header["Segment1_Color"],
          " ".join(map(str, COLOR_MAP["lung"])),
      )
  
      file_ext = "".join(pathlib.Path(output_file).suffixes)
      self.assertIn(file_ext.lower(), [".seg.nrrd"])
  
imports: import json
  import os
  import pathlib
  import unittest
  import nrrd
  import numpy
  import torch
  from parameterized import parameterized
  from monailabel.transform.writer import DetectionWriter, PolygonWriter, Writer
label_desc: Use image node_id 2 for calling the TestWriter obj's underlying member method code with example usage: obj.test_seg_nrrd(args, input_data) without return types