Probabilistic state annotation - vanTeeffelenLab/ExTrack GitHub Wiki

The following function allows to compute state probabilities for each track at every time points given the parameters of the model.

Function extrack.tracking.predict_Bs

pred_Bs = extrack.tracking.predict_Bs(all_tracks,
                                      dt,
                                      params,
                                      cell_dims=[1],
                                      nb_states=2,
                                      frame_len=8,
                                      workers = 1,
                                      input_LocErr = None)

Arguments:

  • all_tracks: dictionary describing the tracks with track length as keys (number of time positions, e.g. '23') of 3D arrays: dim 0 = track, dim 1 = time position, dim 2 = x, y position. This means 15 tracks of 7 time points in 2D will correspond to an array of shape [15,7,2].
  • params: lmfit parameters used for the model.
  • dt: time in between frames.
  • cell_dims: dimension limits (um). estimated_vals, min_values, max_values should be changed accordingly to describe all states and transitions.
  • nb_states: number of states. estimated_vals, min_values, max_values should be changed accordingly to describe all states and transitions.
  • frame_len: number of frames for which the probability is perfectly computed. See method of the paper for more details.

Outputs:

  • pred_Bs: dictionary describing the state probability of each track for each time position with track length as keys (number of time positions, e.g. '23') of 3D arrays: dim 0 = track, dim 1 = time position, dim 2 = state.