Open Field Statistics is a GUI application for analyzing animal's locomotor activity in an open field box, tracked by IR-beams crossing. It receives raw data from beams in a .csv file, visualizes animal's trajectory and calculates some behavioral statistics in user-defined zones and time periods. The output statistics can then be saved in a new spreadsheet.
This application was developed to process the output of a commercial third-party system and software with closed source code. The external program operates the hardware, receives signals from the IR-beams and produces the .csv file with the raw data. However, it fails to perform a comprehensive and scientifically relevant analysis of the data, motivating development of the current application.
Although this application is originally narrow-purposed, reflecting constraints of the third-party software, it can easily be repurposed for a wider range of custom photobeam setups, provided that they produce represent data in a compatible format.
This implementation is clearly an overkill for the task, but it served me as practice in full-stack development and deployment of GUI applications.
The third-party apparatus is a 40x40x30 cm box with two 16x16 photobeam frames. The lower frame tracks animal's horizontal activity (X and Y coordinates), and the upper frame detects the vertical activity (rearings).
The raw data produced by external software operating the system itself (and the input data for the current application) is a ;-separated .csv file with six columns:
- timestamp with update rate of ~12 Hz
- X1 and X2 - leftmost and rightmost intersected beams by the X axis
- Y1 and Y2 - downmost and uppermost intersected beams by the Y axis
- Z with
True
/False
values, reflecting breaks of any of the upper beams
Note that since only the extreme coordinates are shown in the table, the program cannot differentiate between two objects simultaneously breaking photobeams.
User can select a time range of the experiment to analyze (slider in the bottom-left corner). It can be useful, for example, to exclude a habituation period from the beginning of the record. The table and the output file will show both Total time and Selected time statistics.
The Selected time can be further divided into periods of user-defined length in seconds. For each of the periods separate statistics will be shown.
The statistics is calculated for the Whole field and for user-defined zones. Seven types of zone selection can be chosen with buttons to the left of the map:
Three options divide the whole field into two predefined zones.
One central and one peripheral zone. This field division is often used in behavioral science to assess anxiety and stress in animals.
Four options allow user to set their own zones. The maximal number of custom zones is 4. After completing selection of a new zone user has to press Add zone
button. Only one type of custom zone can be used at once (I am planning to change it in the future).
One cell at a time. Allows the most flexible zone definition
For each zone/period the following five behavioral statistics are calculated:
- Time (s) spent in this zone (for the Whole field - the length of this period)
- Distance (cm)
- Velocity (cm/s)
- Rearings number
- Rearings time (s)
Output is a .csv file. By default user is prompted to save it to the save folder as the input in the format 'Input_file_name_statistics.csv', but both location and name can be changed.
- Add option to choose field configuration and number of beams
- Make zone selection more flexible: allow different zone types simultaneously, support custom zone elements of different sizes, add drag-select
- Add number of zone entering statistics
- Save parameters
- Add animation of the recording with different speed
This software was developed as part of my research work in the Laboratory of Neurobiology and Molecular Pharmacology of the Institute of Translational Biomedicine of St Petersburg University, under the scientific supervision of Dr. Anna B. Volnova