|
1 | | - |
2 | 1 | % Asano et al. give the following population SD's for the individual |
3 | 2 | % difference parameters (their Table 5, Step 2 numbers: |
4 | 3 | % Lens - 18.7% |
|
26 | 25 | SetGammaMethod(calStructOBJ,2); |
27 | 26 |
|
28 | 27 | % load the stim settings ans max contrasts for angles -10:.25:110 |
29 | | -load cacheStimSettingAsanoBoot2.mat |
| 28 | +load cacheStimSettingAsanoBoot.mat |
30 | 29 |
|
31 | 30 | %% Baseline fundamentals |
32 | 31 | S = [380 5 81]; |
|
40 | 39 | theAngles = 80:0.05:100; |
41 | 40 | nAsanoBoots = 10000; |
42 | 41 |
|
| 42 | +% init vars |
| 43 | +minLumAngle = zeros(1,nAsanoBoots); |
| 44 | +minLContrasts = zeros(1,nAsanoBoots); |
| 45 | +minLumContrasts = zeros(1,nAsanoBoots); |
| 46 | + |
43 | 47 | for aa = 1:nAsanoBoots |
44 | 48 |
|
45 | 49 | % Draw 8 parameters with standard deviations as in comment above |
|
69 | 73 | tmpConeParams.indDiffParams.dlens = drawLens; |
70 | 74 | tmpConeParams.indDiffParams.dmac = drawMacular; |
71 | 75 | tmpConeParams.fieldSizeDegrees = 2; |
72 | | - [~,T1] = ComputeObserverFundamentals(tmpConeParams,S_cones_ss2); |
73 | | - |
74 | | - |
75 | | - |
76 | | - % Loop around theta from, say -10 to 100 degrees at 1/4 deg steps |
77 | | - % For each theta, compute sqrt of L + M contrast. Maybe w*L + M. |
78 | | - % Find minimum. That's the theta closest to isolating S cones in |
79 | | - % our stimulus set. Call that theta0. Store theta0 for each |
80 | | - % iteration of this loop |
| 76 | + [~,T1] = ComputeObserverFundamentals(tmpConeParams,S_cones_ss2) |
81 | 77 |
|
82 | 78 | %% Standard initialization of calibration structure |
83 | 79 | SetSensorColorSpace(calStructOBJ,T1,S_cones_ss2); |
|
98 | 94 | 0 ,0,1]; |
99 | 95 |
|
100 | 96 | wContrasts = m*contrasts; |
101 | | - lumVec(aa,:) = vecnorm(wContrasts(1:2,:)); |
| 97 | + lumVec = vecnorm(wContrasts(1:2,:)); |
102 | 98 |
|
103 | | - minLumAngle(aa) = theAngles(find(lumVec(aa,:) == min(lumVec(aa,:)))); |
| 99 | + minLumAngle(aa) = theAngles(find(lumVec == min(lumVec))); |
| 100 | + minLContrasts(aa) = contrasts(2,find(lumVec == min(lumVec))); |
| 101 | + minLumContrasts(aa) = lumVec(find(lumVec == min(lumVec))); |
| 102 | + |
104 | 103 | end |
105 | 104 |
|
106 | | -%% Plot distribution of theta0's. We'll look at that. |
107 | | -h1 = histogram(minLumAngle,77) |
| 105 | +%% Plot distribution of theta's |
| 106 | +figure |
| 107 | +h1 = histogram(minLumAngle,77); |
108 | 108 | ylabel('Count') |
109 | 109 | xlabel('Angle in LS Plane') |
110 | 110 | title('Minimun Luminance Angle') |
111 | 111 | set(gcf,'Color','w'); |
112 | | - |
113 | | -%% Get error bars on stuff |
114 | | -ciPercent = 68; |
115 | | -upperCiVal = 100 - ((100 - ciPercent)/2); |
116 | | -lowerCiVal = ((100 - ciPercent)/2); |
117 | | -for pp = 1:size(lumVec,2) |
118 | | - errUpLwr(pp,:) = prctile(lumVec(:,pp),[upperCiVal lowerCiVal]); |
119 | | -end |
120 | | - |
121 | | - |
122 | | -%% Get nominal contrast |
123 | | -%Standard initialization of calibration structure |
124 | | -SetSensorColorSpace(calStructOBJ,T_cones_ss2,S_cones_ss2); |
125 | | - |
126 | | - |
127 | | -% Set the background |
128 | | -backgroundPrimaries = [0.50 0.5 0.50]'; %SensorToSettings(calStructOBJ,backgroundLMS); |
129 | | -backgroundLMS_hat = SettingsToSensor(calStructOBJ,PrimaryToSettings(calStructOBJ,backgroundPrimaries)); |
130 | | - |
131 | | -comparisonLMSnom = SettingsToSensor(calStructOBJ,stimSettings); |
132 | | - |
133 | | -backgroundLMSnom = repmat(backgroundLMS_hat,[1,size(comparisonLMS,2)]); |
134 | | - |
135 | | -nomContrast = ExcitationsToContrast(comparisonLMSnom,backgroundLMSnom); |
136 | | -w = 2; |
137 | | -m = [w,0,0;... |
138 | | - 0,1,0;... |
139 | | - 0,0,1]; |
140 | | - |
141 | | -wContrastsNom = m*nomContrast; |
142 | | -nominalLum = vecnorm(wContrastsNom); |
143 | | - |
144 | | - |
145 | | - |
146 | | - |
| 112 | +xlim([87 93]) |
| 113 | +set(gca, ... |
| 114 | + 'Box' , 'off' , ... |
| 115 | + 'TickDir' , 'out' , ... |
| 116 | + 'TickLength' , [.02 .02] , ... |
| 117 | + 'XMinorTick' , 'off' , ... |
| 118 | + 'YMinorTick' , 'off' , ... |
| 119 | + 'YGrid' , 'on' , ... |
| 120 | + 'XColor' , [.3 .3 .3], ... |
| 121 | + 'YColor' , [.3 .3 .3], ... |
| 122 | + 'LineWidth' , 1, ... |
| 123 | + 'FontSize' , 12); |
| 124 | +axis square |
| 125 | + |
| 126 | +figure |
| 127 | +h2 = histogram(minLContrasts,77); |
| 128 | +ylabel('Count') |
| 129 | +xlabel('L Cone Contrast') |
| 130 | +title('L Cone Contrast at Minimun Luminance Angle') |
| 131 | +set(gcf,'Color','w'); |
| 132 | +xlim([-0.06 0.06]) |
| 133 | +set(gca, ... |
| 134 | + 'Box' , 'off' , ... |
| 135 | + 'TickDir' , 'out' , ... |
| 136 | + 'TickLength' , [.02 .02] , ... |
| 137 | + 'XMinorTick' , 'off' , ... |
| 138 | + 'YMinorTick' , 'off' , ... |
| 139 | + 'YGrid' , 'on' , ... |
| 140 | + 'XColor' , [.3 .3 .3], ... |
| 141 | + 'YColor' , [.3 .3 .3], ... |
| 142 | + 'LineWidth' , 1, ... |
| 143 | + 'FontSize' , 12); |
| 144 | +axis square |
| 145 | + |
| 146 | +figure |
| 147 | +h1 = histogram(minLumContrasts,77); |
| 148 | +ylabel('Count') |
| 149 | +xlabel('Luminance Contrast') |
| 150 | +title('Luminance Contrast at Minimun Luminance Angle') |
| 151 | +set(gcf,'Color','w'); |
| 152 | +ylim([0 550]) |
| 153 | +set(gca, ... |
| 154 | + 'Box' , 'off' , ... |
| 155 | + 'TickDir' , 'out' , ... |
| 156 | + 'TickLength' , [.02 .02] , ... |
| 157 | + 'XMinorTick' , 'off' , ... |
| 158 | + 'YMinorTick' , 'off' , ... |
| 159 | + 'YGrid' , 'on' , ... |
| 160 | + 'XColor' , [.3 .3 .3], ... |
| 161 | + 'YColor' , [.3 .3 .3], ... |
| 162 | + 'LineWidth' , 1, ... |
| 163 | + 'FontSize' , 12); |
| 164 | +axis square |
0 commit comments