Skip to content

Commit

Permalink
Skeleton: add leafs property
Browse files Browse the repository at this point in the history
schlegelp committed Jun 9, 2022
1 parent 63324a3 commit ce1dea9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions skeletor/skeletonize/base.py
Original file line number Diff line number Diff line change
@@ -118,6 +118,13 @@ def skel_map(self):
).groupby(0)['index'].apply(np.array
).values

@property
def leafs(self):
"""Leaf nodes (includes root)."""
swc = self.swc
leafs = swc[~swc.node_id.isin(swc.parent_id.values) | (swc.parent_id < 0)]
return leafs.copy()

def reindex(self, inplace=False):
"""Clean up skeleton."""
x = self

0 comments on commit ce1dea9

Please sign in to comment.