class_docstr: Merge and save evaluation results.
docstr: Merge the results and compute final dice scores.
docstr_tok: ["Merge","the","results","and","compute","final","dice","scores","."]
code: def finish(self):
      """Merge the results and compute final dice scores."""
      area_int = np.concatenate(self._area_int)
      area_sum = np.concatenate(self._area_sum)
  
      if FLAGS.sampled_2d_slices:
          # Merge the results on 2d slices.
          assert (
              area_int.size % (FLAGS.ct_resolution - FLAGS.image_c + 1)
              == 0
          ), "Wrong number of results: {}".format(area_int.shape)
          area_int = area_int.reshape(
              [-1, FLAGS.ct_resolution - FLAGS.image_c + 1]
          )
          area_int = area_int.sum(axis=1)
          area_sum = area_sum.reshape(
              [-1, FLAGS.ct_resolution - FLAGS.image_c + 1]
          )
          area_sum = area_sum.sum(axis=1)
  
      dice_per_case = (2 * area_int / (area_sum + 0.001)).mean()
      dice_global = 2 * area_int.sum() / (area_sum.sum() + 0.001)
      # pylint: disable=logging-format-interpolation
      tf.logging.info(
          "dice_per_case: {}, dice_global: {}".format(
              dice_per_case, dice_global
          )
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  import os
  import mesh_tensorflow
  import numpy
  from six.moves import range
  import tensorflow.compat.v1
  from mesh_tensorflow.experimental import data_aug_lib
  from tensorflow.python.platform import flags
label_desc: Use image node_id 3 for calling the PostProcessor obj's underlying member method code with example usage: obj.finish() without return types