-
Notifications
You must be signed in to change notification settings - Fork 1
/
measurePeripheralThresholdsClass.m
248 lines (230 loc) · 7.6 KB
/
measurePeripheralThresholdsClass.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
% measurePeripheralThresholds
% February 28, 2017, [email protected]
% Script for Ning and Chen to measure equivalent noise in the periphery.
clear o
o.durationSec=0.5; % signal duration. [0.05, 0.5]
o.trialsDesired=40;
% NOISE
o.isNoiseDynamic = 1; % 0 for static noise
o.moviePreSec = 0.1; % ignored for static noise
o.moviePostSec = 0.2; % ignored for static noise
o.noiseType='binary'; % 'gaussian' or 'uniform' or 'binary'
o.noiseSpectrum='white'; % pink or white
o.noiseCheckDeg=0.09;
o.noiseSD=0.5; % max is 0.16 for gaussian, 0.5 for binary.
o.noiseEnvelopeSpaceConstantDeg=128; % always Inf for hard edge top-hat noise
o.noiseRadiusDeg=inf; % noise decay radius [1 1.7 3 5.2 9 Inf]
% LETTER
o.targetHeightDeg=7.64; % Target size, range 0 to inf.
o.eccentricityXYDeg=[0 0]; % [0 8 16 32]
o.targetKind='letter';
o.targetFont='Sloan';
o.alphabet='DHKNORSVZ';
o.alternatives=length(o.alphabet); % number of letters to use from o.alphabet
% TO REPLICATE MANOJ
% o.targetFont='ITC Bookman Std';
% o.alphabet='abcdefghijklmnopqrstuvwxyz';
% o.alternatives=length(o.alphabet); % number of letters to use from o.alphabet
% o.targetHeightDeg=2*7.64; % Manoj used xHeight of 7.64 deg.
% FIXATION
o.fixationMarkDeg = 1; % Typically 1 or inf. Make this at least 4 deg for scotopic testing, since the fovea is blind scotopically.
o.targetCross=1;
o.fixationThicknessDeg = 0.05; % target line thickness
o.isFixationBlankedNearTarget = 0; % 0 or 1.
o.fixationMarkBlankedUntilSecAfterTarget = 0.6; % Pause after stimulus before display of fixation.
% Skipped when isFixationBlankedNearTarget. Not needed when eccentricity is bigger than the target.
% USER INTERFACE
o.alphabetPlacement='top'; % show possible answers on 'top' or 'right' for letters and gabors.
% o.fixationThicknessDeg=0.05; % target line thickness
o.isKbLegacy=0; % Uses KbWait, KbCheck, KbStrokeWait functions, instead of GetChar, for Linux compatibility.
% o.tGuess=log10(0.2); % Optionally tell Quest the initial log contrast on first trial.
% SNAPSHOT
o.saveSnapshot=0; % 0 or 1. If true (1), take snapshot for public presentation.
o.saveStimulus=0;
o.snapshotLetterContrast=0.01; % nan to request program default. If set, this determines o.tSnapshot.
o.cropSnapshot=1; % If true (1), show only the target and noise, without unnecessary gray background.
o.snapshotCaptionTextSizeDeg=0.5;
o.snapshotShowsFixationBefore=1;
o.snapshotShowsFixationAfter=0;
o.speakInstructions=0;
% DEBUGGING
o.useFractionOfScreenToDebug=0; % 0: normal, 0.5: small for debugging.
o.flipClick=0;
o.assessContrast=0;
o.assessLoadGamma=0;
o.showCropMarks=0; % mark the bounding box of the target
o.printDurations=0;
% Please measure:
% Sloan
% Eccentricities = 0, 3, 10, 30 deg
% Duration = 0.05, 0.5 s
% targetHeightDeg = 1, 4, 16 deg
% ?(Note: at 30 deg ecc, omit 1 deg. Substitute 2 deg.)?
% WITH AND WITHOUT NOISE
% gaussian
% noiseSD = 0.16
% checkHeightDeg = targetHeightDeg/20
% checkSec = 1/60 s.
% PreSecs = 0.1 s.
% PostSecs = 0.2 s.
% REPEAT
% If the two threshold contrasts, after repetition, differ by 2x or more,
% then please collect a third point.
% IMPORTANT: Use a tape measure or meter stick to measure the distance from
% your eye to the screen. The number below must be accurate.
o.observer='Chen'; % use your name
o.distanceCm=70; % viewing distance
o.targetFont='Sloan';
o.alphabet='DHKNORSVZ';
o.noiseType='gaussian'; % 'gaussian' or 'uniform' or 'binary'
% o.durationSec=0.5;
% o.noiseSD=0.0;
% o.targetHeightDeg=16;
% o.eccentricityXYDeg=[10 0];
if 0
cnt = 0;
for ecc=[0, 3, 10]
for dur=[0.05 0.5]
for height=[1 4 16]
for nSD=[0 0.16]
o.eccentricityXYDeg=[ecc 0];
o.durationSec=dur;
o.targetHeightDeg=height;
o.noiseCheckDeg=height/20;
o.noiseSD=nSD;
for a = 1:2
o=NoiseDiscrimination(o);
cnt = cnt + 1;
Data{cnt}=o;
%o=NoiseDiscrimination(o); % REPEAT
end
end
end
end
end
end
% letter size at eccentricity of 30 too small if it is 1
if 0
cnt = 72;
for ecc=[30]
for dur=[0.05 0.5]
for height=[2 4 16]
for nSD=[0 0.16]
o.eccentricityXYDeg=[ecc 0];
o.durationSec=dur;
o.targetHeightDeg=height;
o.noiseCheckDeg=height/20;
o.noiseSD=nSD;
for a = 1:2
o=NoiseDiscrimination(o);
cnt = cnt + 1;
Data{cnt}=o;
%o=NoiseDiscrimination(o); % REPEAT
end
end
end
end
end
end
% DO THIS FIRST:
% Before collecting a lot of data we need to be sure that this noise is
% strong enough to always elevate threshold, so we should FIRST try the
% toughest threshold:
% Eccentricity = 30 deg
% Duration = 0.5 s
% targetHeightDeg = 16 deg
% checkHeightDeg = targetHeightDeg/20 = 0.8 deg
% With and without noise
if 0
for nSD=[0 0.16]
o.eccentricityXYDeg=[30 0];
o.durationSec=0.5;
o.targetHeightDeg=16;
o.noiseCheckDeg=o.targetHeightDeg/20;
o.noiseSD=nSD;
o=NoiseDiscrimination(o);
o=NoiseDiscrimination(o); % REPEAT
end
end
% We want threshold with noise at least twice threshold without noise. If
% not, we may need to increase the check size or switch to binary noise.
% Please let us know!
% The dark filter is important, but will play only a small role, so we only
% need a bit of data with it.
% WITH DARK FILTER
% targetHeightDeg = 1 deg
% Eccentricities = 0, 3, 10, 30 deg
% WITH AND WITHOUT NOISE
if 0
for ecc=[0, 3, 10, 30]
for dur=0.5
for height=1
for nSD=[0 0.16]
o.eccentricityXYDeg=[ecc 0];
o.durationSec=dur;
o.targetHeightDeg=height;
o.noiseCheckDeg=height/20;
o.noiseSD=nSD;
o=NoiseDiscrimination(o);
o=NoiseDiscrimination(o); % REPEAT
end
end
end
end
end
% new collecting data
% duration .2s
% size 2 4 7 16
% eccentricity 0 3 10 30
% noiseSD 0 and 016
% gaissian noise
o.durationSec = 0.2;
sizes = [2 4 8 16];
eccenticityDeg = [0 3 10 30];
noiseSD = [0];
if 0
for ecc = eccenticityDeg
o.observer='ning';
for LetterSize = sizes
for noise = noiseSD
o.eccentricityXYDeg=[ecc 0];
o.targetHeightDeg=LetterSize;
o.noiseCheckDeg=o.targetHeightDeg/20;
o.noiseSD=noise;
o=NoiseDiscrimination(o);
end
end
end
end
if 0
noiseSD=[0];
lettersize = [16];
o.observer='ning';
for letter_size = lettersize
for noise = noiseSD
o.targetHeightDeg= letter_size;
o.eccentricityXYDeg = [10 0];
o.noiseSD=noise;
o.noiseCheckDeg=o.targetHeightDeg/20;
o=NoiseDiscrimination(o);
end
end
end
% o.useFractionOfScreenToDebug=.3;
o.isNoiseDynamic = 1; % 0 for static noise
o.durationSec = 1;
o.observer='class';
o.assessContrast=0;
o.assessLoadGamma=0;
o.assessGray=0;
o.assessTargetLuminance=0;
o.tGuess=log10(0.01);
o.eccentricityXYDeg=[0 0];
o.targetHeightDeg=8;
o.noiseCheckDeg=o.targetHeightDeg/20;
o.noiseType='binary'; % 'gaussian' or 'uniform' or 'binary'
o.noiseSD=0.5;
o.screen=0;
o.nearPointXYInUnitSquare=[0.5 0.5];
o=NoiseDiscrimination(o);
% imshow(o.actualStimulus);