acia.tracking.utils#

Utilities for tracking

acia.tracking.utils.life_cycle_lineage(tr_graph)[source]#

Compresses populated lineage to life cycle lineage (one node per cell cycle)

Parameters:

tr_graph (nx.DiGraph) – populated tracking graph

Returns:

nx.DiGraph – Life cycle lineage with cell cylces as nodes

Return type:

DiGraph

acia.tracking.utils.delete_nodes(graph, nodes_to_delete)[source]#

Delete nodes while maintaining the connectivity

Parameters:
  • graph (nx.DiGraph) – _description_

  • nodes_to_delete (list) – _description_

Returns:

nx.DiGraph – _description_

Return type:

DiGraph

acia.tracking.utils.subsample_lineage(lineage, subsampling_factor)[source]#

Subsample lineage by only takeing nodes in every n-th (subsampling_factor) frame. Connectivity is maintained.

Parameters:
  • lineage (nx.DiGraph) – lineage graph (needs the frame attributes)

  • subsampling_factor (int) – n-th frame will taken into account

Returns:

nx.DiGraph – Returns the pruned lineage only containing nodes of every n-th frame

Return type:

DiGraph

acia.tracking.utils.tracklet_to_tracking(ov, tracklet_graph)[source]#

Compute a tracking graph based on the tracklet graph and an overlay

Parameters:
  • ov (Overlay) – the current overlay

  • tracklet_graph (nx.DiGraph) – the corresponding tracklet_graph

Returns:

nx.DiGraph – the resulting tracking graph

Return type:

DiGraph

acia.tracking.utils.merge_incosistent_segmentation(sub_ov, tracklet_graph, num_timesteps=3)[source]#

Merges incosistent segmentation using the tracking information

Parameters:
  • sub_ov (Overlay) – overlay containing segmentation information

  • tracklet_graph (nx.DiGraph) – the tracklet graph

  • num_timesteps (int, optional) – minimal number of timesteps that a segmentation must exist. Defaults to 3.

Returns:

tuple[Overlay, nx.DiGraph] – new overlay and tracklet_graph

Return type:

tuple[Overlay, DiGraph]

acia.tracking.utils.compute_trace(lineage)[source]#

Computes the trace (cell heritage in a sequence) for every node in the lineage

Parameters:

lineage (nx.DiGraph) – the lineage. Node ids will be concatenated to trace

Returns:

dict – Dictionary that contains the trace (str) for every node (type of lineage node)

Return type:

dict