Behavior Collect
Program Overview
Behavior analysis allows a researcher to input X/Y position data and behavioral codes ("p" for "play", "l" for "look", etc.) from digitized video in the AVI format. Both X/Y data and behavioral codes can be collected at the same time. You may allow the video to run at the recorded frame rate (perhaps describing a behavior when it is seen), or one can step through the video frame-by-frame or step the video automatically at the desired rate (say, only every second's worth). Stepping through frames can be done automatically or with a button push.
Several files are output from the system; some of which may not be useful depending on how your data are collected:
*.PTH files are used by the Path Analysis program which is also on this web site (here).
The *.TRK files are fractal input files for Vilis O. Nams' Fractal program (his site is here)
*.XY files contain all the data generated by the program.
*.behave files contain only the behaviors. These files can be processed by TimeLine which constructs transition matrices along with summary data. It is also available on this site. Download it here.
Each of the files is written in tab-delimitated format for easy input into a spreadsheet.

Standard file navigation (disk, folder, file name). This program only reads AVI files. There is no mechanism for direct streaming video.
Area A is the data matrix. Sample number, the time in seconds, X and Y position, and behavior codes are displayed here. Depending on your collection technique not all areas may be used.
Button B is used to turn on the keyboard. Any key pressed will be recorded with it's time code when this is activated. Any printable character can be recorded. When recording the behavior of two animals, for example, "P" could represent a behavior for animal 1 while "p" could refer to animal 2. The keypress is echoed in the box to the left of the keyboard activation button.
The radio buttons in area C allow you to turn on or off the auto video step function. If auto step for a mouse click is enabled, then the video will skip ahead the number of frames depicted in text box E. In this case, video is recorded at nearly 30 frames per second, so this example will allow you to record data at one second intervals. You would set the top button if you are mainly interested in recording X/Y position data (you can still collect behavioral data along with X/Y by turning on the keyboard). Use the no auto step option if you want to stream the video or want to manually step (button D will force a manual step; even if auto step is enabled).
Next to E there is a checkbox for auto tracking a the behavior of an animal in a maze. If this is selected the behavioral column will automatically record up/down/left/right movements (as well as left-up; etc). These could be used in a Markovian analysis. The auto track threshold is used to set the amount of "slop" allowed in your input. Higher numbers allow more mouse latitude when setting a point on the screen. For example, you probably don't want to be so careful that a change in one pixel along the up/down axis would be identified as "up" (though you could; just set this at zero).
The Set Distance button (G) allows you to calibrate your X/Y data for actual distances. If you have a known distance on the screen (via a ruler), press this button and you'll be prompted to point to one end of the measure, then another. The formula for converting pixels to real distance is then shown. Record that so you can make the conversion in a spreadsheet. If your camera distance remains fixed, you only need to do this once.
The program will remember your favorite settings and the last directory when you save a data file and exit.

The above figure shows a typical recording sequence to collected behaviors (use the keyboard to generate a sequence of behavioral codes). Note that the X/Y columns are simply zeros. The time column is not exactly one per second since video is actually recorded at just under 30 frames per second.

When you're finished collecting data press the Save Data button to generate the various data files (see top). If the data file has already been written you will be prompted to change the name. If you want to write over a previous file just press the save button. The file names are generated from the original AVI file source.

In this experiment X/Y position data is collected along with some behaviors. Note the Auto Track Maze check box has been turned off (though you could leave it on if you want. NOTE: when Auto Step on Mouse Click is enabled, the behavior is recorded at the same time as the mouse click that generated an autostep (see samples 6 and 7. Both were recorded at 34 seconds).

If you try to exit the program without saving the program will remind you. Press the Save Data button and then exit.

This shows the format for the various files. The PTH file would normally contain X/Y data other than 0/0 and should look more like the TRK file (oops, my fault when puttinh together this tutorial. The TRK file is used for a fractal path analysis. The PTH file is used by the Path Analysis program. The XY file has all the data. The behav file contains simply the behaviors. When these points were collected the maze tracking function was checked. The animal moved right and up three times, right and down twice then left and down twice. Use this for a Markovian chain analysis.