code: def test_value_2d(self, data, expected_mask):
      test_dtype = [torch.float32, torch.float16]
      for dtype in test_dtype:
          data = CastToTyped(keys=["image", "boxes"], dtype=dtype)(data)
          transform_to_mask = BoxToMaskd(
              box_keys="boxes",
              box_mask_keys="box_mask",
              box_ref_image_keys="image",
              label_keys="labels",
              min_fg_label=0,
              ellipse_mask=False,
          )
          transform_to_box = MaskToBoxd(
              box_keys="boxes",
              box_mask_keys="box_mask",
              label_keys="labels",
              min_fg_label=0,
          )
          data_mask = transform_to_mask(data)
          assert_allclose(
              data_mask["box_mask"],
              expected_mask,
              type_test=True,
              device_test=True,
              atol=1e-3,
          )
          data_back = transform_to_box(data_mask)
          assert_allclose(
              data_back["boxes"],
              data["boxes"],
              type_test=False,
              device_test=False,
              atol=1e-3,
          )
          assert_allclose(
              data_back["labels"],
              data["labels"],
              type_test=False,
              device_test=False,
              atol=1e-3,
          )
  
file_path: MONAI/tests/test_box_transform.py
imports: from __future__ import annotations
  import unittest
  from copy import deepcopy
  import numpy
  import torch
  from parameterized import parameterized
  from monai.apps.detection.transforms.box_ops import convert_mask_to_box
  from monai.apps.detection.transforms.dictionary import AffineBoxToImageCoordinated, AffineBoxToWorldCoordinated, BoxToMaskd, ClipBoxToImaged, ConvertBoxModed, FlipBoxd, MaskToBoxd, RandCropBoxByPosNegLabeld, RandFlipBoxd, RandRotateBox90d, RandZoomBoxd, RotateBox90d, ZoomBoxd
  from monai.data.meta_tensor import MetaTensor
  from monai.transforms import CastToTyped, Invertd
  from tests.utils import TEST_NDARRAYS, assert_allclose
label_desc: Use image node_id 2 for calling the TestBoxTransform obj's underlying member method code with example usage: obj.test_value_2d(data, expected_mask) without return types