BRAIN documentation

= SUE ANN, ROI SEGMENTATION =
== Requirements: ==
* MATLAB 2015b or higher
* Git for Windows
* TortoiseGit
* From MathWorks File Exchange:
** GUI Layout Toolbox
* From BitBucket (Koay)
** CalciumImaging
** SAKFunctions
** TankMouseVR
* From GitHub (Koay)
** openCV-ecs
** princeton-ecs
* From Bucket/BrainInit
** MatlabFE
== To install: ==
(after the current pass, sam will make sure this is complete)
* add all requirements to matlab path
* follow install instructions on github for openCV-ecs
** need to compile things in princeton-ecs-master
** for this you need to make sure you have the opencv libraries
** may need to update matlab's libtiff, or else tell it to load using your system's version (actually, this might be addressed by the code below setting the environment variables)
* run the following from sue ann's startup.m, where 'your_path' are the parts that probably have to be set on a user-by-user basis:
 
setenv('OPENCV_DIR' , 'your_path/opencv-ecs-master/x64/vc14/');
setenv('LIBTIFF_DIR', '/usr/local/opt/libtiff');
setenv('ECS_DIR' , 'your_path/princeton-ecs-master/');
setenv('PATH', [ getenv('PATH') ...
 , pathsep, fullfile(getenv('OPENCV_DIR'), 'bin') ...
 , pathsep, fullfile(getenv('LIBTIFF_DIR')) ...
 ]);
addpath(genpath(getenv('ECS_DIR')));
rmpath(genpath(fullfile(getenv('ECS_DIR'), '.git')));
== Usage: ==
* example imagingPath:
\\bucket.pni.princeton.edu\Bezos-center\RigData\scope\bay3\sakoay\PoissonBlocksGP53Ai93_2\imaging
* example behaviorFile
\\bucket.pni.princeton.edu\braininit\RigData\scope\bay3\sakoay\PoissonBlocksGP53Ai93_2\PoissonBlocks_GP53Ai93cohort2_Bezos3.mat
* usage
tp = TrialPlayer(behaviorFile, imagingPath); tp.gui()
* Note: over-loaded functions:
** mergeStruct
** makePositionedFigure
= SUE ANN, DATA FORMAT =
== Downloading the data ==
# path to imaging data on jukebox: /jukebox/tank/sakoay/RigData/scope/bay3/PoissonBlocksGP53_1/imaging/
# then there are folders k## which presumably (?) correspond to data from different animals; as of 06/27/16, there are folders k31, k36, and k37
# within k31 (say), are folders corresponding to dates
# within each date folder, there are many files:
= LUCAS, DATA FORMAT =
== WIDE FIELD IMAGING ==
/Volumes/braininit/RigData/VRwidefield/widefield/ai3/20160815/dff.mat
- dff.mat - delta f over f - info.mat - info about recording, including frameRate
== logSumm.mat = log summary, all behavioral information ==
* most are 1xN where N = number of trial
* trial type
** 0 = left
** 1 = right
* same for choice
* currMaze: list of maze ID's from following list
** 4 = visually guided
** 9 = cues on only one side
** 13, 14 = full task (w / distractors), 14 harder than 13
=== for syncing: ===
* camFrameNum = 1xnTrial cell array: indices into
=== ===
* logSumm.binned
* logSumm.keyFrameLabels = which phase of the task is the animal in
==== vermin variables ====
* time: relative time in the trial (units = seconds)
* pos: (x,y,z) = (x pos, y pos, view angle in degrees, (< 0 = right, > 0 = left)) (position in centimeters, view angle in degrees)
* displ = diff(pos)
== OPTO: ==
* logSumm.info
** logSumm.info.grid = (Nx2) vector (units = mm)
** bregma = (0,0)
** coordinate 1 is ML
** 2 is AP
** sometimes, grid is cell array.
* logSumm.galvoPosIdx
** 0 = laser is off
** otherwise, index into logSumm.info.grid
** laserON: was laser on
** power : usually use the same power
* logSumm.info.laserParams
** locationSet
** epoch
*** 'whole' = whole trial
*** 'cueHalf1' - first half of cue period as measured by space
*** 'cueHalf2' - second half of cue period as measured by space
*** 'mem' - memory period
*** 'memHalf1' - memory period
* metaLogLsr
** masterLocIdx
** getLocation bLabel([x y])
== MORE INFO ==
* Detailed maze info: PoissonBlocksReboot3m.m (most data) or PoissonBlocksCondensed3m (occasional imaging, mazes are largely equivalent but there are fewer shaping steps on this one. Maze 11 in condensed is the same as maze 14 in Reboot). VirMen maze is in poisson_blocks_reboot_3m.mat. All of these are in the VirMEn repository that Sue Ann has, I believe you told me at some point that you had access to that
All the other code below is in the repository I’m about to share with you:
* Code used to generate log files: summarizeVirmenLog_widefield.m + extractFrameTimeByTrials.m, summarizeLsrExpt.m
* Code used to generate and filter files from metalog: mkLsrMetaLog.m, filterLogFiles.m
* Pinning to master location and getting area labels: getMasterLocationIdx.m, getLocationLabel.m 
* Inactivation grids (coordinate sets): attached zip folder (grid)