The Weight-Shape decomposition of density estimates: A framework for clustering and image analysis algorithms. (September 2018)