Pupillography is a formal method of recording and measuring reactions of the pupil often by using an infrared video camera and using computer software to analyze the images (Video 1). The pupillary afferent pathway starts at the retina, travels through the optic nerve, then goes through the optic chiasm and optic tract to reach the pretectal nucleus, where it communicates anteriorly with the Edinger Westphal nucleus that is in charge of the efferent pupillary pathway (Figure 1). This pupil pathway (afferent and efferent) can be affected by a diverse set of stimuli including changes in retinal luminance, sudden changes in stimulus motion, and emotional and cognitive factors. Thus, pupillography is a useful tool for studying, identifying, and treating the underlying stimuli and causes of certain pupillary reactions. It is also useful for obtaining exact measurements of the pupil during preparation for certain ophthalmic procedures.     
Uses in Ophthalmology
Pupillography might be used to give an approximation of visual acuity in settings where patients cannot (e.g., nonverbal) or will not (e.g., nonorganic) provide the information using subjective assessments. While the classic pupillary light reflex is luminance-driven, a secondary reflex involving pupillary constriction to isoluminous stimuli (e.g. chromatic and achromatic gratings, coherent motion set) has also been documented. Both reflexes are mediated by the same retino-cortical pathway, the afferent arm of which is also involved in visual perception. However, the secondary reflex has a longer latency, and thus may have potential use as an objective indicator of visual acuity. In fact, it has already been shown to correlate with measurements of visual acuity but is currently limited to use in research settings due to the small amplitude of pupillary responses and the need for repeated measurements
Relative afferent pupillary defect (RAPD)
Pupillography also provides a standardized, quantifiable, and reproducible way of measuring the relative afferent pupillary defect (RAPD) compared to the conventional swinging flashlight test performed by a clinician. The RAPD is seen in many different ocular diseases that can affect the afferent pupillary pathway (e.g., diffuse retinopathy, optic neuropathy, optic tract lesions and pretectal lesions). In a patient with head trauma, the RAPD may be the only sign of traumatic optic nerve injury and pupillography might be useful to assess the afferent pupillary pathway in a comatose trauma patient. Pupillographic investigation of RAPD may also help assess for less common afferent pupillary pathway lesions in the midbrain and tectum (e.g., tectal RAPD).
Additionally, pupillography can be used to measure dilation lag, which refers to the delayed relaxation-dilation of the pupil when the light is withdrawn. Dilation lag is a characteristic feature of oculosympathetic denervation (i.e., the Horner's syndrome). The dilation of the pupil in the Horner's syndrome can take up to 15-20 seconds (i.e., dilation lag) compared to 5 seconds in normal individuals. Infrared light provides optimal visualization of the dilation dynamics, and pupillography can accurately measure the dilation speed and difference in dilation between the pupils. Pupillography may be the only reliable method of diagnosis for dilation lag in bilateral Horner's syndrome (where the relative anisocoria is obscured by bilaterality). 
Furthermore, pupillography can be an essential part of the refractive surgery evaluation and planning process. For refractive surgery, measuring the pupil size in low light conditions helps determine the most accurate ablation zone. If the ablation zone is smaller than the dilated pupil, then patients can develop halos that disrupt their nighttime vision. 
Pupil size measurement is also important during pre-operative evaluation of IOL placement, especially for premium IOLs. IOL selection is a complicated process that involves a variety of factors, including the patient's stated preferences about the level of vision he or she values most (e.g. distance, intermediate or near), occupation, lifestyle, and frequency of nighttime driving, and pupillography can help optimize this decision.     
Uses in Neuropsychiatry
Additionally, the measurement of pupil diameter in psychiatric disorders provides an estimate of the intensity of mental activity and changes in mental states. In fact, pupil dilation correlates with arousal so consistently that pupillometry has been used to investigate a wide range of neuropsychiatric phenomena. A tight correlation between the activity of the locus coeruleus and pupillary dilation has also been evidenced, further suggesting a link between mental activity and pupillary responses. Although cognitive and emotional events can affect pupil constriction and dilation, such events occur on a smaller scale than the light reflex, causing changes generally less than half a millimeter. By controlling for other factors that might affect pupil size, like brightness, color, and distance, scientists can use pupil movements as a proxy for other processes, like mental strain. These movements may prove to be sensitive indicators for neurodegenerative disease (e.g., Alzheimer's and Parkinson's disease), autism, or even opioid and alcohol abuse.       
Pupillography has also been used to assess other mental states (e.g., sleepiness, introversion, race bias, sexual interest, moral judgment, schizophrenia, and depression).      
Uses in Pharmacology
Pupillography has also been used to test and study the autonomic effects of certain drugs. For instance, pupillography can demonstrate whether a drug has cholinergic or adrenergic effects based on the reaction size of the pupil.  Pupillography can also be used to study sedative effects of drugs since sleepiness can be measured by the degree of spontaneous and involuntary fluctuations in pupil size. 
Measurement of the pupil size and function may be challenging secondary to the phenomenon of pupillary hippus or noise. The pupil is never entirely at rest but rather has normal, small continuous oscillations (±0.5mm). Therefore, when trying to measure the pupil, a single “snapshot” estimate is not a reliable predictor of the true mean size because the clinician might catch the pupil at the maximum or minimum. Consequently, most current pupillographic devices involve recording the pupil with a specialized infrared video camera, whose video frames are then transferred to a personalized computer that uses imaging processing software (discussed in the next section) to calculate pupil size in each individual frame. Commercially available devices differ significantly from each other because they are usually designed for a specific task. This means that some instruments are optimized for high spatial or temporal resolution, while others are optimized for stable, long-term recordings. There are also different systems for monocular (sampling frequency of 5-25 Hz) versus binocular (sampling frequency of 25-60 Hz) recording, as well as different levels of light stimulus.
Pattern Recognition and System Auto-Calibration
In order to track the size of the pupil, a segmentation algorithm can be used. The simplest of these is the well-known Hough Transform method (Figure 2). This method will work in many cases because the pupil is usually in the shape of a circle, but it will not provide proper accuracy in all conditions, such as when the pupil is misplaced or abnormally shaped. Pupil movements can also affect the accuracy of this method, as they can make the pupil appear more elliptical (rather than circular) from the fixed perspective of the camera. Therefore, the Hough Transform cannot alone provide the required accuracy.
More intelligent pattern recognition models can be used for higher accuracy. Although these models need training data and experts to train them, they can eventually adapt themselves to detect the desired item (such as the pupil) with very high accuracy regardless of its exact shape. Therefore, these models can accurately detect even misplaced or abnormally shaped pupils and their positions.To compensate for eye movement, we can multiply the measured pupil size by another scaling factor. Because the pupil is normally located in the center of the eye, we can easily determine the location of the pupil with respect to the camera. This allows us to calculate the appropriate scaling factor with mathematical expressions.
- Hakerem, G. & Sutton, S. Pupillary response at visual threshold. Nature 212, 485–486 (1966).
- Kardon, R. Pupillary light reflex. Curr Opin Ophthalmol 6, 20–26 (1995).
- Sahraie, A. & Barbur, J. L. Pupil response triggered by the onset of coherent motion. Graefe’s Arch. Clin. Exp. Ophthalmol. 235, 494–500 (1997).
- Goldwater, B. C. Psychological significance of pupillary movements. Psychol. Bull. 77, 340–355 (1972).
- Beatty, J. Task-evoked pupillary responses, processing load, and the structure of processing resources. Psychol. Bull. 91, 276–292 (1982).
- Girkin, C. A. Evaluation of the pupillary light response as an objective measure of visual function. Ophthalmol. Clin. North Am. 16, 143–153 (2003).
- Kawasaki, A., Miller, N. R. & Kardon, R. Pupillographic Investigation of the Relative Afferent Pupillary Defect Associated with a Midbrain Lesion. Ophthalmology 117, 175–179 (2010).
- Wilhelm, H. & Wilhelm, B. Clinical applications of pupillography. J. Neuro-Ophthalmology 23, 42–49 (2003).
- Smith, S. A. & Smith, S. E. Bilateral Horner’s syndrome: detection and occurrence. J. Neurol. Neurosurg. Psychiatry 66, 48–51 (1999).
- Boxer Wachler, B. S. & Krueger, R. R. Agreement and repeatability of pupillometry using videokeratography and infrared devices. J. Cataract Refract. Surg. 26, 35–40 (2000).
- Schnitzler, E. M., Baumeister, M. & Kohnen, T. Scotopic measurement of normal pupils: Colvard versus Video Vision Analyzer infrared pupillometer. J. Cataract Refract. Surg. 26, 859–866 (2000).
- Wang, M., Corpuz, C. C. C., Huseynova, T. & Tomita, M. Pupil Influence on the Visual Outcomes of a New-Generation Multifocal Toric Intraocular Lens With a Surface-Embedded Near Segment. J. Refract. Surg. 32, 90–95 (2016).
- Kim, M. J., Yoo, Y. S., Joo, C. K. & Yoon, G. Evaluation of optical performance of 4 aspheric toric intraocular lenses using an optical bench system: Influence of pupil size, decentration, and rotation. J. Cataract Refract. Surg. 41, 2274–2282 (2015).
- Vega, F. et al. Halo and through-focus performance of four diffractive multifocal intraocular lenses. Investig. Ophthalmol. Vis. Sci. 56, 3967–3975 (2015).
- García-Domene, M. C. et al. Image Quality Comparison of Two Multifocal IOLs: Influence of the Pupil. J. Refract. Surg. 31, 230–235 (2015).
- Fliedner, J., Heine, C., Bretthauer, G. & Wilhelm, H. The pupil can control an artificial lens intuitively. Investig. Ophthalmol. Vis. Sci. 55, 759–766 (2014).
- Watanabe, K. et al. Effect of Pupil Size on Uncorrected Visual Acuity in Pseudophakic Eyes With Astigmatism. J. Refract. Surg. 29, 25–30 (2013).
- 18 Fotiou, D. F. et al. Cholinergic deficiency in Alzheimer’s and Parkinson’s disease: Evaluation with pupillometry. Int. J. Psychophysiol. 73, 143–149 (2009).
- Stergiou, V. et al. Pupillometric findings in patients with Parkinson’s disease and cognitive disorder. Int. J. Psychophysiol. 72, 97–101 (2009).
- Fotiou, D. F. et al. Pupil reaction to light in Alzheimer’s disease: evaluation of pupil size changes and mobility. Aging Clin. Exp. Res. 19, 364–371 (2007).
- Fotiou, F., Fountoulakis, K. N., Tsolaki, M., Goulas, A. & Palikaras, A. Changes in pupil reaction to light in Alzheimer’s disease patients: A preliminary report. in International Journal of Psychophysiology 37, 111–120 (2000).
- Ghodse, H., Taylor, D., Greaves, J., Britten, A. & Lynch, D. The opiate addiction test: a clinical evaluation of a quick test for physical dependence on opiate drugs. Br. J. Clin. Pharmacol. 39, 257–259 (1995).
- Krach, S. et al. Evidence from pupillometry and fMRI indicates reduced neural response during vicarious social pain but not physical pain in autism. Hum. Brain Mapp. 36, 4730–4744 (2015).
- Nuske, H. J., Vivanti, G., Hudry, K. & Dissanayake, C. Pupillometry reveals reduced unconscious emotional reactivity in autism. Biol. Psychol. 101, 24–35 (2014).
- Blaser, E., Eglington, L., Carter, A. S. & Kaldy, Z. Pupillometry reveals a mechanism for the Autism Spectrum Disorder (ASD) advantage in visual tasks. Sci. Rep. 4, (2014).
- Merritt, S. L., Schnyders, H. C., Patel, M., Basner, R. C. & O’Neill, W. Pupil staging and EEG measurement of sleepiness. in International Journal of Psychophysiology 52, 97–112 (2004).
- Stelmack, R. M. & Mandelzys, N. Extraversion and Pupillary Response to Affective and Taboo Words. Psychophysiology 12, 536–540 (1975).
- Wu, E. X. W., Laeng, B. & Magnussen, S. Through the eyes of the own-race bias: Eye-tracking and pupillometry during face recognition. Soc. Neurosci. 7, 202–216 (2012).
- 29 Granholm, E. & Verney, S. P. Pupillary responses and attentional allocation problems on the backward masking task in schizophrenia. in International Journal of Psychophysiology 52, 37–51 (2004).
- Laeng, B. & Falkenberg, L. Women’s pupillary responses to sexually significant others during the hormonal cycle. Horm. Behav. 52, 520–530 (2007).
- Decety, J., Michalska, K. J. & Kinzler, K. D. The contribution of emotion and cognition to moral sensitivity: A neurodevelopmental study. Cereb. Cortex 22, 209–220 (2012).
- Sepeta, L. et al. Abnormal social reward processing in autism as indexed by pupillary responses to happy faces. J. Neurodev. Disord. 4, (2012).
- Phillips, M. A., Bitsios, P., Szabadi, E., & Bradshaw, C. M. Comparison of the antidepressants reboxetine, fluvoxamine and amitriptyline upon spontaneous pupillary fluctuations in healthy human volunteers. Psychopharmacology 149, 72-76 (2000).
- Nowak, W., Zarowska, A., Szul-Pietrzak, E. & Misiuk-Hojło, M. System and measurement method for binocular pupillometry to study pupil size variability. Biomed. Eng. Online 13, (2014).
- Espinosa, J., Roig, A. B., Pérez, J. & Mas, D. A high-resolution binocular video-oculography system : assessment of pupillary light reflex and detection of an early incomplete blink and an upward eye movement. 1–12 (2015). doi:10.1186/s12938-015-0016-6
- Chennamma, H. R. & Yuan, X. A Survey on Eye-Gaze Tracking Techniques. 4, 388–393 (2013).
- Obtained from Espinosa, J., Roig, A. B., Pérez, J. & Mas, D. A high-resolution binocular video-oculography system : assessment of pupillary light reflex and detection of an early incomplete blink and an upward eye movement. 1–12 (2015). doi:10.1186/s12938-015-0016-6 https://biomedical-engineering-online.biomedcentral.com/articles/10.1186/s12938-015-0016-6. Attribution 4.0 International (CC BY 4.0) https://creativecommons.org/licenses/by/4.0/