loading...
running...
How to use
Choose a preset, then move the sliders. The wavefront map (red = the wave lags, blue = leads) is what the eye produces; the green dots are where each lenslet focuses its part of it. Try: (1) Myopia: all spots move towards the centre in proportion to their distance (pure defocus), and the refraction readout shows about -3 D; (2) lengthen the lenslet focal length until spots turn red: they have crossed into a neighbour and the reconstruction fails; (3) Keratoconus with Spectacles selected: the sphere and cylinder vanish but the coma remains and the letter stays smeared; switch to Adaptive optics to see the perfect image; (4) increase the pupil diameter and watch the RMS and the blur grow; (5) raise the centroid noise and compare the recovered bars with the true ones. Space pauses, R resets.
The 3D page lays the measurement out in space: the eye on the left emits the wavefront (the coloured surface, with its height exaggerated by the slider), the lenslet array focuses each patch onto the sensor on the right, and the lines show how far each spot moves from its reference. The iris opening follows the pupil slider. The aberrometer body, chin rest, eye, lenslet frame and monitor are Blender 5.2 models with baked PBR textures. Drag to orbit, wheel to zoom.
The science
What this lab shows. How an aberrometer measures the optical imperfections of a human eye. Light from a point on the retina leaves the eye as a wavefront; for a perfect eye it is flat, for a real one it is warped. A Shack-Hartmann sensor places an array of tiny lenses in the pupil plane: each lenslet focuses its patch of the wavefront to a spot, and the spot is displaced from its reference position in proportion to the local tilt of the wavefront. From all the displacements the whole wavefront, the refraction and the quality of the retinal image can be reconstructed.
1. Zernike modes. The wavefront error W(x, y) over the pupil (unit disc) is expanded in orthonormal Zernike polynomials (OSA/ANSI numbering):
W(x, y) = Σ cnm Znm(x, y), RMS = √(Σ c2)
Because the modes are orthonormal over the disc (checked numerically), the RMS error is simply the root-sum-square of the coefficients. The page uses defocus Z(2,0), two astigmatisms, two comas, two trefoils and primary spherical aberration Z(4,0); piston and tilt are not aberrations of the image and are removed. Coefficients scale with pupil diameter D roughly as (D/D0)n, with n the radial order, so higher-order errors grow quickly in the dark.
2. Lenslet shifts. A lenslet of focal length f measures the average slope of the wavefront over its sub-aperture. With W in micrometres and the pupil coordinate in millimetres the slope is in mrad and the spot moves
Δx = f ∂W/∂x, Δy = f ∂W/∂y
(an f of 8 mm and a slope of 5 mrad give 40 µm). The gradient of each Zernike mode is analytic and is averaged over a 4 x 4 grid inside each sub-aperture. If the shift exceeds half of the lenslet pitch the spot crosses into its neighbour's area and the measurement breaks down: this is the dynamic range limit, 2×(pitch/2)/f. A larger f is more sensitive (smaller slope noise = centroid noise / f) but has a smaller range: that trade-off is the main design choice of the sensor.
3. Reconstruction. The coefficients are recovered by modal least squares: stack the measured slopes of all lenslets inside the pupil into a vector s and solve (ATA) c = ATs, where the columns of A are the mode gradients at the lenslets. Gaussian centroid noise is added to the shifts, so the recovered bars in the first graph scatter around the true ones; with zero noise they coincide.
4. Refraction. The spherical equivalent and the two cylinder components follow from the second-order coefficients and the pupil radius R (mm):
M = -4 √3 c20 / R2, J0 = -2 √6 c22 / R2, J45 = -2 √6 c2-2 / R2
in dioptres when c is in micrometres. The cylinder is C = -2√(J02 + J452), the sphere S = M - C/2 and the axis α = ½ atan2(J45, J0). Spectacles remove only these three terms; coma, trefoil and spherical aberration remain, which is why a keratoconic eye is not fully corrected by glasses and why an adaptive-optics mirror (which cancels everything) is shown as a third option.
5. Image quality. The pupil function P = exp(i 2π W / λ) inside the pupil (λ = 0.555 µm) is Fourier transformed (256 x 256 FFT, 0.1 mm per pixel) and squared to give the point-spread function. The Strehl ratio is its peak relative to the diffraction-limited peak. For small errors it agrees with the Marechal approximation S = exp(-(2πσ/λ)2) (checked). The retinal image is a 3 arcminute letter E (a 20/20 letter is 5 arcmin) convolved with the PSF.
Checks (run in the page). (1) Zernike orthonormality (max deviation over the 8 modes); (2) analytic gradients against finite differences; (3) for pure defocus the spot shift over (f x) equals the refraction in dioptres at every lenslet; (4) noise-free reconstruction recovers all coefficients; (5) the sampled RMS equals the root-sum-square of the coefficients; (6) Strehl from the FFT against the Marechal formula; (7) an aberration-free pupil has Strehl 1; (8) M = 4√3|c|/R2.
Simplifications. Monochromatic light, no chromatic aberration, no scatter and no Stiles-Crawford apodisation (a real retina is less sensitive to light entering at the pupil edge); coefficient scaling with pupil size is a rule of thumb and ignores the actual shape of the cornea and lens; the lenslet spot is treated as a point whose centroid is perturbed by Gaussian noise, with no spot blur, cross-talk or sensor pixelation; the PSF is the in-focus monochromatic PSF without eye movement, drawn on a 4.8 arcminute window: when the wavefront slope anywhere exceeds 4.5 mrad (roughly 1.5 D of defocus at a 6 mm pupil) the blur is far larger than the window and the FFT grid would alias, so the PSF and letter are then drawn with sphere and cylinder removed (the readout lists the true geometric blur circle). The numbers are for teaching and are not a clinical measurement.