Filter for nonzero components in collapse_elements(..)