Skip to content

Commit 367148f

Browse files
committed
2 parents ee474fd + 90040cb commit 367148f

File tree

8 files changed

+83
-50
lines changed

8 files changed

+83
-50
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
function vec = paramsToVecCombo(params)
2+
3+
%% The CTM Params
4+
x(1) = params.angle;
5+
x(2) = params.minAxisRatio;
6+
x(3) = params.scale;
7+
x(4) = params.minLag;
8+
x(5) = params.amplitude;
9+
10+
%% The Dectection Params
11+
x(6) = params.angle;
12+
x(7) = params.minAxisRatio;
13+
x(8) = params.lambda;
14+
x(9) = params.exponent;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
function params = vecToParamsCombo(vec)
164 KB
Binary file not shown.

tutorials/bootSConeMin.m renamed to code/analysis/coneBootstrap/bootSConeMin.m

Lines changed: 68 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
% Asano et al. give the following population SD's for the individual
32
% difference parameters (their Table 5, Step 2 numbers:
43
% Lens - 18.7%
@@ -26,7 +25,7 @@
2625
SetGammaMethod(calStructOBJ,2);
2726

2827
% load the stim settings ans max contrasts for angles -10:.25:110
29-
load cacheStimSettingAsanoBoot2.mat
28+
load cacheStimSettingAsanoBoot.mat
3029

3130
%% Baseline fundamentals
3231
S = [380 5 81];
@@ -40,6 +39,11 @@
4039
theAngles = 80:0.05:100;
4140
nAsanoBoots = 10000;
4241

42+
% init vars
43+
minLumAngle = zeros(1,nAsanoBoots);
44+
minLContrasts = zeros(1,nAsanoBoots);
45+
minLumContrasts = zeros(1,nAsanoBoots);
46+
4347
for aa = 1:nAsanoBoots
4448

4549
% Draw 8 parameters with standard deviations as in comment above
@@ -69,15 +73,7 @@
6973
tmpConeParams.indDiffParams.dlens = drawLens;
7074
tmpConeParams.indDiffParams.dmac = drawMacular;
7175
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)
8177

8278
%% Standard initialization of calibration structure
8379
SetSensorColorSpace(calStructOBJ,T1,S_cones_ss2);
@@ -98,49 +94,71 @@
9894
0 ,0,1];
9995

10096
wContrasts = m*contrasts;
101-
lumVec(aa,:) = vecnorm(wContrasts(1:2,:));
97+
lumVec = vecnorm(wContrasts(1:2,:));
10298

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+
104103
end
105104

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);
108108
ylabel('Count')
109109
xlabel('Angle in LS Plane')
110110
title('Minimun Luminance Angle')
111111
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

tutorials/asanoBootOutput.mat

-28.7 MB
Binary file not shown.

0 commit comments

Comments
 (0)