Tracklet

class btrack.btypes.Tracklet(ID: int, data: list[PyTrackObject], *, parent: int | None = None, children: list[int] | None = None, fate: Fates = Fates.UNDEFINED)

Bases: object

A btrack Tracklet object used to store track information.

Parameters:
IDint

A unique integer identifier for the tracklet.

datalist[PyTrackObject]

The objects linked together to form the track.

parentint

The identifiers of the parent track(s).

childrenlist

The identifiers of the child tracks.

fateconstants.Fates, default = constants.Fates.UNDEFINED

An enumerated type describing the fate of the track.

Notes

Tracklet object for storing and updating linked lists of track objects. Forms the data structure for an individual tracklet. Track β€˜fates’ are the selected hypotheses after optimization. Defined in constants.Fates. Intrinsic properties can be accesses as attributes, e.g: track.x returns the track x values.

Attributes:
xlist[float]

The list of x positions.

ylist[float]

The list of y positions.

zlist[float]

The list of z positions.

tlist[float]

The list of timestamps.

dummylist[bool]

A list specifying which objects are dummy objects inserted by the tracker.

parentint, list

The identifiers of the parent track(s).

generationint

If specified, the generational depth of the tracklet releative to the root.

refslist[int]

Returns a list of btrack.btypes.PyTrackObject identifiers used to build the track. Useful for indexing back into the original data, e.g. table of localizations or h5 file.

labellist[str]

Return the label of each object in the track.

statelist[int]

Return the numerical label of each object in the track.

softmaxlist[float]

If defined, return the softmax score for the label of each object in the track.

propertiesdict[str, npt.NDArray]

Return the properties of the objects.

rootint,

The identifier of the root ID if a branching tree (ie cell division).

is_rootboole

Flag to denote root track.

is_leafbool

Flag to denote leaf track.

startint, float

First time stamp of track.

stopint, float

Last time stamp of track.

kalmannpt.NDArray

Return the complete output of the kalman filter for this track. Note, that this may not have been returned while from the tracker. See btrack.BayesianTracker.return_kalman for more details.

LBEPlist

Return an LBEP table summarising the track.

Attributes Summary

dummy

is_leaf

is_root

kalman

label

properties

Return the properties of the objects.

refs

softmax

start

state

stop

t

x

y

z

Methods Summary

LBEP()

Return an LBEP table summarising the track.

covar(index)

Return the Kalman filter covariance matrix.

in_frame(frame)

Return true or false as to whether the track is in the frame.

mu(index)

Return the Kalman filter mu.

predicted(index)

Return the motion model prediction for the given timestep.

to_array([properties])

Return a representation of the trackled as a numpy array.

to_dict([properties])

Return a dictionary of the tracklet which can be used for JSON export.

trim(frame[,Β tail])

Trim the tracklet and return one with the trimmed data.

Attributes Documentation

dummy
is_leaf
is_root
kalman
label
properties

Return the properties of the objects.

refs
softmax
start
state
stop
t
x
y
z

Methods Documentation

LBEP() tuple[int, list, list, int | None, None, int]

Return an LBEP table summarising the track.

covar(index: int) ndarray[Any, dtype[_ScalarType_co]]

Return the Kalman filter covariance matrix. Note that we are only returning the covariance matrix for the positions (e.g. 3x3).

in_frame(frame: int) bool

Return true or false as to whether the track is in the frame.

mu(index: int) ndarray[Any, dtype[_ScalarType_co]]

Return the Kalman filter mu. Note that we are only returning the mu for the positions (e.g. 3x1).

predicted(index: int) ndarray[Any, dtype[_ScalarType_co]]

Return the motion model prediction for the given timestep.

to_array(properties: list = ['ID', 't', 'x', 'y', 'z', 'parent', 'root', 'state', 'generation', 'dummy']) ndarray[Any, dtype[_ScalarType_co]]

Return a representation of the trackled as a numpy array.

to_dict(properties: list = ['ID', 't', 'x', 'y', 'z', 'parent', 'root', 'state', 'generation', 'dummy']) dict[str, Any]

Return a dictionary of the tracklet which can be used for JSON export. This is an ordered dictionary for nicer JSON output.

trim(frame: int, tail: int = 75) Tracklet

Trim the tracklet and return one with the trimmed data.