streamlines: translate ends bitmask into a bitmask for topology