code: def compute(self):
      if self.test is None or self.reference is None:
          raise ValueError(
              "'test' and 'reference' must both be set to compute confusion matrix."
          )
  
      assert_shape(self.test, self.reference)
  
      self.tp = int(((self.test != 0) * (self.reference != 0)).sum())
      self.fp = int(((self.test != 0) * (self.reference == 0)).sum())
      self.tn = int(((self.test == 0) * (self.reference == 0)).sum())
      self.fn = int(((self.test == 0) * (self.reference != 0)).sum())
      self.size = int(np.prod(self.reference.shape, dtype=np.int64))
      self.test_empty = not np.any(self.test)
      self.test_full = np.all(self.test)
      self.reference_empty = not np.any(self.reference)
      self.reference_full = np.all(self.reference)
  
imports: import numpy
  from medpy import metric
label_desc: Use image node_id 5 for calling the ConfusionMatrix obj's underlying member method code with example usage: obj.compute() without return types