-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstartup.m
More file actions
executable file
·435 lines (392 loc) · 24.5 KB
/
startup.m
File metadata and controls
executable file
·435 lines (392 loc) · 24.5 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
function startup(psychtoolboxFlavor,forceDefault,noBrainardLabToolbox)
% startup([psychtoolboxFlavor],[forceDefault],[noBrainardLabToolbox])
%
% whichPsychtoolboxFlavor:
% 'default' -- default choice [trunk]
% 'trunk' -- use the trunk version
% 'beta'/'current' -- use the current (aka beta) version.
% 'stable' -- use the stable version.
% 'none' -- no PTB!
%
% forceDefault:
% 0 -- Don't reset saved path unless Psychtoolbox is found on path (default).
% 1 -- Reset saved path to Brainard la default no matter what.
%
% noBrainardLabToolbox:
% 0 -- Add BrainardLab toolbox and some of its fellow travellers (default).
% 1 -- Don't add BLTB.
%
% This file lives in the BrainardLabStartup toolbox, and it is included
% in the path (set by hand) when MATLAB is installed. It
% then adds the other standard toolboxes to everyone's path,
% and adds user specific toolboxes depending on who logged in.
% 9/1/11 dhb Big simplify.
% 4/6/12 dhb Avoid a world of hurt by not putting BrainardLabFMRIToolbox on the path.
% 6/1/12 dhb Default for PTB is github version, then the google code svn version if the
% github version is not there.
% 5/17/13 dhb Protect against routine IsCluster not existing.
% dhb Put RenderToolbox3 on everyone's path, remove RTB2. Remove RTB from Ana.
% 5/29/13 dhb Added SphereRendererToolbox to path.
% 5/30/13 dhb Add call to new RemoveSVNPaths.
% 5/31/13 dhb Use RemoveMatchingPaths. Clean a bit.
% dhb Remove dependency on RemoveTMPPaths, and printout what temp paths are being stripped.
% 6/2/13 dhb Remove mglToolbox, which is now part of BrainardLabToolbox.
% 6/13/13 dhb Add warnings for old PTB and Classes versions.
% 6/19/13 dhb Java paths added here. No need to edit classpath.txt.
% 7/12/13 dhb Use new RemoveTMPPaths to do path removal. This now handles .svn and .git as well as others.
% 8/23/13 dhb Add Turning point stuff to Java classpath.
% 10/17/13 dhb Add BrainardLabToolbox to start, not end, of path. Keeps
% our savefig from being shadowed by Matlab 2013b's savefig.
% Need a better long run fix.
% 10/17/13 npc Added helper function 'addToolboxPathAndWarnIfFoundAtMultipleLocations(toolboxName, newPath, oldPath, paths2add)'
% which checks whether a toolbox exists at two locations (oldPath, newPath).
% Applied this function to toolboxes in the toolboxesdistrib repository, which (in some computers) may be found both
% in the 'Toolboxes' and in the 'ToolboxesDistrib' directories.
% This function also checks if the 'toolboxName' only exists in the 'oldPath' and if so, it warns the user that
% he/she should consider moving it to the newPath.
% 10/23/13 dhb Handle matlabPyrTools possiblity in multiple locations, but
% without quite the same level of warning/error checking.
% 11/1/13 bsh Default for PTB on rhino is github version
% 4/22/14 dhb BrainardLabPrivateToolbox.
% 7/9/14 dhb Added arg that allows one to startup without the
% BrainardLabToobox. This is mainly useful for testing that something in
% the PTB works with and without our BLTB. Possible
% that this should omit other stuff that is pretty specific to
% us, but I didn't do that either.
% 7/31/14 dhb, ncp Classes is no more. Now in BLTB.
% dhb, ncp Put computationaleyebrain/toolbox onto path. Slight
% violation of our conventions, but life is short.
% 8/1/14 dhb Add ColorBookToolbox.
% 11/23/14 dhb Remove user jackallen.
% dhb Add SilentSubstitutionToolbox.
% dhb Remove StimulusPackages.
% 11/24/14 dhb Add RenderToolboxDevelop/VirtualScenesToolbox.
% Remove RenderToolbox3 from Ana's special cases.
% 12/23/14 dhb Remove ConeAdaptationToolbox because it collides with isetbio.
% 09/03/15 dhb MGL is now back to being called mgl, even for the 64 bit version.
% 01/28/16 dhb OneLightDriver, PupilAnalysisToolbox.
% 04/24/16 dhb Add rsatoolbox, delete a bunch of very old things.
% Don't do anything under OS 9 or if being compiled by the Matlab compiler.
if strcmp(computer, 'MAC2') || ismcc || isdeployed
return;
end
% Check for optional org on Psychtoolbox type
if nargin < 1 || isempty(psychtoolboxFlavor)
psychtoolboxFlavor = 'default';
end
if nargin < 2 || isempty(forceDefault)
forceDefault = 0;
end
if nargin < 3 || isempty(noBrainardLabToolbox)
noBrainardLabToolbox = false;
end
% Determines if this computer is some flavor of OS X.
iAmOSX = any(strcmp(computer, {'MAC', 'MACI', 'MACI64'}));
% Check whether stored path has gotten screwed up because there was a
% savepath stuck at the end of this file at some point. Also handles case
% where Psychtoolbox install routines save the path, which is not how we
% run. So this code should stay.
if iAmOSX
if (any(findstr(path,'Psychtoolbox')) || forceDefault)
fprintf('Setting stored path to Brainard lab default\n');
if (exist('restoredefaultpath') == 2) %#ok<*EXIST>
restoredefaultpath;
else
defaultPath = genpath;
path(defaultPath);
end
[nil, host] = unix('hostname');
switch (host(1:end-1))
otherwise,
addpath(genpath('/Users/Shared/Matlab/Toolboxes/BrainardLabStartup'),'-end');
end
savepath; %#ok<*MCSVP>
end
% /usr/local/bin to PATH so we can find things installed by Homebrew
setenv('PATH', ['/usr/local/bin:' getenv('PATH')]);
end
% Only do this for OS/X, not cluster
if iAmOSX
% Get host name, allows special casing certain computers.
[nil, host] = unix('hostname');
% BrainardLabToolbox. Added at start so that our savefig is called
% rather than the savefig.p added in 2013b. Need a better long term
% fix.
if (~noBrainardLabToolbox)
paths2add = addpath(genpath('/Users/Shared/Matlab/Toolboxes/BrainardLabToolbox'),'-begin');
paths2add = addpath(genpath('/Users/Shared/Matlab/Toolboxes/BrainardLabPrivateToolbox'),'-begin');
end
% We use this variable to put all paths we need to add in one long
% string to minimize calls to 'addpath' which seems to eat up a lot of
% time.
paths2add = [];
% Get the computer name. We can special case certain hosts if we want
% to.
switch (host(1:end-1))
otherwise,
fprintf('Startup: Standard Brainard lab configuration\n');
if (noBrainardLabToolbox)
fprintf('But without the BrainardLabToolbox.\n');
end
% Get user to allow user specific customization. Only
% works on OS/X.
[nil, theUser] = unix('whoami');
% Psychtoolbox. We use the trunk.
if ~(strcmp(psychtoolboxFlavor,'none'))
switch (theUser(1:end-1))
otherwise
switch (psychtoolboxFlavor)
case {'default'}
if (exist('/Users/Shared/Matlab/Toolboxes/Psychtoolbox-3/Psychtoolbox','dir'))
paths2add = [paths2add, ...
genpath('/Users/Shared/Matlab/Toolboxes/Psychtoolbox-3/Psychtoolbox')];
else
fprintf('WARNING: You are running an old version of Psychtoolbox. Upgrade. Ask David or Nicolas.\n');
paths2add = [paths2add, ...
genpath('/Users/Shared/Matlab/Toolboxes/Psychtoolbox-Trunk/Psychtoolbox')];
end
case {'github'}
paths2add = [paths2add, ...
genpath('/Users/Shared/Matlab/Toolboxes/Psychtoolbox-3/Psychtoolbox')];
case {'trunk'}
fprintf('WARNING: You are running an old version of Psychtoolbox. Upgrade. Ask David or Nicolas.\n');
paths2add = [paths2add, ...
genpath('/Users/Shared/Matlab/Toolboxes/Psychtoolbox-Trunk/Psychtoolbox')];
case {'beta', 'current'}
fprintf('WARNING: You are running an old version of Psychtoolbox. Upgrade. Ask David or Nicolas.\n');
paths2add = [paths2add, ...
genpath('/Users/Shared/Matlab/Toolboxes/Psychtoolbox-Beta'), ...
];
end
end
end
% User specific custimization. We can special case certain users if we want to.
switch (theUser(1:end-1))
case {'ana', 'radonjic'}
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Experiments/HDRExperiments/HDRCalibration'), ...
genpath('/Users/Shared/Matlab/toolboxes/AnaUtilities')];
case {'nicolas'}
paths2add = [paths2add, ...
genpath('/Users/Shared/Matlab/Toolboxes/libsvm/matlab'), ...
genpath('/Users/Shared/Matlab/Analysis/BLHyperspectralImageComputations'), ...
genpath('/Users/Shared/Matlab/Analysis/IBIOColorDetect'), ...
genpath('/Users/Shared/Matlab/Toolboxes/mgl') ...
genpath('/Users/Shared/Matlab/Toolboxes/OLEDToolbox') ...
genpath('/Users/nicolas/Documents/1.code/2.matlabDevs/ProjectPrefs') ...
genpath('/Users/Shared/Matlab/Toolboxes/jsonlab')
];
case {'pupillab', 'melanopsin', 'connectome'}
paths2add = [paths2add, ...
genpath('/Users/Shared/Matlab/Experiments/OneLight/OLFlickerSensitivity'), ...
genpath('/Users/Shared/Matlab/Experiments/OneLight/OLPsychophysics'), ...
genpath('/Users/Shared/Matlab/Toolboxes/mgl'), ...
genpath('/Users/Shared/Matlab/Toolboxes/LightandReceptorCalculations')];
case {'spitschan', 'mspits'}
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/SpikeSortToolbox') ...
genpath('/Users/Shared/Matlab/toolboxes/ManuelUtilities') ...
genpath('/Applications/freesurfer/matlab') ...
genpath('/Users/Shared/Matlab/Experiments/OneLight/OLFlickerSensitivity') ...
genpath('/Users/Shared/Matlab/Experiments/OneLight/OLPsychophysics'), ...
genpath('/Users/Shared/Matlab/Toolboxes/AstroMatlab') ...
genpath('/Users/Shared/Matlab/Toolboxes/burgelabtoolbox') ...
genpath('/Users/Shared/Matlab/Toolboxes/mriTemporalFitting') ...
genpath('/Users/Shared/Matlab/gkaguirrelab_Toolboxes') ...
genpath('/Users/Shared/Matlab/gkaguirrelab_Projects') ...
genpath('/Users/Shared/Matlab/gkaguirrelab_Stimuli')];
setenv('FREESURFER_HOME', '/Applications/freesurfer');
setenv('SUBJECTS_DIR', '/Applications/freesurfer/subjects');
setenv('FSFAST_HOME', '/Applications/freesurfer/fsfast');
setenv('FSF_OUTPUT_FORMAT', 'nii.gz');
setenv('FSL_DIR', '/usr/local/fsl');
setenv('FSLDIR', '/usr/local/fsl');
setenv('MNI_DIR', '/Applications/freesurfer/mni');
setenv('FSLOUTPUTTYPE', 'NIFTI_GZ');
setenv('PATH', [getenv('PATH') ':/Applications/freesurfer/bin'])
%------------ FreeSurfer -----------------------------%
fshome = getenv('FREESURFER_HOME');
fsmatlab = sprintf('%s/matlab',fshome);
if (exist(fsmatlab) == 7)
path(path,fsmatlab);
end
clear fshome fsmatlab;
%-----------------------------------------------------%
%------------ FreeSurfer FAST ------------------------%
fsfasthome = getenv('FSFAST_HOME');
fsfasttoolbox = sprintf('%s/toolbox',fsfasthome);
if (exist(fsfasttoolbox) == 7)
path(path,fsfasttoolbox);
end
clear fsfasthome fsfasttoolbox;
%-----------------------------------------------------%
% Add ANTS
setenv('ANTSPATH', '/usr/bin');
setenv('PATH', [getenv('PATH') ':' getenv('ANTSPATH') ':' '/usr/local/fsl/bin']);
setenv('PATH', [getenv('PATH') ':/usr/local/afni']);
setenv('DYLD_LIBRARY_PATH', '/usr/local/bin/');
end
% Other standard stuff
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/ColorMemoryToolbox')];
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/ContrastResponseModelToolbox')];
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/DenoiseToolbox')];
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/EKColorimetryToolbox')];
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/EyeTrackerToolbox')];
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/HDRToolbox')];
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/ImageAlignmentToolbox')];
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/ImageWarpToolbox')];
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/LabPlotToolbox')];
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/MDSToolbox')];
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/NIToolbox')];
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/OneLightToolbox')];
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/OneLightDriver')];
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/PupilAnalysisToolbox')];
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/PsychCalLocalData')];
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/ReceptorLearningToolbox')];
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/StereoHDRToolbox')];
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/SilentSubstitutionToolbox')];
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/TTClickersToolbox')];
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/LEDToolbox')];
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/ColorBookToolbox')];
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/MRklar')];
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/MRlyze')];
% Toolboxes in our local toolboxesdistrib repository.
if (exist('/Users/Shared/Matlab/ToolboxesDistrib/matlabPyrTools/','dir'))
paths2add = [paths2add, '/Users/Shared/Matlab/ToolboxesDistrib/matlabPyrTools/MEX:', ...
'/Users/Shared/Matlab/ToolboxesDistrib/matlabPyrTools:'];
elseif (exist('/Users/Shared/Matlab/Toolboxes/matlabPyrTools/','dir'))
paths2add = [paths2add, '/Users/Shared/Matlab/Toolboxes/matlabPyrTools/MEX:', ...
'/Users/Shared/Matlab/Toolboxes/matlabPyrTools:'];
end
paths2add = addToolboxPathAndWarnIfFoundAtMultipleLocations('ComplexStatisticsToolbox', '/Users/Shared/Matlab/ToolboxesDistrib', '/Users/Shared/Matlab/Toolboxes', paths2add);
paths2add = addToolboxPathAndWarnIfFoundAtMultipleLocations('m2html', '/Users/Shared/Matlab/ToolboxesDistrib', '/Users/Shared/Matlab/Toolboxes', paths2add);
if (exist('/Users/Shared/Matlab/ToolboxesDistrib/Palamedes/','dir'))
paths2add = addToolboxPathAndWarnIfFoundAtMultipleLocations('Palamedes', '/Users/Shared/Matlab/ToolboxesDistrib', '/Users/Shared/Matlab/Toolboxes', paths2add);
elseif (exist('/Users/Shared/Matlab/ToolboxesDistrib/Palamedes_1.0/','dir'))
paths2add = addToolboxPathAndWarnIfFoundAtMultipleLocations('Palamedes_1.0', '/Users/Shared/Matlab/ToolboxesDistrib', '/Users/Shared/Matlab/Toolboxes', paths2add);
else
paths2add = addToolboxPathAndWarnIfFoundAtMultipleLocations('Palamedes_1.8', '/Users/Shared/Matlab/ToolboxesDistrib', '/Users/Shared/Matlab/Toolboxes', paths2add);
end
paths2add = addToolboxPathAndWarnIfFoundAtMultipleLocations('psignifit', '/Users/Shared/Matlab/ToolboxesDistrib', '/Users/Shared/Matlab/Toolboxes', paths2add);
paths2add = addToolboxPathAndWarnIfFoundAtMultipleLocations('NIfTIToolbox', '/Users/Shared/Matlab/ToolboxesDistrib', '/Users/Shared/Matlab/Toolboxes', paths2add);
% MEX file innerProd is now slower than it's m file equivalent.
% So don't wrap this with genpath, leads to the subdir not
% being added.
if (exist('/Users/Shared/Matlab/ToolboxesDistrib/textureSynth/','dir'))
paths2add = [paths2add, '/Users/Shared/Matlab/ToolboxesDistrib/textureSynth:', ...
];
end
% MGL. 32 bit version is local, 64 we get from the distribution server.
% The newest 64 bit version has the old mgl name and is now on gitHub.
% Also, it should live in ToolboxesDistrib, not toolboxes.
%
% I think the 32 bit stuff can go away, but is not really doing
% any harm.
mgl64OverrideComputers = {'squid', 'clam'};
if strcmp(computer, 'MACI64') || any(strcmp(lower(strtok(host, '.')), mgl64OverrideComputers)) || strcmp(host(1:6), 'Baird1')
if (exist('/Users/Shared/Matlab/Toolboxes/mgl64','dir'))
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/mgl64')];
elseif (exist('/Users/Shared/Matlab/ToolboxesDistrib/mgl','dir'))
paths2add = [paths2add, genpath('/Users/Shared/Matlab/ToolboxesDistrib/mgl')];
end
else
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/mgl')];
end
% Render toolbox
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/RenderToolbox3')];
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/SphereRendererToolbox')];
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/VirtualScenes')];
paths2add = [paths2add, genpath('/Users/Shared/Matlab/Toolboxes/Blobbies')];
% Simtoolbox
paths2add = [paths2add,genpath('/Users/Shared/Matlab/Toolboxes/SimAll')];
% Add the PTB overrides toolbox before everything else if it exists.
% This toolbox lets us write 64 bit versions of PTB functions without
% actually touching the PTB.
%overridesDir = '/Users/Shared/Matlab/Toolboxes/PTBOverrides';
%if exist(overridesDir, 'dir') && strcmp(computer, 'MACI64')
% paths2add = [overridesDir, ':', paths2add];
%end
% If we're using a 64 bit version of Matlab we need to remove
% the PTB's version of MOGL from the path because it's only 32
% bit and add our local 64 bit version. Once the PTB updates their
% MOGL version this section can be removed.
if strcmp(computer, 'MACI64')
rmpath(genpath(fileparts(which('MOGL/contents'))));
moglDir = '/Users/Shared/Matlab/Toolboxes/mogl';
if exist(moglDir, 'dir')
addpath(genpath(moglDir), '-end');
end
end
% ISET at end so that conflicting names get our version.
paths2add = [paths2add genpath('/Users/Shared/Matlab/Toolboxes/isetbio')];
paths2add = [paths2add genpath('/Users/Shared/Matlab/Toolboxes/UnitTestToolbox')];
paths2add = [paths2add genpath('/Users/Shared/Matlab/Toolboxes/RemoteDataToolbox')];
% Same with rsatoolbox
paths2add = [paths2add, genpath('/Users/Shared/Matlab/ToolboxesDistrib/rsatoolbox')];
end % End switch (host(1:end-1))
end % End if (strcmp(computer,'MAC'))
% Cluster initialization https://github.com/isetbio/RemoteDataToolbox/blob/master/scripts/testConnection.m
if (exist('IsCluster'))
[isCluster,whichCluster] = IsCluster;
else
isCluster = false;
end
if (isCluster)
% We use this variable to put all paths we need to add in one long
% string to minimize calls to 'addpath' which seems to eat up a lot of
% time.
paths2add = [];
if (strcmp(whichCluster,'gpc'))
% GPC
fprintf('Startup: Standard Brainard GPC configuration\n');
% Psychtoolbox
paths2add = [paths2add, ...
genpath('/home/dhb/toolboxes/Psychtoolbox-3/Psychtoolbox'), ...
];
% ToolboxToolbox
paths2add = [paths2add, genpath('/home/dhb/toolboxes/ToolboxToolbox')];
% BrainardLabToolbox
paths2add = [paths2add, genpath('/home/dhb/toolboxes/BrainardLabToolbox')];
% isetbio
paths2add = [paths2add, genpath('/home/dhb/toolboxes/isetbio')];
paths2add = [paths2add, genpath('/home/dhb/toolboxes/UnitTestToolbox')];
paths2add = [paths2add, genpath('/home/dhb/toolboxes/RemoteDataToolbox')];
% rsatoolbox
paths2add = [paths2add, genpath('/home/dhb/toolboxesdistrib/rsatoolbox')];
end
end
%% Now add and clean. This applies to all platforms and machines.
addpath(paths2add, '-end');
if (exist('RemoveTMPPaths.m','file'))
path(RemoveTMPPaths([],true));
end
% Java dynamic path. Only on OS/X for now. This maight
% also be fine on other machine types, but has not been
% tested and is not currently needed in the BrainardLab.
if (iAmOSX)
if (~noBrainardLabToolbox)
JavaAddToPath('/Users/Shared/Matlab/Toolboxes/Psychtoolbox-3/Psychtoolbox/PsychJava','Psychtoolbox/PsychJava');
JavaAddToPath('/Users/Shared/Matlab/Toolboxes/BrainardLabToolbox/Java/jheapcl/MatlabGarbageCollector.jar','MatlabGarbageCollector.jar');
JavaAddToPath('/Users/Shared/Matlab/Toolboxes/OneLightToolbox/OLEngine/OOI_HOME/OmniDriver.jar','OmniDriver.jar');
JavaAddToPath('/Users/Shared/Matlab/Toolboxes/OneLightDriver/xOceanOpticsJava/OmniDriver.jar','OmniDriver.jar');
JavaAddToPath('/Users/Shared/Matlab/Toolboxes/TTClickersToolbox/ResponseCardSDK-2.6.4/ResponseCardSDK-2.6.4-RELEASE.jar','ResponseCardSDK-2.6.4-RELEASE.jar');
%JavaAddToPath('/Users/Shared/Matlab/Toolboxes/TTClickersToolbox/ResponseCardSDK-2.6.4/lib/jna.jar','jna.jar');
end
end
% Done
fprintf('Ready to roll!\n');
end
% helper function that checks if a toolbox exists at two locations
function paths2add = addToolboxPathAndWarnIfFoundAtMultipleLocations(toolboxName, newPath, oldPath, paths2add)
if (exist(fullfile(newPath, toolboxName)))
paths2add = [paths2add, genpath(fullfile(newPath,toolboxName))];
% check whether we have dublicates
if (exist(fullfile(oldPath,toolboxName), 'dir'))
fprintf('\n');
warning('%s found in multiple locations:\n(1)%s\n(2)%s\nRemove it from the old location (%s).\n', toolboxName, oldPath, newPath, oldPath);
end
else
if (exist(fullfile(oldPath,toolboxName), 'dir'))
paths2add = [paths2add, genpath(fullfile(oldPath,toolboxName))];
warning('%s found in the old location (%s).\nConsider moving it to the new location (%s).\n', toolboxName, oldPath, newPath);
end
end
end