-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPacMan_CageLab.m
More file actions
48 lines (41 loc) · 1.08 KB
/
PacMan_CageLab.m
File metadata and controls
48 lines (41 loc) · 1.08 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
function PacMan_CageLab(opts)
% legacy code uses globals
global pacmanOpts mapname datapath SubjectName Left
% we use alyxManager to identify the save path
if isfield(opts,'savePath')
savePath = opt.savePath;
opts.alyx.paths.savedData = savePath;
else
savePath = opts.alyx.paths.savedData;
end
[datapath,sID,dID,ALFName] = opts.alyx.getALF(...
opts.session.subjectName,opts.session.labName,...
true);
if isempty(datapath) || ~exist(datapath,'dir')
mkdir(datapath);
end
%% Set up paths
opts.rootPath = fileparts(mfilename("fullpath"));
opts.mapPath = [opts.rootPath filesep 'Maps'];
addpath(opts.mapPath);
opts.diaryPath = [datapath filesep ['diary.text.' ALFName '.log']];
diary(opts.diaryPath);
%% other initialisation
audioread('explode.mp3');
SubjectName = opts.session.subjectName;
Left = 0;
if isfield(opts,'mapName') && ~isempty(opts.mapName)
mapname = opts.mapName;
else
mapname = "GenerateRandomMap_1_T_random_dir";
end
pacmanOpts = opts;
%% the current main function
try
main_20181216xy;
catch ME
rmdir(datapath);
sca;
rethrow(ME)
end
end