%########################################################################################
%Zebrabox software package


%Please send any questions, bug reports, feedback and comments to adam.hoagland@berkeley.edu to further improve this software
%########################################################################################


First add MATLAB scripts to working path and set file directories appropriately. Also, depending on which hardware you're using, some of the image processing and DAQ toolbox
functions may need to be modified.

To make masks:

1) Run makeAndSaveROI.m and change the settings to the appropriate number of wells in the multiwell plate.
2) Run showContinuousVideo.m and click "Update video." You should now be able to see a live image of the multiwell plate with an overlaid mask.
3) Change the settings in the makeAndSaveROI dialog box to adjust the mask so that it fits the multiwell plate. Click Make ROI to update the mask, then click U
"Update" on showContinuousVideo to update the live image with the new mask.

To run habituation protocol:

1) Set number of movies, trials, inter-stimulus-intervals and sound stimulus levels appropriately. 
2) Run the script.

To analyze escapes:

1) Run analyzeEscapes.m and select folders containing the movies to analyze. The output matrix should be a binary matrix with 0 counting as no escape and 1 counting as an escape. Columns are the 
well numbers and rows are trial number.