Tracking#
Assigns stable unique identifiers to cells across consecutive scans and records the nature of each transition (continuation, split, merge, initiation, termination).
Track segmented cells across consecutive scans (tracker v2).
Per scan pair, in order:
Predict: each previous cell’s footprint is the cell advected by the flow.
Grow footprint and cell by r = r_max (1 − √A/ℓ0)₊; overlap fractions O^c, O^h on the grown shapes; u = 1 − √(O^c O^h).
Gates (hard): u ≤ u_max, speed ≤ v_max, speed change ≤ additive limit.
Cost c = u + w_d d + h (shape-aware residual of the e²-weighted centre, heading term); c ≤ c_max.
Joint assignment per group of competing cells, no-link at c_max, no crossing.
Lineage of what is left (fractions and crossing test; the speed gates bind continuations and resumptions only): resumption of a latent track, split child, merge source, initiation; unlinked tracks become latent for up to N scans.
Identity at splits and merges follows the larger score S = log A + γ log ē.
Causal: a scan’s decisions use only that scan and earlier ones, and are never
revised. Every decision is logged (decisions()).
- class adapt.modules.tracking.module.CellTracker(config)#
Bases:
objectTrack cells across scans; one
trackcall per scan, in time order.- Parameters:
config (TrackingConfig)
- decisions()#
The decision record of the most recent
trackcall (analysis only).- Return type:
TrackingDecisions
- track(ds_projected, cell_stats_df, *, scan_id)#
Process one scan; return its tracked cells and lineage events.
- Return type:
tuple[DataFrame,DataFrame]- Parameters:
ds_projected (Dataset)
cell_stats_df (DataFrame)
scan_id (str)
- adapt.modules.tracking.module.track_signature_v2(scan_id, cell_label)#
Birth signature: pure function of scan identity + label.
scan_id is sha256 of the raw scan bytes; labels are unique within a scan — so the signature is deterministic and collision-free by construction, and independent of which physics fields exist.
- Return type:
str- Parameters:
scan_id (str)
cell_label (int)