Skip to content

Easy behavioral tracer for recorded videos of rodents/...

Notifications You must be signed in to change notification settings

horsto/Behavioral-Tracer

Repository files navigation

Behavioral tracer

Transferred my video tracing code from Matlab to Python. Uses OpenCV to accelerate processing.

Mouse tracer

Latest version: mouse_tracker3_multiple.py

This script processes one or multiple videos (.mov,...). Output: .csv file with tracing information and .png screenshot of the trace in the same folder as input video. See /example folder for test movie and output.

Example usage:

mouse_tracker3_multiple.py -s 10 -v 'example/olf5_1.mov'
  • -s: How many frames should be skipped
  • -v: Video file to be processed; comma separated list possible

Dependencies:

  • OpenCV 3.0
  • Numpy
  • Scipy
  • imutils
  • TQDM

'Screen shot'

Post Process Trace

Latest version: 2D_histogram_multiple_3D.py

This script processes the output .csv files of the tracing script (see above). Output: all_paths_[...].csv: Names and calculated distances (as example) of analyzed traces. [...].csv_3D.png: 3D representation of mouse path (path over time in seconds). group average.png: Group average of all analyzed .csv traces.

Example usage:

2D_histogram_multiple_3D.py -f "example"
  • -f: Give (top) folder of .csv files. Will search through folder tree for all available .csv files.

Dependencies:

  • Numpy
  • Scipy
  • imutils
  • Matplotlib

Example 3D trace: '3D trace representation'

About

Easy behavioral tracer for recorded videos of rodents/...

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages