-
Notifications
You must be signed in to change notification settings - Fork 0
/
callable_behavfilt_NBACK.m
71 lines (54 loc) · 3.33 KB
/
callable_behavfilt_NBACK.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
function ExcludedMask = callable_behavfilt_NBACK(NumTrials, Behav, FilterConfig)
for i = 1:NumTrials
ExcludedMask(i) = true;
if strcmp(Behav.StimType(i), '*') || ...
strcmp(Behav.RespType(i), '*') || ...
isnan(Behav.RespVerid(i)) % || ...
log_w(['Mapped behav data seems to be invalid for trial ' num2str(i)]);
% behav.RT(i) == NaN
continue;
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TRIAL-SPECIFIC CODE
if FilterConfig.CondComb == 0
% warning('Behav filter not specified');
ExcludedMask(i) = false;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
elseif FilterConfig.CondComb == 1 && ... % S=Target, R=Yes, (V=Correct) % target HIT
Behav.StimType(i) == FilterConfig.StimType.A && ...
strcmp(Behav.RespType(i), FilterConfig.RespType.A)
ExcludedMask(i) = false;
elseif FilterConfig.CondComb == 2 && ... % S=Target, R=No, (V=Wrong) % target miss
Behav.StimType(i) == FilterConfig.StimType.A && ...
strcmp(Behav.RespType(i), FilterConfig.RespType.B)
ExcludedMask(i) = false;
elseif FilterConfig.CondComb == 3 && ... % S=Nontarget, R=No, (V=Correct) % CR
Behav.StimType(i) == FilterConfig.StimType.B && ...
strcmp(Behav.RespType(i), FilterConfig.RespType.B)
ExcludedMask(i) = false;
elseif FilterConfig.CondComb == 4 && ... % S=Nontarget, R=Yes, (V=Wrong) % FA
Behav.StimType(i) == FilterConfig.StimType.B && ...
strcmp(Behav.RespType(i), FilterConfig.RespType.A)
ExcludedMask(i) = false;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
elseif FilterConfig.CondComb == 5 && ... % V=Correct (CORRECT all)
Behav.RespVerid(i) == 1
ExcludedMask(i) = false;
elseif FilterConfig.CondComb == 6 && ... % V=Wrong (WRONG all)
Behav.RespVerid(i) == 0
ExcludedMask(i) = false;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
elseif FilterConfig.CondComb == 7 && ... % all trials with key responses
~strcmp(Behav.RespType(i), 'None')
ExcludedMask(i) = false;
elseif FilterConfig.CondComb == 8 && ... % all trials without key response
strcmp(Behav.RespType(i), 'None')
ExcludedMask(i) = false;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% elseif filterConfig.CondComb < 0 || filterConfig.CondComb > 13
% error('Invalid filter method specified');
% % excludedMask(i) = true;
end
end
end