ffmpeg for reading frames (used by VideoReaderFFMPEG):
- OSX:
brew install ffmpeg - WIN: download binaries from here
VideoReaderFFMPEGlook for theffmpegbinary in/usr/local/bin(OSX) orC:\Program Files\ffmpeg\bin(WIN). Seehelp VideoReaderFFMPEGfor how to set a custom path to the binary.
GhostScript for saving figures. Download binaries from the official website. Add directory with the ghostscript binary (gs or gs.exe) to your system path.
Download the code git clone https://github.com/murthylab/FLyTRAP.git, cd into the newly created directory FLyTRAP and add the src subdirectory to your matlab path: addpath(genpath('src')); savepath().
Raw data should be copied to /scratch/murthyplayback/dat/. After the recordings have been processed copy to /bucket/murthy/playback/dat.processed/ regularly to free up space on scratch (and to make sure everything is backed up safely).
Tracking results are saved to /bucket/murthy/playback/res/ on bucket one VIDEOFILENAME_spd.mat file per recording.
Metadata for generating tuning curves reside in a spreadsheet on google docs:
- The sheet
listdescribes each recorded video: filename, genotype and age, playlist, housing condition. - The sheet
playbackListsdescribes playlists\tuning curves: playlist name (inlist), x-axis and x-tick labels, etc. - The sheets are pulled from google docs automatically by
tuning.m.
Copy folder for each recording to /scratch/murthyplayback and run on a local machine:
cd /scratch/murthyplayback
video_preProcessLocalThis will run through all videos that have not been pre-processed in dat/ so you can mark the fly positions. The script will present you with the first frame of each video and uses roipoly for annotating the flies: 1) click on all flies you want tracked, 2) when done right click to close the polygon (even if there's just a single fly), and 3) double click inside the polygon to move on to the next video.
To track the videos run on spock:
cd /scratch/murthyplayback
module load matlab/R2016b
matlab -r 'video_submit([1 1 1]);exit'This will submit three types of jobs that will process the video in serial order:
- Preprocessing: detects chambers and initializes tracker
- Tracking: tracks files and creates one
*res.matfile per chamber - Postprocessing: aggregrates the data in the
*res.matfor each experiment and copies the results to/bucket/murthy/playback/res/*_spd.mat
See help video_submit for arguments.
See tuning.m.