29. The method of claim 28, wherein the vector elements in the input vector and the template vector have numerical values, and the sort is by numerical value.
31. The method of claim 29, wherein the numerical values indicate greyscale levels.