code: def fuzzy_dice(gold_ppm, ppm, mask):
      """
      Fuzzy dice index.
      """
      dices = np.zeros(3)
      if gold_ppm is None:
          return dices
      for k in range(3):
          pk = gold_ppm[mask][:, k]
          qk = ppm[mask][:, k]
          PQ = np.sum(np.sqrt(np.maximum(pk * qk, 0)))
          P = np.sum(pk)
          Q = np.sum(qk)
          dices[k] = 2 * PQ / float(P + Q)
      return dices
  
imports: from argparse import ArgumentParser
  import numpy
  from nipy import load_image, save_image
  from nipy.algorithms.segmentation import BrainT1Segmentation
  from nipy.core.image.image_spaces import make_xyz_image, xyz_affine
label_desc: Use image node_id 1 for calling a global function with example usage: fuzzy_dice(gold_ppm, ppm, mask) and returns: dices, dices