non-local-means: change some variable names
non-local-means: reimplement patch space scaling

* Previous version added NA values (that is, not available data) at
  the edges of the matrix. This version seems to avoid that problem
  (I still don't know exactly how the indices should go exactly).