-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmslice_init.m
73 lines (57 loc) · 2.4 KB
/
mslice_init.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
62
63
64
65
66
67
68
69
70
71
72
73
function mslice_init
% Adds the paths needed by mslice.
%
% In your startup.m, add the mslice root path and call mslice_init, e.g.
% addpath('c:\mprogs\mslice')
% mslice_init
%
% Is PC and Unix compatible.
% T.G.Perring
%
% $Revision: 348 $ ($Date: 2020-06-02 19:39:46 +0100 (Tue, 02 Jun 2020) $)
%
% root directory is assumed to be that in which this function resides
rootpath = fileparts(which('mslice_init'));
addpath(rootpath) % MUST have rootpath so that mslice_init, mslice_off included
addpath(fullfile(rootpath,'admin'));
% Other directories
addpath_message(fullfile(rootpath,'core'));
addpath_message (rootpath,'utilities');
addpath_message (rootpath,'classes');
addpath_message (rootpath,'applications');
% compatibility and interpackage dependencies directory
% temporary option used during debugging and transition to herbert io
[application,Matlab_code,mexMinVer,mexMaxVer,date] = mslice_version();
mc = [Matlab_code(1:48),'$)'];
disp('!==================================================================!')
disp('! MSLICE !')
disp('!------------------------------------------------------------------!')
disp('! Radu Coldea: 1998-2001 & ISIS addons and enhancements: 2001-2014 !')
if isempty(mexMaxVer)
disp('! Mex code: Disabled or not supported on this platform !')
else
if mexMinVer==mexMaxVer
mess=sprintf('! Mex files : $Revision::%4d $ (%s $) !',mexMaxVer,date(1:end-7));
else
mess=sprintf(...
'! Mex files : $Revisions::%4d-%3d(%s $) !',mexMinVer,mexMaxVer,date(1:end-7));
end
disp(mess)
end
disp('! Matlab code: Last ISIS substantial modifications date: 01/06/2015!')
disp('! Synchronized with recent Herbert changes: 01/05/2024!')
disp('!------------------------------------------------------------------!')
%--------------------------------------------------------------------------
function addpath_message (varargin)
% Add a path from the component directory names, printing a message if the
% directory does not exist.
% e.g.
% >> addpath_message('c:\mprogs\mslice','bindings','matlab','classes')
% T.G.Perring
string=fullfile(varargin{:});
if exist(string,'dir')==7
path=genpath_special(string);
addpath (path);
else
warning('"%s" is not a directory - not added to path',string)
end