Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,19 @@ def main(args):

# Label the branch points in the graph with the correct branch labels
G = label_branch_points(G, branch_points, largest_cluster_label)

#export list of branches with largest cluster label
if args.segmentation_attribute == "label":
large_branches = []

for branch in branch_connectivity_graph.nodes:
if branch_connectivity_graph.nodes[branch]['label'] and branch_connectivity_graph.nodes[branch]['label'] == largest_cluster_label:
large_branches.append(branch)
large_branches.sort()

with open('large_branches.txt','w') as file:
for branch_id in large_branches:
file.write(f"{branch_id}\n")

if args.segmentation_attribute == "dist_from_largest":
# Calculate the distance from each branch to the nearest branch in the largest cluster
Expand Down