-
Notifications
You must be signed in to change notification settings - Fork 1
/
checkSize2Run.m
136 lines (131 loc) · 3.88 KB
/
checkSize2Run.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
%% 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='checkSize2';
o.eccentricityXYDeg=[0 0];
o.noiseSD=0.16;
o.pThreshold = 0.75;
o.noiseType= 'gaussian';
o.noiseCheckDeg=nan;
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 noise check size: Graph (E-E0)/N vs. checkDeg.
% Replicating result from Manoj
o.experiment='checkSize';
o.isTargetFullResolution=1;
o.eyes='both'; % 'left', 'right', 'both'.
sizes=o.targetGaborCycles/0.5; % 0.5 c/deg
o.targetGaborPhaseDeg=-90; % cosine phase
o.viewingDistanceCm=80; % viewing distance
o.noiseType= 'binary';
o.targetDurationSec = 0.1;
for size = sizes
o.eccentricityXYDeg=[0 0];
o.targetHeightDeg=size;
for duration=0.1 % [0.1 0.4]
o.targetDurationSec =duration;
for fine=0:1
o.isTargetFullResolution=fine;
for noiseSD = [0.2 0]
o.noiseSD=noiseSD;
if noiseSD>0
for n=[10 40 160 320]
o.noiseCheckDeg=o.targetHeightDeg/n;
if ~exist('oo','var')
oo=o;
else
oo(end+1)=o;
end
end
else
o.noiseCheckDeg=o.targetHeightDeg/10;
if ~exist('oo','var')
oo=o;
else
oo(end+1)=o;
end
end
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+0.03+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';
end
checkSize2Analyze;
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