def _divide_side(lobe, x):
 lobe = np.asarray(lobe)
 median = np.median(x[lobe])
 left = lobe[np.where((x[lobe] < median))[0]]
 right = lobe[np.where((x[lobe] > median))[0]]
 medians = np.where((x[lobe] == median))[0]
 left = np.sort(np.concatenate([left, lobe[medians[1::2]]]))
 right = np.sort(np.concatenate([right, lobe[medians[::2]]]))
 return (list(left), list(right))

def _divide_side ( lobe , x ) : lobe = np . asarray ( lobe ) median = np . median ( x [ lobe ] ) left = lobe [ np . where ( ( x [ lobe ] < median ) ) [ 0 ] ] right = lobe [ np . where ( ( x [ lobe ] > median ) ) [ 0 ] ] medians = np . where ( ( x [ lobe ] == median ) ) [ 0 ] left = np . sort ( np . concatenate ( [ left , lobe [ medians [ 1 : : 2 ] ] ] ) ) right = np . sort ( np . concatenate ( [ right , lobe [ medians [ : : 2 ] ] ] ) ) return ( list ( left ) , list ( right ) )
helper for making a separation between left and right lobe evenly .