-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtaskfindecode.m
98 lines (95 loc) · 2.41 KB
/
taskfindecode.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
87
88
89
90
91
92
93
94
95
96
97
98
function [fixcode, fixoffcode, tgtcode, tgtoffcode, saccode, ...
stopcode, rewcode, tokcode, errcode1, errcode2, errcode3, basecode, ...
dectgtcode, decsaccode] = taskfindecode(tasktype)
%define ecodes according to task (reverses taskdetect basically)
%add last number for direction
% called by rdd_rasters_sdf
fixcode=[];
fixoffcode=[];
tgtcode=[];
tgtoffcode=[];
saccode=[];
stopcode=[];
rewcode=1030;
errcode1=17385;
errcode2=16386;
errcode3=16387;
tokcode=1501;
basecode=[];
% Two AFC Specific
dectgtcode=605; % Decision target
decsaccode=645; % Decision sac
if strcmp(tasktype,'vg_saccades') || strcmp(tasktype,'optiloc')
basecode=601;
fixcode=621;
fixoffcode=661;
tgtcode=681;
tgtoffcode=103;
saccode=701;
elseif strcmp(tasktype,'base2rem50')
basecode=[602,604,608];
fixcode=[622;624;628];
fixoffcode=[702;664;688];
tgtcode=[662;684;668];
tgtoffcode=[662;103;103];
saccode=[722;704;708];
elseif strcmp(tasktype,'st_saccades')
basecode=602;
fixcode=622;
fixoffcode=742;
tgtcode=662;
tgtoffcode=682;
saccode=702;
elseif strcmp(tasktype,'gapstop') || strcmp(tasktype,'cmd')
basecode=[604,407];
fixcode=[624,427];
fixoffcode=[664,467];
tgtcode=[684,487];
tgtoffcode=[103,103];
saccode=704;
stopcode=507;
elseif strcmp(tasktype,'tokens')
basecode=406;
fixcode=426;
fixoffcode=103; %none
tgtcode=tokcode;
tgtoffcode=103; %none
saccode=466;
elseif strcmp(tasktype,'twoafc') % need to add additional ecodes
basecode=405;
fixcode=425;
fixoffcode=485;
tgtcode=465;
tgtoffcode=585; %1997 but hacking this code: eye in fix pt window
saccode=505;
errcode2=17386;
elseif strcmp(tasktype,'fixation')
basecode=401;
fixcode=421;
fixoffcode=103; %none
tgtcode=fixcode;
tgtoffcode=103; %none
saccode=441;
elseif strcmp(tasktype,'gapsac')
basecode=604;
fixcode=624;
fixoffcode=664;
tgtcode=684;
tgtoffcode=103;
saccode=704;
elseif strcmp(tasktype, 'periodCmd')
basecode=480;
%then all other codes are foudn with reference to reward (1030) or next
%trial initiation (1035)
fixcode=103;
fixoffcode=103;
tgtcode=103;
tgtoffcode=103;
saccode=103;
stopcode=103;
else
disp('task type no recognized');
return
end
% if nargout == 1
% end