Disentangling neural mechanisms for perceptual grouping