code: def dice_score(prediction, groundtruth):
      pflat = prediction.flatten()
      gflat = groundtruth.flatten()
      d = (1 - spatial.distance.dice(pflat, gflat)) * 100.0
      if np.isnan(d):
          return 0.0
      return d
  
file_path: medicaltorch/medicaltorch/metrics.py
imports: from collections import defaultdict
  from scipy import spatial
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: dice_score(prediction, groundtruth) and returns: d, int