algorithm/surf_tools.py
def _get_connvex_neigh(seedvex, faces, mask = None, masklabel = 1):
    """
    Function to get neighbouring vertices of a seed that satisfied overlap with mask
    """
    if mask is not None:
        assert mask.shape[0] == np.max(faces) + 1 ,"mask need to have same vertex number with faces connection relationship"
    assert isinstance(seedvex, (int, np.integer)), "only allow input an integer as seedvex"

    raw_faces, _ = np.where(faces == seedvex)
    rawconnvex = np.unique(faces[raw_faces])
    if mask is not None:
        connvex = set()
        list_connvex = [i for i in rawconnvex if mask[i] == masklabel]
        connvex.update(list_connvex)
    else:
        connvex = set(rawconnvex)
    connvex.discard(seedvex)
    return connvex

    Function to get neighbouring vertices of a seed that satisfied overlap with mask
    
Function to get neighbouring vertices of a seed that satisfied overlap with mask
Function to get neighbouring vertices of a seed that satisfied overlap with mask
def _get_connvex_neigh(seedvex, faces, mask = None, masklabel = 1):
    if mask is not None:
        assert mask.shape[0] == np.max(faces) + 1 ,"mask need to have same vertex number with faces connection relationship"
    assert isinstance(seedvex, (int, np.integer)), "only allow input an integer as seedvex"
    raw_faces, _ = np.where(faces == seedvex)
    rawconnvex = np.unique(faces[raw_faces])
    if mask is not None:
        connvex = set()
        list_connvex = [i for i in rawconnvex if mask[i] == masklabel]
        connvex.update(list_connvex)
    else:
        connvex = set(rawconnvex)
    connvex.discard(seedvex)
    return connvex
def _get_connvex_neigh ( seedvex , faces , mask = None , masklabel = 1 ) : if mask is not None : assert mask . shape [ 0 ] == np . max ( faces ) + 1 , "mask need to have same vertex number with faces connection relationship" assert isinstance ( seedvex , ( int , np . integer ) ) , "only allow input an integer as seedvex" raw_faces , _ = np . where ( faces == seedvex ) rawconnvex = np . unique ( faces [ raw_faces ] ) if mask is not None : connvex = set ( ) list_connvex = [ i for i in rawconnvex if mask [ i ] == masklabel ] connvex . update ( list_connvex ) else : connvex = set ( rawconnvex ) connvex . discard ( seedvex ) return connvex
Function to get neighbouring vertices of a seed that satisfied overlap with mask
Function to get neighbouring vertices of a seed that satisfied overlap with mask
"""
    Function to get neighbouring vertices of a seed that satisfied overlap with mask
    """
seedvex
faces
mask
masklabel