code: def test_value(self, input_data, mode2, expected_box, expected_area):
      expected_box = convert_data_type(expected_box, dtype=np.float32)[
          0
      ]
      boxes1 = convert_data_type(input_data["boxes"], dtype=np.float32)[
          0
      ]
      mode1 = input_data["mode"]
      half_bool = input_data["half"]
      spatial_size = input_data["spatial_size"]
  
      # test float16
      if half_bool:
          boxes1 = convert_data_type(boxes1, dtype=np.float16)[0]
          expected_box = convert_data_type(
              expected_box, dtype=np.float16
          )[0]
  
      # test convert_box_mode, convert_box_to_standard_mode
      result2 = convert_box_mode(
          boxes=boxes1, src_mode=mode1, dst_mode=mode2
      )
      assert_allclose(
          result2,
          expected_box,
          type_test=True,
          device_test=True,
          atol=0.0,
      )
  
      result1 = convert_box_mode(
          boxes=result2, src_mode=mode2, dst_mode=mode1
      )
      assert_allclose(
          result1, boxes1, type_test=True, device_test=True, atol=0.0
      )
  
      result_standard = convert_box_to_standard_mode(
          boxes=boxes1, mode=mode1
      )
      expected_box_standard = convert_box_to_standard_mode(
          boxes=expected_box, mode=mode2
      )
      assert_allclose(
          result_standard,
          expected_box_standard,
          type_test=True,
          device_test=True,
          atol=0.0,
      )
  
      # test box_area, box_iou, box_giou, box_pair_giou
      assert_allclose(
          box_area(result_standard),
          expected_area,
          type_test=True,
          device_test=True,
          atol=0.0,
      )
      iou_metrics = (box_iou, box_giou)
      for p in iou_metrics:
          self_iou = p(
              boxes1=result_standard[1:2, :],
              boxes2=result_standard[1:1, :],
          )
          assert_allclose(self_iou, np.array([[]]), type_test=False)
  
          self_iou = p(
              boxes1=result_standard[1:2, :],
              boxes2=result_standard[1:2, :],
          )
          assert_allclose(self_iou, np.array([[1.0]]), type_test=False)
  
      self_iou = box_pair_giou(
          boxes1=result_standard[1:1, :], boxes2=result_standard[1:1, :]
      )
      assert_allclose(self_iou, np.array([]), type_test=False)
  
      self_iou = box_pair_giou(
          boxes1=result_standard[1:2, :], boxes2=result_standard[1:2, :]
      )
      assert_allclose(self_iou, np.array([1.0]), type_test=False)
  
      # test box_centers, centers_in_boxes, boxes_center_distance
      result_standard_center = box_centers(result_standard)
      expected_center = convert_box_mode(
          boxes=boxes1, src_mode=mode1, dst_mode="cccwhd"
      )[:, :3]
      assert_allclose(
          result_standard_center,
          expected_center,
          type_test=True,
          device_test=True,
          atol=0.0,
      )
  
      center = expected_center
      center[2, :] += 10
      result_centers_in_boxes = centers_in_boxes(
          centers=center, boxes=result_standard
      )
      assert_allclose(
          result_centers_in_boxes,
          np.array([False, True, False]),
          type_test=False,
      )
  
      center_dist, _, _ = boxes_center_distance(
          boxes1=result_standard[1:2, :], boxes2=result_standard[1:1, :]
      )
      assert_allclose(center_dist, np.array([[]]), type_test=False)
      center_dist, _, _ = boxes_center_distance(
          boxes1=result_standard[1:2, :], boxes2=result_standard[1:2, :]
      )
      assert_allclose(center_dist, np.array([[0.0]]), type_test=False)
      center_dist, _, _ = boxes_center_distance(
          boxes1=result_standard[0:1, :], boxes2=result_standard[0:1, :]
      )
      assert_allclose(center_dist, np.array([[0.0]]), type_test=False)
  
      # test clip_boxes_to_image
      clipped_boxes, keep = clip_boxes_to_image(
          expected_box_standard, spatial_size, remove_empty=True
      )
      assert_allclose(
          expected_box_standard[keep, :],
          expected_box_standard[1:, :],
          type_test=True,
          device_test=True,
          atol=0.0,
      )
      assert_allclose(
          id(clipped_boxes) != id(expected_box_standard),
          True,
          type_test=False,
          device_test=False,
          atol=0.0,
      )
  
      # test non_max_suppression
      nms_box = non_max_suppression(
          boxes=result_standard,
          scores=boxes1[:, 1] / 2.0,
          nms_thresh=1.0,
          box_overlap_metric=box_giou,
      )
      assert_allclose(nms_box, [1, 2, 0], type_test=False)
  
      nms_box = non_max_suppression(
          boxes=result_standard,
          scores=boxes1[:, 1] / 2.0,
          nms_thresh=-1.0,
          box_overlap_metric=box_iou,
      )
      assert_allclose(nms_box, [1], type_test=False)
  
file_path: MONAI/tests/test_box_utils.py
imports: from __future__ import annotations
  import unittest
  import numpy
  from parameterized import parameterized
  from monai.data.box_utils import CenterSizeMode, CornerCornerModeTypeA, CornerCornerModeTypeB, CornerCornerModeTypeC, CornerSizeMode, box_area, box_centers, box_giou, box_iou, box_pair_giou, boxes_center_distance, centers_in_boxes, clip_boxes_to_image, convert_box_mode, convert_box_to_standard_mode, non_max_suppression
  from monai.utils.type_conversion import convert_data_type
  from tests.utils import TEST_NDARRAYS, assert_allclose
label_desc: Use image node_id 1 for calling the TestCreateBoxList obj's underlying member method code with example usage: obj.test_value(input_data, mode2, expected_box, expected_area) without return types