forked from Herschel-Phoon/BUQO
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.m
86 lines (73 loc) · 3.37 KB
/
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
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
74
75
76
77
78
79
80
81
82
83
84
85
86
function setup(irtdir)
% setup.m
% run this file to set up matlab path etc.
% you may need to modify this depending on how you installed the toolbox
% so this should be considered simply a "guide" not a robust script.
if ~exist('irtdir', 'var')
disp('The variable "irtdir" is not set, so trying default, assuming')
disp('that you launched matlab from the irt install directory.')
disp('You may need to edit setup.m or adjust your path otherwise.')
% irtdir = pwd; % the default is to assume launch from irt directory
% default is to look for directory where this setup.m is installed!
irtdir = which('setup'); % find setup.m
[irtdir dummy] = fileparts(irtdir);
clear dummy
disp(['Assuming you installed irt in directory "' irtdir '".'])
% irtdir = '~fessler/l/src/matlab/alg/'; % where you install this package
% irtdir = '~fessler/l/web/irt/'; % where you install this package
end
if ~exist(irtdir, 'dir')
disp(sprintf('The directory "%s" does not exist', irtdir))
error(sprintf('you need to edit %s to change default path', mfilename))
end
if irtdir(end) ~= filesep % make sure there is a '/' at end of directory
irtdir = [irtdir filesep];
end
addpath([irtdir 'align']); % image registration
addpath([irtdir 'align/mex']); % image registration mex files
addpath([irtdir 'blob']); % blob (KB) basis
addpath([irtdir 'ct']); % x-ray CT (polyenergetic) recon
addpath([irtdir 'data']); % example data
addpath([irtdir 'emission']); % emission image reconstruction
addpath([irtdir 'example']); % example applications
addpath([irtdir 'fbp']); % FBP (filtered backprojection) code
addpath([irtdir 'general']); % generic image reconstruction
addpath([irtdir 'graph']); % graphics routines
addpath([irtdir 'mri']); % MRI reconstruction
addpath([irtdir 'mri-rf/yip-spsp']); % MRI RF pulse design
%addpath([irtdir 'mri/recon']); % MRI reconstruction - old
addpath([irtdir 'nufft']); % nonuniform FFT (for a fast projector)
addpath([irtdir 'nufft/table']); % mex files for NUFFT
addpath([irtdir 'penalty']); % regularizing penalty functions
addpath([irtdir 'systems']); % system "matrices"
addpath([irtdir 'systems/tests']); % tests of systems
addpath([irtdir 'transmission']); % transmission image reconstruction
addpath([irtdir 'utilities']); % various utility functions
addpath([irtdir 'wls']); % weighted least-squares (WLS) estimates
tmp = [irtdir 'um']; % extra files for um users only
if exist(tmp, 'dir'), addpath(tmp), end
tmp = [irtdir 'um/lustig-poisson-disk'];
if exist(tmp, 'dir'), addpath(tmp), end
if ir_is_octave
addpath([irtdir 'octave']); % extra stuff for octave only!
elseif isempty(which('dbstack')) % for freemat only!
addpath([irtdir 'freemat']); % extra stuff for freemat only!
end
% Set up path to mex files, possibly depending on matlab version.
% Fortunately it seems that the v6 ones will run on v7 too.
% Unfortunately, it seems that sometimes compiling on one version
% e.g., 7.3 and running on earlier 7.0 won't work.
% if you have this problem, then comment out the mex path line(s) below.
% Much of the toolbox will work without mex, just slower.
%if str2num(version('-release')) <= 13
% addpath([irtdir 'mex/v6'])
%else
addpath([irtdir 'mex/v7']);
%end
% check to see if path setup worked by looking for im() routine.
if strcmp([irtdir 'graph' filesep 'im.m'], which('im'))
disp('Path setup for irt appears to have succeeded.')
else
disp('Path setup for irt may have failed.')
end
end