docstr: This functions determines the map of distance from the borders of the
  segmentation and the reference and the border maps themselves
  
  :return: distance_border_ref, distance_border_seg, border_ref,
      border_seg
docstr_tok: ["This","functions","determines","the","map","of","distance","from","the","borders","of","the","segmentation","and","the","reference","and","the","border","maps","themselves",":","return",":","distance_border_ref",",","distance_border_seg",",","border_ref",",","border_seg"]
code: def border_distance(self):
      """
      This functions determines the map of distance from the borders of the
      segmentation and the reference and the border maps themselves
  
      :return: distance_border_ref, distance_border_seg, border_ref,
          border_seg
      """
      border_ref = MorphologyOps(self.ref, self.neigh).border_map()
      border_seg = MorphologyOps(self.seg, self.neigh).border_map()
      oppose_ref = 1 - self.ref
      oppose_seg = 1 - self.seg
      # euclidean distance transform
      distance_ref = ndimage.distance_transform_edt(oppose_ref)
      distance_seg = ndimage.distance_transform_edt(oppose_seg)
      distance_border_seg = border_ref * distance_seg
      distance_border_ref = border_seg * distance_ref
      return (
          distance_border_ref,
          distance_border_seg,
          border_ref,
          border_seg,
      )
  
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 35 for calling the PairwiseMeasures obj's underlying member method code with example usage: obj.border_distance() and returns: distance_border_ref,  distance_border_seg,  border_ref,  border_seg