-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsetup_add_folders.m
57 lines (49 loc) · 2.12 KB
/
setup_add_folders.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
57
% SETUP_FOLDERS
% -------------------------------------------------------------------------
% This code add folders to Matlab environment
% -------------------------------------------------------------------------
% get current root position
my_root_position = pwd;
% An ignored folder, namely configuration, will be created for you so you
% just have to edit configuration scripts there without having to commit
% every single change you made
if exist('configuration', 'file')==0
% Create folder
mkdir('configuration');
end
config_filenames = dir(fullfile('default-configuration', '*.m'));
config_filenames = { config_filenames.name };
for i = 1 : length(config_filenames)
if exist(fullfile('configuration', config_filenames{i}), 'file')==0
% Copy the default configuration file
copyfile(fullfile('default-configuration', config_filenames{i}), fullfile('configuration', config_filenames{i}));
end
end
% Install external libraries
if exist('external', 'file')==0
mkdir('external');
end
% Skeletonization library
skeletonization_library = fullfile('external', 'skeletonization');
if exist(skeletonization_library, 'file') == 0
% Download the library
websave('Skeleton.zip', 'http://www.cs.smith.edu/~nhowe/research/code/Skeleton.zip');
% unzip the code
mkdir(skeletonization_library);
unzip('Skeleton.zip', fullfile('external', 'skeletonization'));
delete('Skeleton.zip')
end
% add main folders to path
addpath(genpath(fullfile(my_root_position, 'data-organization'))) ;
addpath(genpath(fullfile(my_root_position, 'fundus-util'))) ;
addpath(genpath(fullfile(my_root_position, 'configuration'))) ;
addpath(genpath(fullfile(my_root_position, 'core'))) ;
addpath(genpath(fullfile(my_root_position, 'experiments'))) ;
% add each external folder carefully
addpath(genpath(fullfile(my_root_position, 'external', 'hemodynamics-solver'))) ;
addpath(genpath(fullfile(my_root_position, 'external', 'skeletonization'))) ;
addpath('external')
% compile the markSchmidt code
markSchmidt_code_path = fullfile('external', 'markSchmidt');
addpath(markSchmidt_code_path);
addpath(genpath(markSchmidt_code_path));