docstr: Checks whether self.seg and self.ref are binary. This is to enable
  measurements such as 'false positives', which only have meaning in 
  the binary case (what is positive/negative for multiple class?)
docstr_tok: ["Checks","whether","self.seg","and","self.ref","are","binary",".","This","is","to","enable","measurements","such","as","'false","positives","'",",","which","only","have","meaning","in","the","binary","case","(","what","is","positive\/negative","for","multiple","class","?",")"]
code: def check_binary(self):
      """
      Checks whether self.seg and self.ref are binary. This is to enable
      measurements such as 'false positives', which only have meaning in
      the binary case (what is positive/negative for multiple class?)
      """
  
      is_seg_binary, is_ref_binary = [
          ((x > 0.5) == x).all() for x in [self.seg, self.ref]
      ]
      if (not is_ref_binary) or (not is_seg_binary):
          raise ValueError(
              "The input segmentation/reference images"
              " must be binary for this function."
          )
  
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 2 for calling the PairwiseMeasures obj's underlying member method code with example usage: obj.check_binary() without return types