docstr: This function returns the number of FP FN and TP in terms of
  connected components.
  
  :return: Number of true positive connected components, Number of
      false positives connected components, Number of false negatives
      connected components
docstr_tok: ["This","function","returns","the","number","of","FP","FN","and","TP","in","terms","of","connected","components",".",":","return",":","Number","of","true","positive","connected","components",",","Number","of","false","positives","connected","components",",","Number","of","false","negatives","connected","components"]
code: def connected_elements(self):
      """
      This function returns the number of FP FN and TP in terms of
      connected components.
  
      :return: Number of true positive connected components, Number of
          false positives connected components, Number of false negatives
          connected components
      """
      blobs_ref, blobs_seg, init = self._connected_components()
      list_blobs_ref = range(1, blobs_ref[1])
      list_blobs_seg = range(1, blobs_seg[1])
      mul_blobs_ref = np.multiply(blobs_ref[0], init)
      mul_blobs_seg = np.multiply(blobs_seg[0], init)
      list_TP_ref = np.unique(mul_blobs_ref[mul_blobs_ref > 0])
      list_TP_seg = np.unique(mul_blobs_seg[mul_blobs_seg > 0])
  
      list_FN = [x for x in list_blobs_ref if x not in list_TP_ref]
      list_FP = [x for x in list_blobs_seg if x not in list_TP_seg]
      return len(list_TP_ref), len(list_FP), len(list_FN)
  
imports: from __future__ import absolute_import, print_function
  import numpy
  from scipy import ndimage
  from niftynet.utilities.util_common import MorphologyOps, CacheFunctionOutput
label_desc: Use image node_id 40 for calling the PairwiseMeasures obj's underlying member method code with example usage: obj.connected_elements() and returns: len,  len,  len