code: def __init__(
      self,
      test=None,
      reference=None,
      labels=None,
      metrics=None,
      advanced_metrics=None,
      nan_for_nonexisting=True,
  ):
      self.test = None
      self.reference = None
      self.confusion_matrix = ConfusionMatrix()
      self.labels = None
      self.nan_for_nonexisting = nan_for_nonexisting
      self.result = None
  
      self.metrics = []
      if metrics is None:
          for m in self.default_metrics:
              self.metrics.append(m)
      else:
          for m in metrics:
              self.metrics.append(m)
  
      self.advanced_metrics = []
      if advanced_metrics is None:
          for m in self.default_advanced_metrics:
              self.advanced_metrics.append(m)
      else:
          for m in advanced_metrics:
              self.advanced_metrics.append(m)
  
      self.set_reference(reference)
      self.set_test(test)
      if labels is not None:
          self.set_labels(labels)
      else:
          if test is not None and reference is not None:
              self.construct_labels()
  
imports: import collections
  import inspect
  import json
  import hashlib
  from datetime import datetime
  from multiprocessing.pool import Pool
  import numpy
  import pandas
  import SimpleITK
  from collections import OrderedDict
  from .metrics import ConfusionMatrix, ALL_METRICS
label_desc: Use image node_id 1 to create a new Evaluator object  with example: obj = Evaluator(test, reference, labels, metrics, advanced_metrics, nan_for_nonexisting)