Topological analysis of discrete scalar data