-
Notifications
You must be signed in to change notification settings - Fork 0
/
support_SaveTrialExclusionSummary.m
48 lines (39 loc) · 1.72 KB
/
support_SaveTrialExclusionSummary.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
function support_SaveTrialExclusionSummary(TRIAL_EXCLUSIONS, Config, Meta, Participants)
col_Participants = transpose([{ [Meta.CfPrefix '_' 'Participant'] } Participants]);
cols_sub_vals = cell(length(Participants)+1, 1);
cols_sub_vals(1, 1:9) = { ...
['Excl_OnInterpol'] ...
['Excl_OnBaselineBlink'] ...
['Excl_OnBaselineSaccade'] ...
['Excl_OnSOIBlink'] ...
['Excl_OnSOISaccade'] ...
['Excl_OnSD'] ...
['Excl_OnBehav'] ...
['Rejected'] ...
['Passed'] ...
};
cols_sub_vals(2:length(Participants)+1, 1:9) = num2cell(TRIAL_EXCLUSIONS);
outputMatrix = [col_Participants cols_sub_vals];
if Config.CC.Enabled
% TODO: better
outputMatrix = [outputMatrix ['Cond1_Passed'; num2cell(sum(~Config.CC.ExcludedMasks(1, :)))] ];
outputMatrix = [outputMatrix ['Cond2_Passed'; num2cell(sum(~Config.CC.ExcludedMasks(2, :)))] ];
end
OutFilePath = char([ ...
'~RESULTS/' Meta.RootDirTag '/' ...
]);
if ~exist(OutFilePath, 'dir')
mkdir(OutFilePath);
end
OutFileName = char([ ...
'Trial_excl' ...
' PfromSec=' num2str(Config.PeakFromSec) ...
'; PtoSec=' num2str(Config.PeakToSec) ...
' BLfromSec=' num2str(Config.BaselineFromSec) ...
'; BLtoSec=' num2str(Config.BaselineToSec) ...
' alignSR=' num2str(Config.AlignToStimOrResp) ...
' skipN=' num2str(Config.SkipFirstNtrials) ...
' filt=' num2str(Config.Filter.Behav.Enabled) ' (' Config.Filter.Behav.FriendlyName ')' ...
]);
writecell(outputMatrix,[OutFilePath OutFileName '.csv'],'Delimiter',';');
end