motile_plugin.data_model.solution_tracks
Classes
Difference from Tracks: every node must have a track_id |
Module Contents
- class motile_plugin.data_model.solution_tracks.SolutionTracks(graph: networkx.DiGraph, segmentation: numpy.ndarray | None = None, time_attr: str = NodeAttr.TIME.value, pos_attr: str | tuple[str] | list[str] = NodeAttr.POS.value, scale: list[float] | None = None, ndim: int | None = None)
Bases:
motile_plugin.data_model.tracks.Tracks
Difference from Tracks: every node must have a track_id
- max_track_id: int
- classmethod from_tracks(tracks: motile_plugin.data_model.tracks.Tracks)
- property node_id_to_track_id: dict[motile_plugin.data_model.tracks.Node, int]
- get_next_track_id() int
Return the next available track_id and update self.max_track_id
- get_track_id(node) int
- set_track_id(node: motile_plugin.data_model.tracks.Node, value: int)
- _initialize_track_ids()
- _assign_tracklet_ids()
Add a track_id attribute to a graph by removing division edges, assigning one id to each connected component. Also sets the max_track_id and initializes a dictionary from track_id to nodes
- export_tracks(outfile: pathlib.Path | str)
Export the tracks from this run to a csv with the following columns: t,[z],y,x,id,parent_id,track_id Cells without a parent_id will have an empty string for the parent_id. Whether or not to include z is inferred from self.ndim