code: def r2(self):
      ref_var = np.sum(np.square(self.ref - np.mean(self.ref)))
      reg_var = np.sum(np.square(self.reg - np.mean(self.reg)))
      cov_refreg = np.sum(
          (self.reg - np.mean(self.reg))
          * (self.ref - np.mean(self.ref))
      )
      return np.square(
          cov_refreg / np.sqrt(ref_var * reg_var + 0.00001)
      )
  
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 5 for calling the PairwiseMeasuresRegression obj's underlying member method code with example usage: obj.r2() and returns: np