-
Notifications
You must be signed in to change notification settings - Fork 4
/
runCriticalSpacing.m
executable file
·239 lines (212 loc) · 8.12 KB
/
runCriticalSpacing.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
% MATLAB script to run CriticalSpacing.m
% Copyright 2015,2016, Denis G. Pelli, [email protected]
% We recommend leaving the boilerplate header alone, and customizing by
% copying lines from the boilerplate to your customized section at the
% bottom and modifying it there. This facilitates comparison of scripts.
%% BOILERPLATE HEADER
clear o
% PROCEDURE
o.easyBoost=0.3; % Increase the log threshold parameter of easy trials by this much.
o.experimenter=''; % Put name here to skip the runtime question.
o.flipScreenHorizontally=0; % Set to 1 when using a mirror.
o.fractionEasyTrials=0;
o.observer=''; % Put name here to skip the runtime question.
o.permissionToChangeResolution=0; % Works for main screen only, due to Psychtoolbox bug.
% o.getAlphabetFromDisk=true; % true makes the program more portable.
o.secsBeforeSkipCausesGuess=8;
o.takeSnapshot=0; % To illustrate your talk or paper.
o.task='identify';
o.textFont='Arial';
o.textSizeDeg=0.4;
o.thresholdParameter='spacing'; % 'spacing' or 'size'
o.trialsDesired=20; % Number of trials (i.e. responses) for the threshold estimate.
o.viewingDistanceCm=400; % Default for runtime question.
% SOUND & FEEDBACK
o.beepNegativeFeedback=0;
o.beepPositiveFeedback=1;
o.showProgressBar=1;
o.speakEachLetter=1;
o.speakEncouragement=0;
o.speakViewingDistance=0;
o.usePurring=0;
o.useSpeech=1;
% VISUAL STIMULUS
o.durationSec=inf; % duration of display of target and flankers
o.eccentricityXYDeg=[0 0]; % Distance of target from fixation. Positive up and to right.
o.nearPointXYInUnitSquare=[0.5 0.5]; % Target location, re lower-left corner of screen.
% o.fixedSpacingOverSize=0; % Disconnect size & spacing.
o.fixedSpacingOverSize=1.4; % Requests size proportional to spacing, horizontally and vertically.
o.fourFlankers=0;
o.targetSizeIsHeight=nan; % "Size" is either height (1) or width (0).
o.minimumTargetPix=6; % Minimum viewing distance depends soley on this and pixPerCm.
% o.flankingDirection='tangential'; % vertically arranged flankers for single target
o.flankingDirection='radial'; % horizontally arranged flankers for single target
o.repeatedTargets=0; % Repeat targets for immunity to fixation errors.
o.maxFixationErrorXYDeg=[3 3]; % Repeat enough to cope with this.
o.practicePresentations=3;
o.setTargetHeightOverWidth=0; % Stretch font to achieve a particular aspect ratio.
o.spacingDeg=nan;
o.targetDeg=nan;
% TARGET FONT
% o.targetFont='Sloan';
% o.alphabet='DHKNORSVZ'; % Sloan alphabet, excluding C
% o.borderLetter='X';
% o.alphabet='HOTVX'; % alphabet of Cambridge Crowding Cards
% o.borderLetter='$';
o.targetFont='Pelli';
o.alphabet='123456789';
o.borderLetter='$';
% o.targetFont='ClearviewText';
% o.targetFont='Gotham Cond SSm XLight';
% o.targetFont='Gotham Cond SSm Light';
% o.targetFont='Gotham Cond SSm Medium';
% o.targetFont='Gotham Cond SSm Book';
% o.targetFont='Gotham Cond SSm Bold';
% o.targetFont='Gotham Cond SSm Black';
% o.targetFont='Arouet';
% o.targetFont='Pelli';
% o.targetFont='Retina Micro';
% FIXATION
o.isFixationBlankedNearTarget=0;
o.fixationMarkDeg=3; % 0, 3, and inf are a typical values.
o.fixationThicknessDeg=0.02;
o.markTargetLocation=0; % 1 to mark target location
o.useFixation=1;
% QUEST threshold estimation
o.beta=nan;
o.measureBeta=0;
o.pThreshold=nan;
o.tGuess=nan;
o.tGuessSd=nan;
o.useQuest=1; % true(1) or false(0)
% DEBUGGING AIDS
o.frameTheTarget=0;
o.printScreenResolution=0;
o.printSizeAndSpacing=0;
o.showAlphabet=0;
o.showBounds=0;
o.showLineOfLetters=0;
o.speakSizeAndSpacing=0;
% TO MEASURE BETA
% o.measureBeta=0;
% o.offsetToMeasureBeta=-0.4:0.1:0.2; % offset of t, i.e. log signal intensity
% o.trialsDesired=200;
% TO HELP CHILDREN
% o.fractionEasyTrials=0.2; % 0.2 adds 20% easy trials. 0 adds none.
% o.speakEncouragement=1; % 1 to say "good," "very good," or "nice" after every trial.
%% CUSTOM CODE
% RUN
if 0
% Sans Forgetica
o.targetFont='Sans Forgetica';
o.getAlphabetFromDisk=true;
o.alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZ';
o.borderLetter='$';
end
if 0
% Kuenstler
o.targetFont='Kuenstler Script LT Medium';
o.getAlphabetFromDisk=true;
o.alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZ';
o.borderLetter='$';
end
if 0
% Black Sabbath
o.targetFont='SabbathBlackRegular';
o.getAlphabetFromDisk=true;
o.alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZ';
o.borderLetter='$';
end
if 0
% Chinese from Qihan
o.targetFont='Songti TC Regular';
o.getAlphabetFromDisk=true;
% o.alphabet='????????????????????'; % Chinese from Qihan.
o.alphabet=[20687 30524 38590 33310 28982 23627 29245 27169 32032 21338 26222 ...
31661 28246 36891 24808 38065 22251 23500 39119 40517];
% o.borderLetter='?';
o.labelAnswers=true;
o.borderLetter=40517;
end
if 0
% Japanese: Katakan, Hiragani, and Kanji
% from Ayaka
o.targetFont='Hiragino Mincho ProN W3';
o.getAlphabetFromDisk=true;
japaneseScript='Kanji';
switch japaneseScript
case 'Katakana'
o.alphabet=[12450 12452 12454 12456 12458 12459 12461 12463 12465 12467 12469 ... % Katakana from Ayaka
12471 12473 12475 12477 12479 12481 12484 12486 12488 12490 12491 ... % Katakana from Ayaka
12492 12493 12494 12495 12498 12501 12408 12507 12510 12511 12512 ... % Katakana from Ayaka
12513 12514 12516 12518 12520 12521 12522 12523 12524 12525 12527 ... % Katakana from Ayaka
12530 12531]; % Katakana from Ayaka
case 'Hiragana'
o.alphabet=[12354 12362 12363 12365 12379 12383 12394 12395 12396 12397 12399 ... % Hiragana from Ayako
12405 12411 12414 12415 12416 12417 12420 12422 12434]; % Hiragana from Ayako
case 'Kanji'
o.alphabet=[25010 35009 33016 23041 22654 24149 36605 32302 21213 21127 35069 ... % Kanji from Ayaka
37806 32190 26286 37707 38525 34276 38360 38627 28187]; % Kanji from Ayaka
end
o.labelAnswers=true;
o.borderLetter='';
end
% o.useFractionOfScreenToDebug=0.3;
o.practicePresentations=0;
o.experimenter='Darshan';
o.observer='';
o.viewingDistanceCm=50;
o.eccentricityXYDeg=[10 0]; % Distance of target from fixation. Positive up and to right.
o.nearPointXYInUnitSquare=[0.7 0.5]; % location on screen. [0 0] lower right, [1 1] upper right.
o.durationSec=0.2; % duration of display of target and flankers
if 1
o.targetFont='Sloan';
% o.targetFont='Calibri';
o.alphabet='DHKNORSVZ'; % Sloan alphabet, excluding C
o.borderLetter='X';
o.getAlphabetFromDisk=false;
end
oo=o;
oo(2)=oo(1);
oo(2).eccentricityXYDeg=-oo(2).eccentricityXYDeg;
if 0
o.targetFont='Pelli Eye Chart';
o.alphabet='123456789';
o.borderLetter='$';
end
o.targetDeg=2;
o.repeatedTargets=0;
o.thresholdParameter='spacing';
% o(2)=o(1); % Copy the condition
% o=CriticalSpacing(o);
% o.thresholdParameter='size';
% o(2)=o(1); % Copy the condition
% o.getAlphabetFromDisk=false; % true makes the program more portable.
% Japanese
% o.targetFont='Hiragino Mincho ProN W3';
% o.alphabet=[26085 26412 35486 12391 12354 12426 12364 12392 12358 12372 12374 12356 12414 12375 12383 12290];
% o.labelAnswers=true;
% Chinese
% o.targetFont='Songti TC Light';
% o.labelAnswers=true;
% o.minimumTargetPix=16; % Complex fonts need more than the default 6 pix.
% Difficult Roman fonts
% o.targetFont='Kuenstler Script Bold';
% o.targetFont='SabbathBlackRegular';
% o.targetFont='SabbathBlack OT';
% o.labelAnswers=false;
% o.alphabet='ABCDEFGHIJKLMNOPQRSTUVWYZ';
% o.minimumTargetPix=16; % Complex fonts need more than the default 6 pix.
% o.targetFont='Sans Forgetica';
% o.minimumTargetPix=16; % Complex fonts need more than the default 6 pix.
% o.getAlphabetFromDisk=true; % true makes the program more portable.
% o.targetFont='Checkers';
% o.alphabet='abcdefghijklmnopqrstuvwxyz';
% o.borderLetter='';
o.setNearPointEccentricityTo='fixation';
o.nearPointXYInUnitSquare=[0.5 0.5]; % location on screen. [0 0] lower left, [1 1] upper right.
o.skipScreenCalibration=true; % Skip calibration to save time.
o.useFractionOfScreenToDebug=0.3;
oo=CriticalSpacing(oo);
% Results are printed in MATLAB's Command Window and saved in the
% CriticalSpacing/data/ folder.