def mask_to_positions(maskstring):
 return nonzero(array(map(int, maskstring)))[0]

def mask_to_positions ( maskstring ) : return nonzero ( array ( map ( int , maskstring ) ) ) [ 0 ]
converts lanemask binary string to array of valid indices .