code: def test_not_predicted_not_present(self):
      # class is present in labels, but not in prediction -> nsd of 0 should be yielded for that class; class is
      # neither present on labels, nor prediction -> nan should be yielded
      batch_size = 1
      n_class = 4
      predictions = torch.zeros((batch_size, 80, 80), dtype=torch.int64)
      labels = torch.zeros((batch_size, 80, 80), dtype=torch.int64)
      predictions[0, 10:20, 10:20] = 1
      labels[0, 10:20, 10:20] = 2
      predictions_hot = F.one_hot(
          predictions, num_classes=n_class
      ).permute(0, 3, 1, 2)
      labels_hot = F.one_hot(labels, num_classes=n_class).permute(
          0, 3, 1, 2
      )
  
      # with and without background class
      sur_metric_bgr = SurfaceDiceMetric(
          class_thresholds=[1, 1, 1, 1], include_background=True
      )
      sur_metric = SurfaceDiceMetric(
          class_thresholds=[1, 1, 1], include_background=False
      )
  
      # test per-class results
      res_bgr_classes = sur_metric_bgr(predictions_hot, labels_hot)
      np.testing.assert_array_equal(
          res_bgr_classes, [[1, 0, 0, np.nan]]
      )
      res_classes = sur_metric(predictions_hot, labels_hot)
      np.testing.assert_array_equal(res_classes, [[0, 0, np.nan]])
  
      # test aggregation
      res_bgr = sur_metric_bgr.aggregate(reduction="mean")
      np.testing.assert_equal(
          res_bgr, torch.tensor([1 / 3], dtype=torch.float)
      )
      res = sur_metric.aggregate()
      np.testing.assert_equal(res, torch.tensor([0], dtype=torch.float))
  
      predictions_empty = torch.zeros((2, 3, 1, 1))
      sur_metric_nans = SurfaceDiceMetric(
          class_thresholds=[1, 1, 1],
          include_background=True,
          get_not_nans=True,
      )
      res_classes = sur_metric_nans(
          predictions_empty, predictions_empty
      )
      res, not_nans = sur_metric_nans.aggregate()
      np.testing.assert_array_equal(
          res_classes,
          [[np.nan, np.nan, np.nan], [np.nan, np.nan, np.nan]],
      )
      np.testing.assert_equal(res, torch.tensor([0], dtype=torch.float))
      np.testing.assert_equal(
          not_nans, torch.tensor([0], dtype=torch.float)
      )
  
file_path: MONAI/tests/test_surface_dice.py
imports: from __future__ import annotations
  import unittest
  import numpy
  import torch
  import torch.nn.functional
  from monai.metrics.surface_dice import SurfaceDiceMetric, compute_surface_dice
  from tests.utils import assert_allclose
label_desc: Use image node_id 6 for calling the TestAllSurfaceDiceMetrics obj's underlying member method code with example usage: obj.test_not_predicted_not_present() without return types