Mercurial > hg > smallbox
comparison SMALLBoxInit.m @ 189:75b5dedcfd45 luisf_dev
created initialization file; changing SMALL_learn in order to initialize plugins.
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Thu, 16 Feb 2012 18:24:43 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
187:3cc204120431 | 189:75b5dedcfd45 |
---|---|
1 function SMALLboxInit(varargin) | |
2 %% SMALLboxInit | |
3 % | |
4 % Will add all necessary files and folders to the Matlab Path | |
5 % | |
6 % SMALLbox initialisation | |
7 | |
8 % | |
9 % Centre for Digital Music, Queen Mary, University of London. | |
10 % This file copyright 2009 Ivan Damnjanovic, Matthew Davies. | |
11 % | |
12 % This program is free software; you can redistribute it and/or | |
13 % modify it under the terms of the GNU General Public License as | |
14 % published by the Free Software Foundation; either version 2 of the | |
15 % License, or (at your option) any later version. See the file | |
16 % COPYING included with this distribution for more information. | |
17 % | |
18 %% | |
19 clc; | |
20 clear; | |
21 | |
22 FS=filesep; | |
23 | |
24 SMALL_path=pwd; | |
25 SMALL_p=genpath(SMALL_path); | |
26 addpath(SMALL_p); | |
27 | |
28 | |
29 % should init "old" toolboxes | |
30 | |
31 | |
32 | |
33 | |
34 | |
35 %% | |
36 | |
37 | |
38 % if ~exist('sparcoSetup.m','file') | |
39 % fprintf('\n ******************************************************************'); | |
40 % fprintf('\n\n Initialising SPARCO and Rice Wavelet Toolbox Setup'); | |
41 % | |
42 % Sparco_path = [SMALL_path,FS,'toolboxes',FS,'SPARCO']; | |
43 % if exist([Sparco_path, FS, 'sparco-1.2.zip'],'file'), | |
44 % Sparco_zip=[Sparco_path, FS, 'sparco-1.2.zip']; | |
45 % else | |
46 % Sparco_zip='http://www.cs.ubc.ca/labs/scl/sparco/downloads.php?filename=sparco-1.2.zip'; | |
47 % fprintf('\n\n Downloading toolbox, please be patient\n\n'); | |
48 % end | |
49 % unzip(Sparco_zip,Sparco_path); | |
50 % Sparco_p=genpath(Sparco_path); | |
51 % addpath(Sparco_p); | |
52 % cd(SMALL_path) | |
53 % | |
54 % | |
55 % | |
56 % if exist('curvelab.pdf','file') | |
57 % crvroot = fileparts(which('curvelab.pdf')); | |
58 % addtopath(crvroot,'fdct_usfft_matlab'); | |
59 % addtopath(crvroot,'fdct_wrapping_matlab'); | |
60 % addtopath(crvroot,'fdct_wrapping_cpp/mex'); | |
61 % addtopath(crvroot,'fdct3d/mex'); | |
62 % else | |
63 % fprintf(['\nWarning: CurveLab is not in the path. Sparco Problems 50-51 ' ... | |
64 % 'will not work.\n\n']); | |
65 % end | |
66 % | |
67 % | |
68 % cd(SMALL_path); | |
69 % | |
70 % fprintf('SPARCO Installation Successful!\n'); | |
71 % else | |
72 % fprintf('\n ******************************************************************'); | |
73 % fprintf('\n\n SPARCO and Rice Wavelet Toolbox are already installed'); | |
74 % end | |
75 % %% | |
76 % %removing Rice Wavelet tollbox provided with SPARCO from the path, so | |
77 % %the newer version provided with SMALLbox is used | |
78 % | |
79 % rmpath([SMALL_path,FS,'toolboxes',FS,'SPARCO',FS,'sparco-1.2',FS,'tools',FS,'rwt']); | |
80 % | |
81 % if ~exist('spgsetup.m','file') | |
82 % fprintf('\n ******************************************************************'); | |
83 % fprintf('\n\n Initialising SPGL1 Setup'); | |
84 % | |
85 % try | |
86 % SPGL1_path = [SMALL_path,FS,'toolboxes',FS,'SPGL1']; | |
87 % if exist([SPGL1_path, FS, 'spgl1-1.7.zip'],'file'), | |
88 % SPGL1_zip=[SPGL1_path, FS, 'spgl1-1.7.zip']; | |
89 % else | |
90 % SPGL1_zip='http://www.cs.ubc.ca/~mpf/downloads/spgl1-1.7.zip'; | |
91 % fprintf('\n\n Downloading toolbox, please be patient\n\n'); | |
92 % end | |
93 % unzip(SPGL1_zip,SPGL1_path); | |
94 % SPGL1_p=genpath(SPGL1_path); | |
95 % addpath(SPGL1_p); | |
96 % | |
97 % | |
98 % cd([SPGL1_path,FS,'spgl1-1.7']); | |
99 % fprintf('Compiling SPGL1 MEX interfaces ...'); | |
100 % try | |
101 % spgsetup; | |
102 % fprintf('\n SPGL1 Installation Successful!\n'); | |
103 % catch | |
104 % warning('Could not compile SPGL1 MEX interfaces.'); | |
105 % end | |
106 % catch | |
107 % fprintf('\n SPGL1 Installation Failed\n'); | |
108 % end | |
109 % cd(SMALL_path); | |
110 % else | |
111 % fprintf('\n ******************************************************************'); | |
112 % fprintf('\n\n SPGL1 is already installed'); | |
113 % end | |
114 % %% | |
115 % | |
116 % if ~exist('SparsePath.m','file') | |
117 % fprintf('\n ******************************************************************'); | |
118 % fprintf('\n\n Initialising SparseLab Setup'); | |
119 % | |
120 % try | |
121 % SL_path = [pwd,FS,'toolboxes',FS,'SparseLab']; | |
122 % if exist([SL_path, FS, 'SparseLab21-Core.zip'],'file'), | |
123 % SL_zip=[SL_path, FS, 'SparseLab21-Core.zip']; | |
124 % else | |
125 % SL_zip='http://sparselab.stanford.edu/SparseLab_files/Download_files/SparseLab21-Core.zip'; | |
126 % fprintf('\n\n Downloading toolbox, please be patient\n\n'); | |
127 % end | |
128 % unzip(SL_zip,SL_path); | |
129 % SL_p=genpath(SL_path); | |
130 % addpath(SL_p); | |
131 % fprintf('\n SparseLab Installation Successful!\n'); | |
132 % catch | |
133 % fprintf('\n SparseLab Installation Failed\n'); | |
134 % cd(SMALL_path); | |
135 % end | |
136 % cd(SMALL_path); | |
137 % else | |
138 % fprintf('\n ******************************************************************'); | |
139 % fprintf('\n\n SparseLab is already installed'); | |
140 % end | |
141 % %% | |
142 % | |
143 % if ~exist('greed_pcgp.m','file') | |
144 % fprintf('\n ******************************************************************'); | |
145 % fprintf('\n\n Initialising Sparsify Setup'); | |
146 % | |
147 % try | |
148 % Sparsify_path = [pwd,FS,'toolboxes',FS,'Sparsify']; | |
149 % if exist([Sparsify_path, FS, 'sparsify_0_4.zip'],'file'), | |
150 % Sparsify_zip=[Sparsify_path, FS, 'sparsify_0_4.zip']; | |
151 % else | |
152 % Sparsify_zip='http://www.see.ed.ac.uk/~tblumens/sparsify/sparsify_0_4.zip'; | |
153 % fprintf('\n\n Downloading toolbox, please be patient\n\n'); | |
154 % end | |
155 % unzip(Sparsify_zip,Sparsify_path); | |
156 % Sparsify_p=genpath(Sparsify_path); | |
157 % addpath(Sparsify_p); | |
158 % fprintf('\n Sparsify Installation Successful\n'); | |
159 % catch | |
160 % fprintf('\n Sparsify Installation Failed\n'); | |
161 % end | |
162 % cd(SMALL_path); | |
163 % else | |
164 % fprintf('\n ******************************************************************'); | |
165 % fprintf('\n\n Sparsify is already installed'); | |
166 % end | |
167 % %% | |
168 % if ~exist('GPSR_Basic.m','file') | |
169 % fprintf('\n ******************************************************************'); | |
170 % fprintf('\n\n Initialising GPSR Setup'); | |
171 % | |
172 % try | |
173 % GPSR_path = [pwd,FS,'toolboxes',FS,'GPSR']; | |
174 % if exist([GPSR_path, FS, 'GPSR_6.0.zip'],'file'), | |
175 % GPSR_zip=[GPSR_path, FS,'GPSR_6.0.zip']; | |
176 % else | |
177 % GPSR_zip='http://www.lx.it.pt/~mtf/GPSR/GPSR_6.0.zip'; | |
178 % fprintf('\n\n Downloading toolbox, please be patient\n\n'); | |
179 % end | |
180 % unzip(GPSR_zip,GPSR_path); | |
181 % | |
182 % GPSR_p=genpath(GPSR_path); | |
183 % addpath(GPSR_p); | |
184 % fprintf('\n GPSR Installation Successful\n'); | |
185 % catch | |
186 % fprintf('\n GPSR Installation Failed'); | |
187 % end | |
188 % cd(SMALL_path); | |
189 % else | |
190 % fprintf('\n ******************************************************************'); | |
191 % fprintf('\n\n GPSR is already installed'); | |
192 % end | |
193 % %% | |
194 % if ~exist('cvx_setup.m','file') | |
195 % fprintf('\n ******************************************************************'); | |
196 % fprintf('\n\n Initialising CVX Setup'); | |
197 % | |
198 % try | |
199 % CVX_path = [pwd,FS,'toolboxes',FS,'CVX']; | |
200 % machine=computer; | |
201 % if (strcmp(machine,'PCWIN')||strcmp(machine,'PCWIN64')) | |
202 % if exist([CVX_path, FS, 'cvx.zip'],'file'), | |
203 % CVX_zip=[CVX_path, FS,'cvx.zip']; | |
204 % else | |
205 % CVX_zip='http://cvxr.com/cvx/cvx.zip'; | |
206 % fprintf('\n\n Downloading toolbox, please be patient\n\n'); | |
207 % end | |
208 % unzip(CVX_zip,CVX_path); | |
209 % else | |
210 % if exist([CVX_path, FS, 'cvx.tar.gz'],'file'), | |
211 % CVX_tar=[CVX_path, FS,'cvx.tar.gz']; | |
212 % else | |
213 % CVX_tar='http://cvxr.com/cvx/cvx.tar.gz'; | |
214 % fprintf('\n\n Downloading toolbox, please be patient\n\n'); | |
215 % end | |
216 % untar(CVX_tar,CVX_path); | |
217 % end | |
218 % cd([CVX_path,FS,'cvx']); | |
219 % fprintf('\n\n Running cvx_setup.m script \n\n'); | |
220 % cvx_setup; | |
221 % fprintf('\n\n Ignore the cvx_setup note about adding the path. It is done automatically in SMALLbox \n\n'); | |
222 % CVX_p=genpath(CVX_path); | |
223 % addpath(CVX_p); | |
224 % fprintf('\n CVX Installation Successful\n'); | |
225 % catch | |
226 % fprintf('\n CVX Installation Failed'); | |
227 % end | |
228 % cd(SMALL_path); | |
229 % else | |
230 % fprintf('\n ******************************************************************'); | |
231 % fprintf('\n\n CVX is already installed'); | |
232 % end | |
233 % | |
234 % %% | |
235 % %% KSVD utils setup | |
236 % | |
237 % if ~(exist('addtocols')==3) | |
238 % cd([SMALL_path,FS,'util',FS,'ksvd utils']); | |
239 % make | |
240 % cd(SMALL_path); | |
241 % end | |
242 % | |
243 % %% fast omp for Gabor dictionary | |
244 % | |
245 % if ~(exist('omp2Gabor')==3) | |
246 % cd([SMALL_path,FS,'solvers', FS,'SMALL_ompGabor']); | |
247 % make | |
248 % cd(SMALL_path); | |
249 % end | |
250 % %% | |
251 % if ~exist('ksvdver.m','file') | |
252 % fprintf('\n ******************************************************************'); | |
253 % fprintf('\n\n Initialising OMPbox and KSVDBox Setup'); | |
254 % | |
255 % try | |
256 % KSVD_path = [pwd,FS,'toolboxes',FS,'KSVD']; | |
257 % if exist([KSVD_path, FS, 'ompbox10.zip'],'file'), | |
258 % omp_zip=[KSVD_path, FS, 'ompbox10.zip']; | |
259 % else | |
260 % omp_zip='http://www.cs.technion.ac.il/%7Eronrubin/Software/ompbox10.zip'; | |
261 % fprintf('\n\n Downloading toolbox, please be patient\n\n'); | |
262 % end | |
263 % unzip(omp_zip,[KSVD_path, FS, 'ompbox']); | |
264 % | |
265 % cd([KSVD_path, FS, 'ompbox', FS, 'private']); | |
266 % make; | |
267 % cd(SMALL_path); | |
268 % | |
269 % if exist([KSVD_path, FS, 'ksvdbox13.zip'],'file'), | |
270 % KSVD_zip=[KSVD_path, FS, 'ksvdbox13.zip']; | |
271 % else | |
272 % KSVD_zip='http://www.cs.technion.ac.il/%7Eronrubin/Software/ksvdbox13.zip'; | |
273 % fprintf('\n\n Downloading toolbox, please be patient\n\n'); | |
274 % end | |
275 % unzip(KSVD_zip,[KSVD_path, FS, 'ksvdbox']); | |
276 % cd([KSVD_path, FS, 'ksvdbox', FS, 'private']); | |
277 % make; | |
278 % cd(SMALL_path); | |
279 % KSVD_p=genpath(KSVD_path); | |
280 % addpath(KSVD_p); | |
281 % fprintf('\n KSVDBox and OMPBox Installation Successful\n'); | |
282 % catch | |
283 % fprintf('\n KSVDBox and OMPBox Installation Failed'); | |
284 % cd(SMALL_path); | |
285 % end | |
286 % else | |
287 % fprintf('\n ******************************************************************'); | |
288 % fprintf('\n\n KSVD is already installed'); | |
289 % end | |
290 % %% | |
291 % if ~exist('ksvdsver.m','file') | |
292 % fprintf('\n ******************************************************************'); | |
293 % fprintf('\n\n Initialising OMPSbox and KSVDSBox Setup'); | |
294 % | |
295 % try | |
296 % KSVDS_path = [pwd,FS,'toolboxes',FS,'KSVDS']; | |
297 % if exist([KSVDS_path, FS, 'ompsbox1.zip'],'file'), | |
298 % omps_zip=[KSVDS_path, FS, 'ompsbox1.zip']; | |
299 % else | |
300 % omps_zip='http://www.cs.technion.ac.il/%7Eronrubin/Software/ompsbox1.zip'; | |
301 % fprintf('\n\n Downloading toolbox, please be patient\n\n'); | |
302 % end | |
303 % unzip(omps_zip,[KSVDS_path, FS, 'ompsbox']); | |
304 % | |
305 % cd([KSVDS_path, FS, 'ompsbox', FS, 'private']); | |
306 % make; | |
307 % cd(SMALL_path); | |
308 % | |
309 % if exist([KSVDS_path, FS, 'ksvdsbox11.zip'],'file'), | |
310 % KSVDS_zip=[KSVDS_path, FS, 'ksvdsbox11.zip']; | |
311 % else | |
312 % KSVDS_zip='http://www.cs.technion.ac.il/%7Eronrubin/Software/ksvdsbox11.zip'; | |
313 % fprintf('\n\n Downloading toolbox, please be patient\n\n'); | |
314 % end | |
315 % unzip(KSVDS_zip,[KSVDS_path, FS, 'ksvdsbox']); | |
316 % cd([KSVDS_path, FS, 'ksvdsbox', FS, 'private']); | |
317 % make; | |
318 % cd(SMALL_path); | |
319 % KSVDS_p=genpath(KSVDS_path); | |
320 % addpath(KSVDS_p); | |
321 % fprintf('\n KSVDSbox and OMPSbox Installation Successful\n'); | |
322 % catch | |
323 % fprintf('\n KSVDSbox and OMPSbox Installation Failed'); | |
324 % cd(SMALL_path); | |
325 % end | |
326 % else | |
327 % fprintf('\n ******************************************************************'); | |
328 % fprintf('\n\n KSVDS is already installed'); | |
329 % end | |
330 % %% | |
331 % | |
332 % if ~exist('mexTrainDL.m','file') | |
333 % fprintf('\n ******************************************************************'); | |
334 % fprintf('\n\n If you want to use SMALLbox with SPAMS On-line Dictionary Learning please go to:'); | |
335 % fprintf('\n http://www.di.ens.fr/willow/SPAMS/index.html'); | |
336 % fprintf('\n and follow the instructions. The License prohibits redistribution of the SPAMS.'); | |
337 % | |
338 % else | |
339 % fprintf('\n ******************************************************************'); | |
340 % fprintf('\n\n SPAMS On-line Dictionary Learning is already installed'); | |
341 % end; | |
342 % %% | |
343 % | |
344 % | |
345 % if ~exist('midiInfo.m','file') | |
346 % try | |
347 % matlab_midi_path = [pwd,FS,'util',FS,'matlab_midi']; | |
348 % if exist([matlab_midi_path, FS, 'matlab_midi.zip'],'file'), | |
349 % matlab_midi_zip=[SL_path, FS, 'matlab_midi.zip']; | |
350 % else | |
351 % matlab_midi_zip='http://www.kenschutte.com/static/code/matlab_midi.zip'; | |
352 % fprintf('\n\n Downloading toolbox, please be patient\n\n'); | |
353 % end | |
354 % unzip(matlab_midi_zip,matlab_midi_path); | |
355 % matlab_midi_p=genpath(matlab_midi_path); | |
356 % addpath(matlab_midi_p); | |
357 % fprintf('\n matlab_midi (http://www.kenschutte.com/midi/) Installation Successful!\n'); | |
358 % catch | |
359 % fprintf('\n matlab_midi (http://www.kenschutte.com/midi/) Installation Failed\n'); | |
360 % cd(SMALL_path); | |
361 % end | |
362 % | |
363 % else | |
364 % fprintf('\n ******************************************************************'); | |
365 % fprintf('\n\n matlab_midi (http://www.kenschutte.com/midi/) is already installed'); | |
366 % end | |
367 % | |
368 % | |
369 % | |
370 % %% RWT setup | |
371 % if ~(exist('mdwt')==3) | |
372 % cd([SMALL_path, FS, 'util', FS, 'Rice Wavelet Toolbox']) | |
373 % fprintf('Compiling the Rice Wavelet Toolbox MEX interfaces...'); | |
374 % try | |
375 % if exist('mdwt' ,'file')~=3, mex mdwt.c; end | |
376 % if exist('midwt' ,'file')~=3, mex midwt.c; end | |
377 % if exist('mrdwt' ,'file')~=3, mex mrdwt.c; end | |
378 % if exist('mirdwt','file')~=3, mex mirdwt.c; end | |
379 % fprintf('Rice Wavelet Toolbox Installation Successful!\n\n'); | |
380 % catch | |
381 % warning('Could not compile Rice Wavelet Toolbox MEX interfaces.\n'); | |
382 % end | |
383 % cd(SMALL_path); | |
384 % end | |
385 % %% | |
386 % fprintf('\n ******************************************************************'); | |
387 % fprintf('\n\n Initialising SMALLbox Examples Setup'); | |
388 % | |
389 % % % Need to do a bit of temporary housekeeping first. | |
390 % % cd(SMALL_path); | |
391 % % try | |
392 % % cd(['Problems',FS,'private']); | |
393 % % if exist('addtocols' ,'file')~=3, | |
394 % % fprintf('\n Compiling MEX interfaces for SMALL examples \n'); | |
395 % % make; | |
396 % % end | |
397 % % fprintf('\n SMALLbox Problems Installation Successful! \n'); | |
398 % % catch | |
399 % % fprintf('\n SMALLbox Problems Installation Failed \n'); | |
400 % % end | |
401 % % cd(SMALL_path); | |
402 % | |
403 % | |
404 % | |
405 % fprintf('\n ******************************************************************'); | |
406 % fprintf('\n\n SMALLbox Installation Complete!'); | |
407 % | |
408 % | |
409 % fprintf('\n\n For more information on the installed toolboxes see'); | |
410 % fprintf('\n\n Sparco: http://www.cs.ubc.ca/labs/scl/sparco/'); | |
411 % fprintf('\n\n SPGL1: http://www.cs.ubc.ca/labs/spgl1/?n=HomePage'); | |
412 % fprintf('\n\n SparseLab: http://sparselab.stanford.edu/ (PLEASE REGISTER SPARSELAB!)'); | |
413 % fprintf('\n\n Sparsify: http://www.see.ed.ac.uk/~tblumens/sparsify/sparsify.html'); | |
414 % fprintf('\n\n GPSR: http://www.lx.it.pt/~mtf/GPSR/'); | |
415 % fprintf('\n\n CVX: http://cvxr.com/cvx/'); | |
416 % fprintf('\n\n OMPbox and KSVDBox: http://www.cs.technion.ac.il/~ronrubin/\n'); | |
417 % | |
418 % | |
419 % % LIST DEMOS FROM EXAMPLE DIRECTORY... | |
420 % | |
421 % demo_ack = input('\n\n Would you like to run a demo: ([y]/n)? ','s'); | |
422 % | |
423 % if demo_ack == 'n', | |
424 % fprintf('\n Thank you for installing SMALLbox.'); | |
425 % fprintf('\n For information on the SMALLbox example scripts'); | |
426 % fprintf('\n Please see the examples directory. \n'); | |
427 % return; | |
428 % else | |
429 % | |
430 % demo_choice = input('\n 1 to run SMALL_solver_test \n 2 to run Dictionary Learning for Image Denoising demo \n q to quit: ','s'); | |
431 % switch(demo_choice) | |
432 % case{'1'} | |
433 % fprintf('\n Running SMALL_solver_test problem'); | |
434 % SMALL_solver_test; | |
435 % case{'2'} | |
436 % fprintf('\n Running SMALL Image Denoise problem'); | |
437 % SMALL_ImgDenoise_DL_test_KSVDvsSPAMS; | |
438 % otherwise | |
439 % return; | |
440 % end | |
441 % | |
442 % end | |
443 % | |
444 | |
445 |