code: def test_rgb(self):
      # RGB image
      input_img_rgb = np.expand_dims(
          np.repeat(self.input_img_np, 3, axis=0), axis=0
      )
      input_img_rgb_torch = torch.from_numpy(input_img_rgb)
  
      transform = UltrasoundConfidenceMapTransform(sink_mode="all")
      result_torch = transform(input_img_rgb_torch)
      self.assertIsInstance(result_torch, torch.Tensor)
      assert_allclose(
          result_torch,
          torch.tensor(SINK_ALL_OUTPUT),
          rtol=1e-4,
          atol=1e-4,
      )
      result_np = transform(input_img_rgb)
      self.assertIsInstance(result_np, np.ndarray)
      assert_allclose(result_np, SINK_ALL_OUTPUT, rtol=1e-4, atol=1e-4)
  
      transform = UltrasoundConfidenceMapTransform(sink_mode="mid")
      result_torch = transform(input_img_rgb_torch)
      self.assertIsInstance(result_torch, torch.Tensor)
      assert_allclose(
          result_torch,
          torch.tensor(SINK_MID_OUTPUT),
          rtol=1e-4,
          atol=1e-4,
      )
      result_np = transform(input_img_rgb)
      self.assertIsInstance(result_np, np.ndarray)
      assert_allclose(result_np, SINK_MID_OUTPUT, rtol=1e-4, atol=1e-4)
  
      transform = UltrasoundConfidenceMapTransform(sink_mode="min")
      result_torch = transform(input_img_rgb_torch)
      self.assertIsInstance(result_torch, torch.Tensor)
      assert_allclose(
          result_torch,
          torch.tensor(SINK_MIN_OUTPUT),
          rtol=1e-4,
          atol=1e-4,
      )
      result_np = transform(input_img_rgb)
      self.assertIsInstance(result_np, np.ndarray)
      assert_allclose(result_np, SINK_MIN_OUTPUT, rtol=1e-4, atol=1e-4)
  
      transform = UltrasoundConfidenceMapTransform(sink_mode="mask")
      result_torch = transform(
          input_img_rgb_torch, self.input_mask_torch
      )
      self.assertIsInstance(result_torch, torch.Tensor)
      assert_allclose(
          result_torch,
          torch.tensor(SINK_MASK_OUTPUT),
          rtol=1e-4,
          atol=1e-4,
      )
      result_np = transform(input_img_rgb, self.input_mask_np)
      self.assertIsInstance(result_np, np.ndarray)
      assert_allclose(result_np, SINK_MASK_OUTPUT, rtol=1e-4, atol=1e-4)
  
file_path: MONAI/tests/test_ultrasound_confidence_map_transform.py
imports: from __future__ import annotations
  import unittest
  import numpy
  import torch
  from monai.transforms import UltrasoundConfidenceMapTransform
  from tests.utils import assert_allclose
label_desc: Use image node_id 3 for calling the TestUltrasoundConfidenceMapTransform obj's underlying member method code with example usage: obj.test_rgb() without return types