-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetSessionLabels.m
More file actions
69 lines (63 loc) · 2.81 KB
/
getSessionLabels.m
File metadata and controls
69 lines (63 loc) · 2.81 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
function Cues = getSessionLabels(Cues, total_frames)
%% Separate shocks by learning period
tone_number = 0;
shock_number = 0;
try
tones = Cues.Tones.Bouts;
tone_number = size(tones, 1);
end
try
[~,session_id] = fileparts(pwd);
if contains(session_id, 'T1')
shock_number = 9;
elseif contains(session_id, 'T2')
shock_number = 12;
end
end
%% Separate learning periods based on number of shocks
try
% Learning sessions
if tone_number == 12
if shock_number == 9
Cues.Session.type = 'T1';
Cues.Session.BL = [1, tones(3,2)];
Cues.Session.EL = [tones(3,2)+1, tones(6,2)];
Cues.Session.ML = [tones(6,2)+1, tones(9,2)];
Cues.Session.LL = [tones(9,2)+1, total_frames];
Cues.Session.BLvector = makeVector(Cues.Session.BL, total_frames);
Cues.Session.ELvector = makeVector(Cues.Session.EL, total_frames);
Cues.Session.MLvector = makeVector(Cues.Session.ML, total_frames);
Cues.Session.LLvector = makeVector(Cues.Session.LL, total_frames);
elseif shock_number == 12
Cues.Session.type = 'T2';
Cues.Session.BL = [1, tones(3,2)];
Cues.Session.EL = [tones(3,2)+1, tones(6,2)];
Cues.Session.ML = [tones(6,2)+1, tones(9,2)];
Cues.Session.LL = [tones(9,2)+1, total_frames];
Cues.Session.BLvector = makeVector(Cues.Session.BL, total_frames);
Cues.Session.ELvector = makeVector(Cues.Session.EL, total_frames);
Cues.Session.MLvector = makeVector(Cues.Session.ML, total_frames);
Cues.Session.LLvector = makeVector(Cues.Session.LL, total_frames);
elseif shock_number == 0
Cues.Session.type = 'T_NS';
Cues.Session.BL = [1, tones(3,2)];
Cues.Session.EL = [tones(3,2)+1, tones(6,2)];
Cues.Session.ML = [tones(6,2)+1, tones(9,2)];
Cues.Session.LL = [tones(9,2)+1, total_frames];
Cues.Session.BLvector = makeVector(Cues.Session.BL, total_frames);
Cues.Session.ELvector = makeVector(Cues.Session.EL, total_frames);
Cues.Session.MLvector = makeVector(Cues.Session.ML, total_frames);
Cues.Session.LLvector = makeVector(Cues.Session.LL, total_frames);
end
% Retrieval sessions
elseif tone_number == 9
Cues.Session.ER = [1, tones(3,2)];
Cues.Session.MR = [tones(3,2)+1, tones(6,2)];
Cues.Session.LR = [tones(6,2)+1, total_frames];
Cues.Session.ERvector = makeVector(Cues.Session.ER, total_frames);
Cues.Session.MRvector = makeVector(Cues.Session.MR, total_frames);
Cues.Session.LRvector = makeVector(Cues.Session.LR, total_frames);
end
save('Cues', 'Cues')
end
end