cellects.video.graph_tracking
cellects.video.graph_tracking
Graph extraction on a binary video.
This module uses network functions on binary images to extract and track graph in a video.
Functions:
| Name | Description |
|---|---|
extract_graph_dynamics |
|
extract_graph_dynamics(converted_video, coord_network, arena_label, starting_time=0, origin=None, coord_pseudopods=None)
Extracts dynamic graph data from video frames based on network dynamics.
This function processes time-series binary network structures to extract evolving vertices and edges over time. It computes spatial relationships between networks and an origin point through image processing steps including contour detection, padding for alignment, skeleton extraction, and morphological analysis. Vertex and edge attributes like position, connectivity, width, intensity, and betweenness are compiled into tables saved as CSV files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
converted_video
|
NDArray
|
3D video data array (t x y x) containing pixel intensities used for calculating edge intensity attributes during table generation. |
required |
coord_network
|
NDArray[uint8]
|
3D binary network mask array (t x y x) representing connectivity structures across time points. |
required |
arena_label
|
int
|
Unique identifier to prefix output filenames corresponding to specific experimental arenas. |
required |
starting_time
|
(int, optional(default=0))
|
Time index within |
0
|
origin
|
(NDArray[uint8], optional(default=None))
|
Binary mask identifying the region of interest's central origin for spatial reference during network comparison. |
None
|
Returns:
| Type | Description |
|---|---|
None
|
|
Saves two CSV files in working directory:
|
|
1. `vertex_table{arena_label}_t{T}_y{Y}_x{X}.csv` - Vertex table with time, coordinates, and connectivity information
|
|
2. `edge_table{arena_label}_t{T}_y{Y}_x{X}.csv` - Edge table containing attributes like length, width, intensity, and betweenness
|
|
Notes
Output CSVs use NumPy arrays converted to pandas DataFrames with columns: - Vertex table includes timestamps (t), coordinates (y,x), and connectivity flags. - Edge table contains betweenness centrality calculated during skeleton processing. Origin contours are spatially aligned through padding operations to maintain coordinate consistency across time points.