code: def _slow_zernike(img, radius, D, cof=None):
      zvalues = []
  
      Y, X = np.where(img > 0)
      P = img[Y, X].ravel()
      if cof is None:
          cofy, cofx = center_of_mass(img)
      else:
          cofy, cofx = cof
      Yn = ((Y - cofy) / radius).ravel()
      Xn = ((X - cofx) / radius).ravel()
      k = np.sqrt(Xn**2 + Yn**2) <= 1.0
      frac_center = np.array(P[k], np.double)
      frac_center /= frac_center.sum()
      Yn = Yn[k]
      Xn = Xn[k]
      frac_center = frac_center.ravel()
  
      for n in range(D + 1):
          for l in range(n + 1):
              if (n - l) % 2 == 0:
                  z = _slow_znl(Yn, Xn, frac_center, float(n), float(l))
                  zvalues.append(abs(z))
      return np.array(zvalues)
  
file_path: mahotas/mahotas/tests/test_zernike.py
imports: import numpy
  from mahotas.features import zernike_moments
  from mahotas.center_of_mass import center_of_mass
  import mahotas
  from math import atan2, ceil
  from numpy import cos, sin, conjugate, pi, sqrt
label_desc: Use image node_id 2 for calling a global function with example usage: _slow_zernike(img, radius, D, cof) and returns: np