-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcriterion2Run.m
148 lines (144 loc) · 4.22 KB
/
criterion2Run.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
%% CREATE LIST OF CONDITIONS TO BE TESTED
if verLessThan('matlab','R2013b')
error('This MATLAB is too old. We need MATLAB 2013b or better to use the function "struct2table".');
end
clear o oo
skipDataCollection=0; % Used to check plotting before we have data.
% We list parameters here in the order that we want them to appear
% as columns in the list.
o.condition=1;
o.experiment='criterion';
o.eccentricityXYDeg=[0 0];
o.noiseSD=0.16;
o.noiseType= 'gaussian';
o.eyes='right';
o.viewingDistanceCm=40;
o.targetHeightDeg=1;
o.targetGaborCycles=3;
o.targetDurationSec = 0.2;
o.isTargetFullResolution=0;
o.pThreshold = 0.75;
cal=OurScreenCalibrations(0);
%% Effect of threshold criterion: Graph Neq vs. P.
% In each of the 3 domains
% P: 0.35, 0.55, 0.75, 0.95
% size: 2, 16 deg
% eccentricity: 0, 30 deg
% (omit 2 deg letter at 30 deg ecc.)
o.experiment='Neq vs. P';
o.eyes='right'; % 'left', 'right', 'both'.
Ps=[0.35, 0.55, 0.75, 0.95];
for domain=1:3
switch domain
case 1
% photon
ecc=0;
cpd=4;
o.targetDurationSec=0.1;
o.luminanceFactor=1/8;
o.conditionName='photon';
% o.minScreenWidthDeg=10;
case 2
% cortical
ecc=0;
cpd=0.5;
o.targetDurationSec=0.4;
o.luminanceFactor=1;
o.conditionName='cortical';
% o.minScreenWidthDeg=10;
case 3
% ganglion
ecc=30;
cpd=0.2;
o.targetDurationSec=0.2;
o.luminanceFactor=1;
o.conditionName='ganglion';
% o.minScreenWidthDeg=50;
end
for noiseSD = [0 0.16]
o.eccentricityXYDeg=[ecc 0];
o.targetHeightDeg=o.targetGaborCycles/cpd;
o.minScreenWidthDeg=1+abs(o.eccentricityXYDeg(1))+o.targetHeightDeg*0.75;
o.maxViewingDistanceCm=round(cal.screenWidthMm/10/(2*tand(o.minScreenWidthDeg/2)));
o.viewingDistanceCm=min([o.maxViewingDistanceCm 50]);
o.noiseCheckDeg=o.targetHeightDeg/20;
o.noiseSD=noiseSD;
for p=Ps
o.pThreshold=p;
if ~exist('oo','var')
oo=o;
else
oo(end+1)=o;
end
end
end
end
%% Number the conditions, and print the list.
for i=1:length(oo)
oo(i).condition=i;
end
t=struct2table(oo);
t % Print the oo list of conditions.
if skipDataCollection
data=table2struct(t);
for i=1:length(data)
data(i).E=10*data(i).noiseSD+1e-5*(1+floor((i-1)/8));
data(i).trials=40;
data(i).N=data(i).noiseSD;
data(i).experimenter='Experimenter';
data(i).observer='Observer';
data(i).targetKind='gabor';
data(i).noiseType='gaussian';
data(i).LBackground=280*data(i).luminanceFactor;
end
criterion2Analyze;
else
%% RUN THE CONDITIONS
% Typically, you'll select just a few of the conditions stored in oo
% that you want to run now. Select them from the printout of "t" above.
for oi=1:length(oo)
o=oo(oi);
% o.useFractionOfScreenToDebug=0.4; % 0: normal, 0.5: small for debugging.
o.experimenter='chen';
o.experimenter='satrianna';
o.experimenter='hortense';
o.experimenter='darshan';
o.experimenter='flavia';
o.experimenter='shenghao';
o.experimenter='yichen';
o.experimenter='';
o.observer=''; % Enter observer's name at run time.
if oi>1 && isempty(o.observer)
o.observer=oOut.observer;
end
if oi>1 && isempty(o.experimenter)
o.experimenter=oOut.experimenter;
end
o.fixationBlankingRadiusReEccentricity=0;
if 0
o.targetKind='letter';
o.targetFont='Sloan';
o.alphabet='DHKNORSVZ';
else
o.targetKind='gabor';
o.targetGaborOrientationsDeg=[0 45 90 135];
o.targetGaborNames='1234';
o.alphabet=o.targetGaborNames;
o.alternatives=length(o.alphabet);
end
o.isNoiseDynamic = 1;
o.isTargetLocationMarked=1;
if all(o.eccentricityXYDeg==0)
o.isTargetLocationMarked=0;
end
o.fixationBlankingRadiusReTargetHeight=0;
o.moviePreSec = 0.2;
o.moviePostSec = 0.2;
o.targetMarkDeg=1;
o.fixationMarkDeg=3;
oOut=NoiseDiscrimination(o);
if oOut.quitExperiment
break
end
end
end % Run the selected conditions