-
Notifications
You must be signed in to change notification settings - Fork 0
/
al_setup.m
42 lines (31 loc) · 875 Bytes
/
al_setup.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
function DIR_ROOT = al_setup()
%%
% Sets up workspace for action labeling tool.
% - adds directories to path.
%
% AUTHOR : Joseph Robinson
% DATE : January-2018
% Revision : 1.0
% DEVELOPED : 2017b
% FILENAME : al_setup.m
%
dirnames = {'demo','views', 'include', 'utils'};
fpath = which ('al_setup');
if isempty(fpath)
fprintf(2,'ERROR: Could not determine ROOT_DIR of project');
return;
end
if ispc, tmp = strfind(fpath,'\'); else tmp = strfind(fpath,'/');
end
warning('OFF', 'MATLAB:dispatcher:nameConflict')
cur_root = pwd;
DIR_ROOT = fpath(1:tmp(end));
addpath(DIR_ROOT);
cd (DIR_ROOT);
for indx = 1:length(dirnames)
addpath(genpath(strcat(DIR_ROOT,dirnames{indx})));
end
cd (cur_root);
fprintf(1,'\nAction_Viewer: Done configuring workspace!\n');
if nargout == 0, DIR_ROOT = ''; end
end