code: def __init__(
      self,
      seg_img,
      ref_img,
      measures=None,
      num_neighbors=8,
      pixdim=(1, 1, 1),
      empty=False,
      list_labels=None,
  ):
      self.m_dict = {
          "ref volume": (self.n_pos_ref, "Volume (Ref)"),
          "seg volume": (self.n_pos_seg, "Volume (Seg)"),
          "ref bg volume": (self.n_neg_ref, "Volume (Ref bg)"),
          "seg bg volume": (self.n_neg_seg, "Volume (Seg bg)"),
          "list_labels": (self.list_labels, "List Labels Seg"),
          "fp": (self.fp, "FP"),
          "fn": (self.fn, "FN"),
          "tp": (self.tp, "TP"),
          "tn": (self.tn, "TN"),
          "n_intersection": (self.n_intersection, "Intersection"),
          "n_union": (self.n_union, "Union"),
          "sensitivity": (self.sensitivity, "Sens"),
          "specificity": (self.specificity, "Spec"),
          "accuracy": (self.accuracy, "Acc"),
          "fpr": (self.false_positive_rate, "FPR"),
          "ppv": (self.positive_predictive_values, "PPV"),
          "npv": (self.negative_predictive_values, "NPV"),
          "dice": (self.dice_score, "Dice"),
          "IoU": (self.intersection_over_union, "IoU"),
          "jaccard": (self.jaccard, "Jaccard"),
          "informedness": (self.informedness, "Informedness"),
          "markedness": (self.markedness, "Markedness"),
          "vol_diff": (self.vol_diff, "VolDiff"),
          "ave_dist": (self.measured_average_distance, "AveDist"),
          "haus_dist": (self.measured_hausdorff_distance, "HausDist"),
          "connected_elements": (
              self.connected_elements,
              "TPc,FPc,FNc",
          ),
          "outline_error": (self.outline_error, "OER,OEFP,OEFN"),
          "detection_error": (self.detection_error, "DE,DEFP,DEFN"),
          "com_dist": (self.com_dist, "COM distance"),
          "com_ref": (self.com_ref, "COM reference"),
          "com_seg": (self.com_seg, "COM segmentation"),
      }
      self.seg = seg_img
      self.ref = ref_img
      self.list_labels = list_labels
      self.flag_empty = empty
      self.measures = measures if measures is not None else self.m_dict
      self.neigh = num_neighbors
      self.pixdim = pixdim
  
imports: from __future__ import absolute_import, print_function
  import numpy
  from scipy import ndimage
  from niftynet.utilities.util_common import MorphologyOps, CacheFunctionOutput
label_desc: Use image node_id 1 to create a new PairwiseMeasures object from inherited base classes: object with example: obj = PairwiseMeasures(seg_img, ref_img, measures, num_neighbors, pixdim, empty, list_labels)