-
Notifications
You must be signed in to change notification settings - Fork 0
/
movieGazeTOMEAnalysisLocalHook.m
56 lines (45 loc) · 1.75 KB
/
movieGazeTOMEAnalysisLocalHook.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
function movieGazeTOMEAnalysisLocalHook
%
% For use with the ToolboxToolbox. Copy this into your
% ToolboxToolbox localToolboxHooks directory (by defalut,
% ~/localToolboxHooks) and delete "Template" from the filename
%
% The thing that this does is add subfolders of the project to the path as
% well as define Matlab preferences that specify input and output
% directories.
%
% You will need to edit the project location and i/o directory locations
% to match what is true on your computer.
%% Define project
projectName = 'movieGazeTOMEAnalysis';
%% Clear out old preferences
if (ispref(projectName))
rmpref(projectName);
end
% Obtain the Dropbox path
[~,hostname] = system('hostname');
hostname = strtrim(lower(hostname));
% handle hosts with custom dropbox locations
switch hostname
case 'seele.psych.upenn.edu'
dropboxBaseDir = '/Volumes/seeleExternalDrive/Dropbox (Aguirre-Brainard Lab)';
case 'magi-1-melchior.psych.upenn.edu'
dropboxBaseDir = '/Volumes/melchiorBayTwo/Dropbox (Aguirre-Brainard Lab)';
case 'magi-2-balthasar.psych.upenn.edu'
dropboxBaseDir = '/Volumes/balthasarExternalDrive/Dropbox (Aguirre-Brainard Lab)';
otherwise
[~, userName] = system('whoami');
userName = strtrim(userName);
dropboxBaseDir = ...
fullfile('/Users', userName, ...
'Dropbox (Aguirre-Brainard Lab)');
end
%% Set preferences for project output
setpref(projectName,'dropboxBaseDir',dropboxBaseDir); % main directory path
%% Set preferences
% Find the project directory, add it to the path, save this as a
% pref, and then make this the current directory
projectDir = fullfile(tbLocateProject(projectName));
addpath(genpath(projectDir));
setpref(projectName, 'projectDir', projectDir);
end