Data analysis#

While’s job ends when the trajectory files are validated. There are some extra tools (not part of but compatible with, Trajectorytools and Fish Midline.


A Python package that performs basic trajectory analysis and it is available at fjhheras/trajectorytools.

You can find some analysis routines from [1] implemented with trajectorytools in polavieja_lab/idtrackerai_notebooks. Here we present some of the analysis we get using a 10 juvenile fish video:

Plot of the trajectories of zebrafish tracked with Neighbors density plot of zebrafish tracked with

Smoothed trajectories (left) and density of neighbors around a focal fish (right)


Velocities and accelerations#


Polar distributions of positions, turnings and accelerations#


Inter-individual distance histograms compared with shuffled trajectories#

Fish Midline#

A short Python script available at polavieja_lab/midline to extract posture information of animals tracked with Intended to be used with fish data but easily customizable and adaptable.

Example of posture information extracted with Fish Midline.#