Topology in Gestalt analysis