function AF = agefact(age, D) %agefact(age) Calculates Ijspeert's age factor (AF) given age in years % and doubling age (D). If not specified D is set at the default 70 years, % based on Ijspeert's equations. % function B1 = B1calc (p, AF) %B1calc(p, AF) Calculates B1, an essential constant in determining how % the pointspread function is effected by pupil size. Input variables % are as follows: % %p = pupil size in mm %AF = age factor (calculated with agefact) % %Output value is in c/rad^-1 %B2calc(p, AF) Calculates B2, an essential constant in determining how % the pointspread function is effected by pupil size. Input variables % are as follows: % %p = pupil size in mm %AF = age factor (calculated with agefact) % %Output value is in c/rad^-1 function B3 = B3calc(AF, m) %B3calc(AF, m) Calculates B3, an essential constant in determining how % the pointspread function is effected by eye pigmentation. Input variables % are as follows: % %AF = age factor (calculated with agefact) %m = pigmentation factor. % %Note that this function can be used with the pigment function to obtain a %default m value. %Usage: B3calc(AF, pigment); % %(From Ijspeert, et al. 1992.) function b = bcalc(AF) %bcalc(AF) calculates a constant used in determining the B1 and B2 variables. % %AF = agefactor = agefact(age) (age in years) % %From Ijspeert, 1992. % %SEE: B1calc, B2calc, agefact. function c1 = c1calc(AF, p, m) %c1calc(AF, p, m) Calculates c1, a value used in the calculation %of the pointspread function (PSF) and the modulation transfer function (MTF). %C1 aids in the modeling of the PSF and MTF dependence on pupil size. % %AF = age factor %p = pupil size in mm %m = pigmentation parameter % %Based on the modelings of Ijspeert et al, 1992. % %SEE: c2calc, cshort function c2 = c2calc(AF, p, m) %c2calc(AF, p, m) Calculates c2, a value used in the calculation %of the pointspread function (PSF) and the modulation transfer function (MTF). %C2 aids in the modeling of the PSF and MTF dependence on pupil size. % %AF = age factor %p = pupil size in mm %m = pigmentation parameter % %Based on the modelings of Ijspeert et al, 1992. % %SEE: c1calc, cshort function c3 = c3calc(AF, m) %c3calc(AF, m) Calculates c3, a value used in the calculation %of the pointspread function (PSF) and the modulation transfer function (MTF). %C3 aids in the modeling of the PSF and MTF dependence on pigmentation. % %AF = age factor %m = pigmentation parameter % %Based on the modelings of Ijspeert et al, 1992. % %SEE: c4calc, clong, agefact function c4 = c4calc(AF, m) %c4calc(AF, m) Calculates c4, a value used in the calculation %of the pointspread function (PSF) and the modulation transfer function (MTF). %C4 aids in the modeling of the PSF and MTF dependence on pigmentation. % %AF = age factor %m = pigmentation parameter % %Based on the modelings of Ijspeert et al, 1992. % %SEE: c3calc, clong, agefact function cla = clong(AF, m) %clong(AF, m) Determines c for the long angle factors % %AF = age factor = agefact(age) %m = pigmentation parameter (see pigment) % %Based on Ijspeert, et al. 1992. % %SEE: c3calc, c4calc, cshort function csa = cshort(AF, m) %cshort(AF, m) Determines c for the short angle factors % %AF = age factor = agefact(age) %m = pigmentation parameter (see pigment) % %Based on Ijspeert, et al. 1992. % %SEE: c1calc, c2calc, clong function rad = deg2rad(deg) %deg2rad(deg) converts degrees to radians %Input variable: %deg = degree value function e = ecalc(AF) %ecalc(AF) calculates a constant used in determining the B1 and B2 variables. % %AF = agefactor = agefact(age) (age in years) % %From Ijspeert, 1992. % %SEE: B1calc, B2calc, agefact function Fbi = funBi(i, phi, p, AF, m) %funBi(i, phi, p, AF, m) calculates Fbi for the PSFip calculations % % %Input variables: %i = which out of four B to use %phi = angle (degrees) %p = pupil diameter (mm) %AF = age factor = agefact(age) %m = pigmentation parameter % %SEE PSFip, B1calc, B2calc, B3calc, B4calc % %lbi(i, phi, p, AF, m) Intermediate value in the calculation of the Linespread % function. % function LSF = LSFip(phi, age, p, m) %LSFip(phi, age, p, m) Calculates the linespread function (LSF) based on the % equations espoused by Ijspeert et al. The user must specify the angle, % phi, in degrees. All other values are optional, and will be set at the % following defaults if not specified: % % age = age of subject in years Default age = 0 years % p = pupil diameter in mm Default value = 4 mm. % m = pigmentation parameter Default = call to pigment function % function Mb = Mbcalc(i, q, AF, p, m) %Mbcalc(i, q, p, AF, m) Calculates Mb, an intermediate in the calculation of % the Modulation transfer function. Modeling based on Ijspeert, 1992. % However, this function can be used independently of the MTFip function. % %SEE: MTFip function MTFgraph(maxfreq, age, p) %MTFgraph(maxfreq, age, p) Graphs a series of MTF functions in order to compare %them % function MTF = MTFip(q, p, age, m) % MTF = MTFip(q, p, age, m) Calculates the modulation transfer function (MTF) % based on data from Ijspeert et al. 1992. All input variables are optional % except for q % %Input variables: % q = frequency in c/deg % p = pupil diameter in mm Default = 4 mm % age = age in years Default = 0 years % m = pigmentation parameter Default = call to pigment function % %SEE rad2deg, deg2rad function m = pigment %pigment sets the pigmentation parameter (m) equal to one of the four % default values, based on mean pigmentations of different groups. The % groups are as follows: % % Caucasian mean. m = 0.142 % mean blue-eyed Caucasian m = 0.160 % mean brown-eyed Caucasian m = 0.106 % mean pigmented-skin dark brown eye m = 0.056 % % Values are from Ijspeert et al, 1992. %PSFip(phi, age, p, m) Calculates the pointspread function (PSF) based on the % equations espoused by Ijspeert et al. The user must specify the angle, % phi, in degrees. All other values are optional, and will be set at the % following defaults if not specified: % % age = age of subject in years Default age = 0 years % p = pupil diameter in mm Default value = 4 mm. % m = pigmentation parameter Default = call to pigment function function PSF = PSFsimp(phi, age) %PSFsimp A simplified calculation based on the point spread function %(PSF) calculations of Ijspeert, 1992. % phi is in degrees % pupil = 4 mm % m = 0.142 % Default age is 0 years function deg = rad2deg(rad) %rad2deg(rad) converts radians to degrees %Input Variable: %rad = radian value