class_docstr: A class to implement some FFT smoothers for Image objects.
  By default, this does a Gaussian kernel smooth. More choices
  would be better!
class_docstr_tok: ["A","class","to","implement","some","FFT","smoothers","for","Image","objects",".","By","default",",","this","does","a","Gaussian","kernel","smooth",".","More","choices","would","be","better","!"]
docstr: Compute the (periodic, i.e. on a torus) squared distance needed for
  FFT smoothing. Assumes coordinate system is linear.
  
  Parameters
  ----------
  X : array
     array of points
  axis : int, optional
     axis containing coordinates. Default -1
docstr_tok: ["Compute","the","(","periodic",",","i.e",".","on","a","torus",")","squared","distance","needed","for","FFT","smoothing",".","Assumes","coordinate","system","is","linear",".","Parameters","--","--","--","--","--","X",":","array","array","of","points","axis",":","int",",","optional","axis","containing","coordinates",".","Default","-1"]
code: def _normsq(self, X, axis=-1):
      """
      Compute the (periodic, i.e. on a torus) squared distance needed for
      FFT smoothing. Assumes coordinate system is linear.
  
      Parameters
      ----------
      X : array
         array of points
      axis : int, optional
         axis containing coordinates. Default -1
      """
      # copy X
      _X = np.array(X)
      # roll coordinate axis to front
      _X = np.rollaxis(_X, axis)
      # convert coordinates to FWHM units
      if self.fwhm != 1.0:
          f = fwhm2sigma(self.fwhm)
          if f.shape == ():
              f = np.ones(len(self.bshape)) * f
          for i in range(len(self.bshape)):
              _X[i] /= f[i]
      # whiten?
      if self.cov is not None:
          _chol = npl.cholesky(self.cov)
          _X = np.dot(npl.inv(_chol), _X)
      # compute squared distance
      D2 = np.sum(_X**2, axis=0)
      return D2
  
file_path: nipy/nipy/algorithms/kernel_smooth.py
imports: import gc
  import numpy
  import numpy.linalg
  from numpy import fft
  from nipy.core.api import AffineTransform, Image
  from nipy.core.reference.coordinate_map import product
  from nipy.utils import seq_prod
label_desc: Use image node_id 3 for calling the LinearFilter obj's underlying member method code with example usage: obj._normsq(X, axis) and returns: D2