code: def dice_score(gt, img):
      """Calculate the dice score for evaluation purposes"""
      gt, img = [x > 0 for x in (gt, img)]
      num = 2 * np.sum(gt & img)
      den = gt.sum() + img.sum()
      return num / den
  
file_path: NiftyNet/demos/unet/unet_demo_utils.py
imports: import os
  import nibabel
  import pandas
  import numpy
  import matplotlib.pyplot
  from skimage.io import imread
  import re
label_desc: Use image node_id 1 for calling a global function with example usage: dice_score(gt, img) and returns: unknown