Stytra¶
an open-source, integrated system for stimulation, tracking and closed-loop behavioral experiments¶
We present Stytra, a flexible, open-source software package, written in Python and designed to cover all the general requirements involved in larval zebrafish behavioral experiments. It provides timed stimulus presentation, interfacing with external devices and simultaneous real-time tracking of behavioral parameters such as position, orientation, tail and eye motion in both freely-swimming and head-restrained preparations. Stytra logs all recorded quantities, metadata, and code version in standardized formats to allow full provenance tracking, from data acquisition through analysis to publication. The package is modular and expandable for different experimental protocols and setups. Current releases can be found at https://github.com/portugueslab/stytra. We also provide complete documentation with examples for extending the package to new stimuli and hardware, as well as a schema and parts list for behavioral setups. We showcase Stytra by reproducing previously published behavioral protocols in both head-restrained and freely-swimming larvae. We also demonstrate the use of the software in the context of a calcium imaging experiment, where it interfaces with other acquisition devices. Our aims are to enable more laboratories to easily implement behavioral experiments, as well as to provide a platform for sharing stimulus protocols that permits easy reproduction of experiments and straightforward validation. Finally, we demonstrate how Stytra can serve as a platform to design behavioral experiments involving tracking or visual stimulation with other animals and provide an example integration with the DeepLabCut neural network-based tracking method.
If you are using Stytra for your own research, please cite us!
If you encounter any issues, please report them here.
Overview
User guide
- Installation
- Designing and running experiments
- User interface
- Tracking configuration
- Calibration
- Configuring a computer for Stytra experiments
- Coordinate systems in Stytra
- Offline use of Stytra
- Frequently Asked Questions
- What is Stytra good for?
- What is Stytra not good for?
- I need to start a new experiment in the lab. Can I use Stytra?
- I don’t know Python, can I use Stytra?
- I know only a bit of Python, can I use Stytra?
- I need to setup Stytra to run experiments on my computer. What should I do?
- I need to design a new stimulus. What should I do?
- What are all these Param(n.) things? Do I have to care?
- I need to use a custom tracking function. What should I do?
- I have run a Stytra experiment. And now what? What’s in the log files?
- Can I run two setups from the same computer?
- I have used the freely swimming fish tracking. What are the units of my output?