non-local-means: add code to perform PCA and reduce patch dimensionality