HypothesisModel

class btrack.models.HypothesisModel(*, hypotheses: list[str], lambda_time: float, lambda_dist: float, lambda_link: float, lambda_branch: float, eta: float, theta_dist: float, theta_time: float, dist_thresh: float, time_thresh: float, apop_thresh: int, segmentation_miss_rate: float, apoptosis_rate: float, relax: bool, name: str = 'Default')

Bases: BaseModel

The btrack hypothesis model.

This is a class to deal with hypothesis generation in the optimization step of the tracking algorithm.

Parameters:
namestr

A name identifier for the model.

hypotheseslist[str]

A list of hypotheses to be generated. See optimise.hypothesis.H_TYPES.

lambda_timefloat

A scaling factor for the influence of time when determining initialization or termination hypotheses. See notes.

lambda_distfloat

A a scaling factor for the influence of distance at the border when determining initialization or termination hypotheses. See notes.

lambda_linkfloat

A scaling factor for the influence of track-to-track distance on linking probability. See notes.

lambda_branchfloat

A scaling factor for the influence of cell state and position on division (mitosis/branching) probability. See notes.

etafloat

Default value for a low probability event (e.g. 1E-10) to prevent divide-by-zero.

theta_distfloat

A threshold distance from the edge of the FOV to add an initialization or termination hypothesis.

theta_timefloat

A threshold time from the beginning or end of movie to add an initialization or termination hypothesis.

dist_threshfloat

Isotropic spatial bin size for considering hypotheses. Larger bin sizes generate more hypothesese for each tracklet.

time_threshfloat

Temporal bin size for considering hypotheses. Larger bin sizes generate more hypothesese for each tracklet.

apop_threshint

Number of apoptotic detections, counted consecutively from the back of the track, to be considered a real apoptosis.

segmentation_miss_ratefloat

Miss rate for the segmentation, e.g. 1/100 segmentations incorrect gives a segmentation miss rate or 0.01.

apoptosis_ratefloat

Rate of apoptosis detections.

relaxbool

Disables the theta_dist and theta_time thresholds when creating termination and initialization hypotheses. This means that tracks can initialize or terminate anywhere (or time) in the dataset.

Notes

The lambda (\(\lambda\)) factors scale the probability according to the following function:

\[e^{(-d / \lambda)}\]

Methods Summary

as_ctype()

Return the ctypes representation of the HypothesisModel.

hypotheses_to_generate()

Return an integer representation of the hypotheses to generate.

parse_hypotheses(hypotheses)

Methods Documentation

as_ctype() PyHypothesisParams

Return the ctypes representation of the HypothesisModel.

hypotheses_to_generate() int

Return an integer representation of the hypotheses to generate.

classmethod parse_hypotheses(hypotheses)