Using multi-scale histograms to answer pattern existence and shape match queries | Synapse