code: def test_value(
      self, device, metric, directed, input_data, expected_value
  ):
      percentile = None
      if len(input_data) == 4:
          [seg_1, seg_2, spacing, percentile] = input_data
      else:
          [seg_1, seg_2, spacing] = input_data
  
      seg_1 = torch.tensor(seg_1, device=device)
      seg_2 = torch.tensor(seg_2, device=device)
      hd_metric = HausdorffDistanceMetric(
          include_background=False,
          distance_metric=metric,
          percentile=percentile,
          directed=directed,
      )
      # shape of seg_1, seg_2 are: HWD, converts to BNHWD
      batch, n_class = 2, 3
      batch_seg_1 = (
          seg_1.unsqueeze(0)
          .unsqueeze(0)
          .repeat([batch, n_class, 1, 1, 1])
      )
      batch_seg_2 = (
          seg_2.unsqueeze(0)
          .unsqueeze(0)
          .repeat([batch, n_class, 1, 1, 1])
      )
      hd_metric(batch_seg_1, batch_seg_2, spacing=spacing)
      result: torch.Tensor = hd_metric.aggregate(reduction="mean")  # type: ignore
      np.testing.assert_allclose(
          expected_value, result.cpu(), rtol=1e-6
      )
      np.testing.assert_equal(result.device, seg_1.device)
  
file_path: MONAI/tests/test_hausdorff_distance.py
imports: from __future__ import annotations
  import unittest
  from itertools import product
  import numpy
  import torch
  from parameterized import parameterized
  from monai.metrics import HausdorffDistanceMetric
label_desc: Use image node_id 1 for calling the TestHausdorffDistance obj's underlying member method code with example usage: obj.test_value(device, metric, directed, input_data, expected_value) without return types