forked from qMRLab/qMRLab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstartup.m
61 lines (56 loc) · 2.45 KB
/
startup.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
58
59
60
61
if ~isdeployed
addpath(genpath(fileparts(mfilename('fullpath'))))
% Remove temp temp dir from path if it exists
tmpDir = fullfile(pwd, 'tmp');
if exist(tmpDir, 'dir')
rmpath(genpath(tmpDir))
end
if ~moxunit_util_platform_is_octave % MATLAB
% Test Optimization toolbox is installed
if ~license('test', 'Optimization_Toolbox'), error('Optimization Toolbox is not installed on your system: most qMR models won''t fit. Please consider installing <a href="matlab:matlab.internal.language.introspective.showAddon(''OP'');">Optimization Toolbox</a> if you want to use qMRLab in MATLAB.'); end
if ~license('test', 'Image_Toolbox'), warning('Image Toolbox is not installed: ROI Analysis tool not available in the GUI. Consider installing <a href="matlab:matlab.internal.language.introspective.showAddon(''IP'');">Image Processing Toolbox</a>'); end
else % OCTAVE
% install octave package
installlist = {'struct','io','statistics','optim','image'};
for ii=1:length(installlist)
try
disp(['loading ' installlist{ii}])
pkg('load',installlist{ii})
catch
errorcount = 1;
while errorcount % try to install 30 times (Travis)
try
pkg('install','-forge',installlist{ii})
pkg('load',installlist{ii})
errorcount = 0;
catch err
errorcount = errorcount+1;
if errorcount>30
error(err.message)
end
end
end
end
end
try
NODDI_erfi(.8);
catch
% Compile Faddeeva
cur = pwd;
cd(fullfile(fileparts(mfilename('fullpath')),'External','Faddeeva_MATLAB'))
try
disp('Compile Faddeeva...')
Faddeeva_build
disp(' ...ok')
cd(cur)
catch
cd(cur)
if moxunit_util_platform_is_octave
error('Cannot compile External/Faddeeva_MATLAB.m, a function used by NODDI (in NODDI_erfi.m). Plz install a compiler (https://fr.mathworks.com/support/compilers.html) and run startup.m again.')
else
warning('NODDI IS SLOW: Cannot compile External/Faddeeva_MATLAB.m, a fast function used by NODDI (in NODDI_erfi.m). Plz install a compiler (https://fr.mathworks.com/support/compilers.html) and run startup.m again.')
end
end
end
end
end