Modelling of a Shack-Hartmann Sensor for eye aberration evaluation

Shack-Hartmann (SH) sensors are wavefront sensors. This article will look at the design of such a sensor to measure aberrations from the eye. Tools like the wavefront map and Physical Optics Propagation are used to analyze the results.

Authored By Pascale Parrein


Article Attachments


Shack-Hartmann sensors are widely used to measure aberrations issued from the eye either in research or for clinical purposes through the development of industrial devices.


The fundamental principles of such a device can be described as follows. A light beam is focused on the retina which is used as a light diffuser. Even though for safety reasons near infrared is preferably used for the measurement, the main part of the beam is absorbed by this complex media. The weak back reflected part of the light goes through the different elements of the eyes such as the vitreous humour and the lens of the anterior chamber and the aqueous humour and the cornea of the posterior chamber. Each one brings a contribution to the wavefront shape at the exit pupil of the eye.

The image below describes a Human Eye (


An optical system conjugates the eye pupil and the Shack-Hartmann sensor with a given magnification [Ref 1]. The picture below shows a Human Eye Aberration Measurement using a Shack-Hartmann.


The Shack-Hartmann sensor is made of a lenslet array, and an imaging sensor positioned at the focal length of the lenslets.  Each lenslet measures locally the wavefront deformation by evaluating the lateral focus displacement on the imaging sensor.

The Shack-Hartmann Principal is described in the image below (


This measure must be considered not as an absolute result but as a relative deformation to be compared with a reference wavefront, which is generally a plane wave. The whole wavefront is then reconstructed from the local results issued from each lenslet. Zernike polynomials are used to differentiate and quantify which kinds of aberration have been generated by the eye [Ref 2].             

The capabilities of such a system will be the results of a compromise between accuracy, sensitivity, and dynamic range. For example, large microlenses will increase the system sensitivity. But a large microlens also means that a local variation of the wavefront within the area of the large microlens is not detected. So, it means a loss of accuracy in the result.

To obtain a reliable reconstruction of the aberrated wavefront, modelling the system in OpticStudio is useful to dimension the elements and evaluate the system impact on the result. Indeed, the system modelling enables to evaluate the potential contribution of an additional wavefront deformation by the selected lenses and to possibility calibrate the system.

For the modelling, the system can be decomposed into three parts: the eye modelling, the collection optical system, and the Shack Hartmann sensor. The article will describe the modelling of each part as well as the analysis tools to evaluate the system performances.

In this article, the injection part dedicated to the focus into the retina will not be modelled. The main concern will be given to the collection system and the sensor.

Part 1: Eye modelling

Several sequential approaches have been proposed to model an eye which is such a complex arrangement. The one that has been used here is available in the knowledgebase article: How to model the human eye in OpticStudio.

The retina center is set as the object position (surface 0) and the stop is fixed at the eye pupil (surface 5) with a given diameter varying between 2 and 8mm depending on the external environment. 






One source of abnormal vision is related to the length of the vitreous humour in the posterior chamber. The Multi-Configuration Editor can be used to define and follow up the system properties depending on different cases of ametropia. 


Part 2: Collection Optical System

In the article, we will use the design shown in the publication of Liang. It describes two afocal systems [Ref 1].


The first telescope is set such as the focal length f1 is equal to the distance from the first lens to the eye pupil.

In the second telescope, the focal lengths f2 and f3 are chosen in such a way that there will be a suitable magnification to adjust the size of the Shack-Hartmann sensor with the range of pupil sizes to be inspected. In the middle of the second telescope a pinhole is positioned at the focal plane of the third lens to get rid of the back scattered light, especially the one issued from the cornea which is a strong impediment to the system. 

Between both telescopes there is a possibility of field mapping. The entrance pupil is conjugated with the Shack-Hartmann. In the System Explorer:

  • Under Aperture, Aperture is set to Float By Stop Size. The STOP surface is the eye pupil.
  • Under Aperture, Afocal Image Space setting is ticked since we are dealing with two afocal systems.
  • Under Ray Aiming, Ray Aiming is set to paraxial to fill more reliably the STOP especially in case of high aberrations. More information can be found about this option in the knowledgebase article How to use Ray Aiming.
  • Under Advanced, Reference OPD is set to Absolute. To compare the wavefront deformation at the eye pupil and in front of the Shack-Hartmann, the wavefront is evaluated against a plane surface in both cases.

  • Zemax settings for consistent Zernike Standard polynomials.

The design with real lenses is shown in the following Lens Data screen.




The different ametropia cases can be seen when visualizing all the configurations in one display.





Part 3: Shack-Hartmann Sensor

The Shack-Hartmann sensor is an array of lenses with a given curvature and pitch. The choice of the microlens data, namely the size, number and focal length have to be adapted to the required dynamic range for the system. The dynamic range is related to the maximum wavefront deformation that can be  measured. This is mainly due to the eye ametropia, and it occurs at the border of the pupil.

The Shack-Hartmann is modelled using a User-Defined Surface: us_array.dll. The pitch of 150µm is set in Parameters 3 and 4. The material, thickness, and radius of the lenslet are defined in the same way as for a standard surface. The imaging sensor, represented by the IMAGE plane of the system, is positioned at the back focal length of the lenslet. More information regarding the parameters of the us_array.dll can be found in the OpticStudio Help system.



Wavefront map analysis

A first analysis can be carried out by analyzing the wavefront at the entrance of the Shack-Hartmann (surface 22). The wavefront map shows the difference in waves between the wavefront and a plane wave at surface 22 for a normalized exit pupil. These data can be scaled with the exit pupil diameter in mm shown in the Wavefront Map ribbon and the wavelength used in the System Explorer. The Wavefront Map ribbon also displays the wavefront root mean square (RMS) value and peak to valley.




The wavefront map can then be fitted with Zernike Standard Polynomials to measure the aberrations.

The following table described the different aberrations associated with the Zernike polynomials and with the Zemax nomenclature. The Z4 term is mainly dependent of the eye ametropy and is usually the most important contribution to the wavefront deformation. This is the main change that will be observed in the Zernike parameters within the multiconfiguration framework of varying the length of the vitreous body . Astigmatism, coma and spherical aberration are more linked to eye posterior segment problems. The third order aberrations are usually of lower amplitude, but their impact is however important regarding the visual acuity especially in low light environment. 




Zernike Standard Polynomials (Zemax)



Z1:   1

Horizontal tilt


Z2:   \(\sqrt{4}\rho \cos(\theta)\)

Vertical tilt


Z3:  \(\sqrt{4}\rho \sin(\theta)\)



Z4:  \(\sqrt{3}(2\rho^{^{2}}-1)\)



Z5:  \(\sqrt{6}(\rho^{^{2}}\sin(2\theta))\)



Z6:  \(\sqrt{6}(\rho^{^{2}}\cos(2\theta))\)



Z7:  \(\sqrt{8}(3\rho^{^{3}}-2\rho)\sin(\theta)\)



Z8: \(\sqrt{8}(3\rho^{^{3}}-2\rho)\cos(\theta)\)



Z9:  \(\sqrt{8}\rho^{^{3}}\sin(3\theta)\)



Z10: \(\sqrt{8}\rho^{^{3}}\cos(3\theta)\)

Spherical aberration


Z11:  \(\sqrt{5}(6\rho^{^{4}}-6\rho^{^{2}}+1)\)


The following Zernike polynomials found for a normal eye just after the cornea can now be also read at surface 22 as shown below: 




At the cornea (surface 8):                                  After the lens (surface 22):



The Zernike parameters in front of the Shack-Hartmann are compared with the ones at the eye pupil to assess the reliability of the optical system in several cases of aberrations.  The Shack-Hartmann model proves that the device is properly dimensioned to evaluate the wavefront deformations caused by the eye.  

Geometric Image Simulation

The Geometric Image Analysis can be used to see the result on the Shack-Hartmann Sensor:




In this model, we start from a point source on the retina, but in reality, a laser lights up the retina that is largely scattering and absorbing. So, in this article, we will define the apodization as Gaussian.





The irradiance in the sensor plane can be seen in several ways in the display presented below. The displacement of each focus point from a reference position located in the axis of each microlens enables us to evaluate the local slope of the wavefront.  The whole data set in two dimensions can be recovered in the text file associated with the analysis. Algorithms can be then tested using this data set and their reliability can then be assessed. 




Physical Optics Propagation

To take into account the diffraction effects and not just the location of the spots, we can use the Physical Optic Propagation (POP) tool from the retina (Surface 1) to the imaging sensor surface (Image).

The parameters in the beam definition of POP are found by reading the object space numerical aperture under AnalyzeReportsPrescription Data




The object space numerical aperture is defined as : \(NA = n \cdot \sin(\theta) = 0.126\)

n = 1.34 is the optical index of the vitreous humour
So θ is equal to 5.4°. It is defined in POP as the Gaussian angle.




Please note that on Surface 24, the Output Pilot Radius is forced to Plane.




For more information, please see How to use POP with lenslet arrays.

As with the Geometric Image Analysis, the irradiance in the sensor plane can be seen.




Sequential modelling of the system with an appropriate use of the us_array.dll, the Geometric Image Analysis or the Physical Optic Propagation (POP) of Zemax enable to assess the optical system from the eye to the detector going through the different lenses of the system. The main tools available with Zemax that can be used to evaluate the system at each step of the conception have been presented as well as the important settings used to achieve a reliable system analysis.  


[Ref1]“Objective measurement of wave aberrations of the human eye with the use of a Hartmann-Shack wave-front sensor” Liang et al J. Opt. Soc. Am. A   Vol. 11, No. 7 p1949 July 1994.

[Ref2]“Normal-eye Zernike coefficients and root-mean-square wavefront errors ”  Salmon, van de Pol, J CATARACT REFRACT SURG - VOL 32, DECEMBER 2006

Was this article helpful?
13 out of 14 found this helpful



Article is closed for comments.