itasc.core.lineage

Per-track temporal presence (“swimlane”) model from a tracked label stack.

This is the data half of the correction lineage graph: for each track id it records the frame ranges where the cell is present, collapsed into contiguous segments so a gap (track vanishes then returns — a likely ID swap or missed link) reads as a break between segments. It is deliberately array-only — true parent/daughter division edges live in the Ultrack database and are a separate, heavier concern layered on top later.

Functions

build_lineage(tracked)

Build a LineageModel from a (T, Y, X) tracked label stack.

Classes

LineageModel(n_frames, lanes)

All track lanes plus the total frame count, for the lineage panel.

TrackLane(cell_id, segments)

One track id and the frame segments where it is present.

TrackSegment(start, end)

A contiguous run of frames [start, end] (inclusive) for one track.

class itasc.core.lineage.LineageModel(n_frames, lanes)[source]

Bases: object

All track lanes plus the total frame count, for the lineage panel.

Parameters:
n_frames: int
lanes: tuple[TrackLane, ...]
lane_for(cell_id)[source]
Return type:

TrackLane | None

Parameters:

cell_id (int)

class itasc.core.lineage.TrackLane(cell_id, segments)[source]

Bases: object

One track id and the frame segments where it is present.

Parameters:
cell_id: int
segments: tuple[TrackSegment, ...]
property first_frame: int
property last_frame: int
property n_frames: int
property has_gap: bool
class itasc.core.lineage.TrackSegment(start, end)[source]

Bases: object

A contiguous run of frames [start, end] (inclusive) for one track.

Parameters:
start: int
end: int
property length: int
itasc.core.lineage.build_lineage(tracked)[source]

Build a LineageModel from a (T, Y, X) tracked label stack.

A singleton Z axis ((T, 1, Y, X)) is squeezed; a single 2D frame is treated as one timepoint. Lanes are sorted by track id so a cell keeps its row across refreshes; correction actions (retrack, extend, relabel, …) that change a track’s id move it to its new sorted position on the next refresh.

Return type:

LineageModel

Parameters:

tracked (ndarray)