Position refinement - vanTeeffelenLab/ExTrack GitHub Wiki

The following function allows to give the most likely position and its associated standard deviation for each track at every time point.

Function extrack.refined_localization.position_refinement

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.
LocErr: float number for localization error
ds: 1D array containing diffusion lengths for each state., Fs, TrMat, frame_len = 7
Fs: 1D array containing diffusion lengths for each state.
TrMat: 2D array transition rates. with TrMat[i,j] = transition probability from state i to j and TrMat[i,i] = 1 - sum TrMat[i,j] for all j.
frame_len: window length to be used from each side of the position to be refined.

Outputs:

all_mus: Dictionary describing most likely position with length as keys (number of time positions, e.g. '23') of 2D arrays: dim 0 = track, dim 1 = time position.
all_refined_sigmas: Dictionary describing refined localization error with length as keys (number of time positions, e.g. '23') of 2D arrays: dim 0 = track, dim 1 = time position.

NB: this function has been tested and works with 2-state models but is not available in its final implementation yet.