test_tree_widget_utils

Functions

graph_2d()

assign_tracklet_ids(→ tuple[networkx.DiGraph, ...)

Add a track_id attribute to a graph by removing division edges,

test_track_df(graph_2d)

Module Contents

test_tree_widget_utils.graph_2d()
test_tree_widget_utils.assign_tracklet_ids(graph: networkx.DiGraph) tuple[networkx.DiGraph, list[Any], int]

Add a track_id attribute to a graph by removing division edges, assigning one id to each connected component. Designed as a helper for visualizing the graph in the napari Tracks layer.

Args:

graph (nx.DiGraph): A networkx graph with a tracking solution

Returns:

nx.DiGraph, list[Any], int: The same graph with the track_id assigned. Probably occurrs in place but returned just to be clear. Also returns a list of edges that are between tracks (e.g. at divisions), and the max track ID that was assigned

test_tree_widget_utils.test_track_df(graph_2d)