forked from votchallenge/toolkit-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtoolkit_path.m
27 lines (21 loc) · 845 Bytes
/
toolkit_path.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
function paths = toolkit_path()
% toolkit_path Appends all toolkit directories to the Matlab path
%
% If no output argument is given, the function appends all toolkit directories
% to the Matlab/Octave path, otherwise it returns a list as a cell array.
%
% Output:
% - paths (cell): A list of all paths.
script_directory = fileparts(mfilename('fullpath'));
include_dirs = cellfun(@(x) fullfile(script_directory, x), {'', 'utilities', ...
'workspace', 'tracker', 'sequence', 'stacks' ,'report', 'analysis', ...
'experiment', }, 'UniformOutput', false);
include_dirs {end+1} = fullfile(script_directory, 'sequence', 'conversion');
if exist(fullfile(script_directory, 'native'), 'dir')
include_dirs{end+1} = fullfile(script_directory, 'native');
end
if nargout > 0
paths = include_dirs;
else
addpath(include_dirs{:});
end;