-
Notifications
You must be signed in to change notification settings - Fork 3
/
compute_eye_aberrations.m
49 lines (45 loc) · 1.59 KB
/
compute_eye_aberrations.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
function aberrations = compute_eye_aberrations( pd, ah, av, lambda, max_deg, nrays, eye_parameters, varargin )
% test eye
test_eye = EyeParametric( );
% set the eye parameters
for i = 1:length( eye_parameters )
pname = eye_parameters{ i, 1 };
pval = eye_parameters{ i, 2 };
% fprintf( '[%d]: %s: %f\n', i, pname, pval );
if isprop( test_eye, pname )
test_eye.( pname ) = pval;
end
end
% Setup the test eye
test_eye.PupilD = pd;
test_eye.Lambda = lambda;
test_eye.MakeElements( );
% compute the aberrations
aberrations = test_eye.ComputeAberrationsParametric( ...
pd, ah, av, lambda, ...
'MaxDegree', max_deg, ...
'NumRays', nrays, ...
'TraceVectors', 'chief', ...
'TraceVectorsEye', 'input', ...
'TraceVectorsRays', 50, ...
'TraceVectorsTol', 1e-6, ...
'IgnoreMissed', true, ...
'IgnoreBlocked', true, ...
'IgnoreTIR', true, ...
'GridShape', 'hexcircle', ...
'GridSpread', 'trace', ...
'GridFitPasses', 3, ...
'CaptureDistance', 1e-1, ...
'CaptureSize', 1e6, ...
'RadiusThreshold', 1.0, ...
'ProjectionMethod', 'parallel', ...
'CircumscribeRays', 'expected', ...
'CircumscribeShape', 'ellipse', ...
'CircumscribeExtension', 'mirror', ...
'EllipsePrecision', 2e-4, ...
'Centering', 'chief', ...
'Stretching', 'ellipse2circle', ...
'PupilRounding', 0.001, ...
'FitMethod', 'lsq', ...
varargin{:} );
end