In Lectures 8 and 9, we established the Optical Transfer Function (OTF) framework for understanding microscope resolution. The OTF connects the pupil function \(P(\mathbf{k})\) to image contrast through the autocorrelation: \[\text{OTF}(\mathbf{k}) = \frac{\mathcal{F}\{|\text{PSF}|^2\}(\mathbf{k})}{\text{OTF}(0)}\]
In those lectures, we assumed an ideal, aberration-free pupil. Real microscopes are not so fortunate: a cover slip of wrong thickness causes spherical aberration; misalignment introduces coma; high-NA systems suffer field curvature. All of these distortions modify the pupil function—and hence degrade the OTF and resolution.
Learning objectives:
Understand how confocal microscopy improves the OTF by combining illumination and detection in Fourier space
Recognize that aberrations are pupil-plane defects: real \(P(\rho) = A(\rho) \exp(i W(\rho))\) where \(W\) is wavefront error
Use Zernike polynomials to decompose and visualize aberrations on circular apertures
Learn wavefront sensing (Shack-Hartmann) as a measurement tool
Apply adaptive optics to correct aberrations and recover diffraction-limited performance
Connect all concepts to practical tools used in the MoNa lab: SLMs, AOMs, and deformable mirrors
1. Confocal Microscopy Revisited: The OTF Perspective
Beyond Widefield: Confocal Fluorescence Detection
In Lecture 9, we briefly introduced confocal microscopy. Recall the setup: - Illumination: Focused laser beam (illumination PSF: \(\text{PSF}_\text{ill}\)) - Detection: Fluorescence collected through a pinhole (detection PSF: \(\text{PSF}_\text{det}\)) - Effective PSF: Product of the two: \(\text{PSF}_\text{conf} = \text{PSF}_\text{ill} \times \text{PSF}_\text{det}\)
Confocal PSF in Real Space
The key insight is that the confocal PSF is narrower than widefield. For a pinhole diameter comparable to the Airy disk, the axial FWHM narrows by ~40 %, and lateral resolution improves by ~1.4×.
What this means: - Each OTF independently is real and non-negative (pupil is real and positive) - Their convolution is the product of autocorrelations - The result: higher contrast at high spatial frequencies - Missing cone is filled: the axial frequencies that widefield cannot capture are recovered by confocal detection
This is the essence of confocal’s advantage: it exploits the fact that illumination and detection can be independently controlled in Fourier space.
Pinhole as Spatial Frequency Filter
The pinhole diameter directly controls the width of \(\text{OTF}_\text{det}\): - Large pinhole → broad \(\text{OTF}_\text{det}\) → approaches widefield behavior - Small pinhole (≪ Airy disk) → narrow \(\text{OTF}_\text{det}\) → strong rejection of out-of-focus light, but signal loss - Optimal pinhole (~0.5–1.0 Airy unit): best trade-off between contrast and signal
Fast Beam Scanning: AOMs and Mirrors
To build a practical confocal microscope, the illumination beam must scan the specimen in \(x\), \(y\), and \(z\). Two approaches dominate:
Acousto-Optic Modulators (AOMs): - Diffract a laser beam using an acoustic wave traveling through a crystal - Frequency shift: \(\nu_\text{out} = \nu_\text{in} \pm \nu_\text{acoustic}\) - Beam deflection angle proportional to acoustic frequency (tunable) - Speed: microsecond switching, MHz modulation bandwidth - Application in MoNa: Fast beam steering, modulation, and raster scanning - Advantage: no moving parts, electrically controlled
Galvanometric Mirrors (Galvos): - Electromagnetically controlled mirrors for \(x\) and \(y\) beam deflection - Speed: kHz scanning rates for video-rate imaging - Common in commercial confocal systems
Both tools exploit the pupil plane (back aperture of the objective): modulating the beam’s angle there directly translates to lateral scan position at the specimen plane.
2. Aberrations and the Pupil Function
The General Pupil Function
We now recognize that the pupil function is not always ideal. The general form is: \[P(\rho, \theta) = A(\rho) \, e^{i W(\rho, \theta)}\]
where: - \(A(\rho)\) is the aperture function (amplitude; typically = 1 inside the pupil, 0 outside) - \(W(\rho, \theta)\) is the wavefront error (in units of length, or often in units of wavelength) - \((\rho, \theta)\) are polar coordinates in the pupil plane
Physical sources of wavefront error: 1. Cover slip mismatch: Incorrect cover slip thickness introduces spherical aberration 2. Refractive index mismatch: Specimen immersion medium differs from design medium (water vs. oil) 3. Misalignment: Objective not perpendicular to specimen plane → coma 4. Field curvature: Aberration increases toward the edge of the field 5. Lens defects: Manufacturing imperfections in optical coatings or surfaces
Key observation: Even small wavefront errors reduce the contrast of the OTF, especially at high spatial frequencies. The effect is multiplicative: if \(W \ll 1\) rad, the OTF scales approximately as: \[\text{OTF}_\text{aberr} \approx \text{OTF}_\text{ideal} \cdot \exp(-\sigma_W^2 / 2)\]
where \(\sigma_W^2 = \langle W^2 \rangle\) is the variance of the wavefront error.
The Strehl Ratio: A Quantitative Measure
The Strehl ratio\(S\) measures the reduction in peak intensity of the PSF due to aberrations: \[S = \frac{\max(\text{PSF}_\text{aberr})}{\max(\text{PSF}_\text{ideal})} = \left| \langle e^{i W} \rangle \right|^2\]
where the angle brackets denote averaging over the pupil.
For small aberrations (Maréchal approximation): \[S \approx e^{-\sigma_W^2} \approx 1 - \sigma_W^2\]
Rule of thumb: - \(S > 0.8\) (good): system diffraction-limited - \(S = 0.5\)–0.8: noticeable degradation - \(S < 0.5\): severe, visible loss of resolution
Wavelength dependence: Aberrations are always expressed relative to \(\lambda\). A fixed defocus (e.g., 1 μm) is worse for shorter wavelengths (where it corresponds to more wavelengths) and negligible for longer wavelengths.
Example: Spherical Aberration from Cover Slip Mismatch
A typical case: specimen imaged through a 170 μm cover slip with water immersion (\(n = 1.33\)), but objective designed for oil (\(n = 1.515\)).
The aberration magnitude is roughly: \[W_\text{sph} \sim (n_\text{oil} - n_\text{water}) \cdot t / \text{NA}^2\]
where \(t\) is the mismatch. For \(\Delta n \sim 0.2\), \(t \sim 10\) μm, \(\text{NA} = 1.4\): \[W_\text{sph} \sim 1 \text{ μm} \sim 3 \text{ wavelengths at } 488 \text{ nm}\]
This causes a dramatic loss of contrast and axial resolution—a major problem in deep-tissue imaging.
3. Zernike Polynomials: The Natural Pupil-Plane Basis
Why Zernike?
Circular apertures (objectives) naturally admit an orthonormal basis of functions: the Zernike polynomials. These are defined on the unit disk and indexed by two integers: - \(n\) = radial order (polynomial degree) - \(m\) = azimuthal order (angular frequency)
This makes them ideal for decomposing any wavefront error on a circular pupil: \[W(\rho, \theta) = \sum_{n,m} c_{n,m} \, Z_n^m(\rho, \theta)\]
The coefficients \(c_{n,m}\) directly represent the “strength” of each aberration mode.
Low-Order Zernike Modes and Physical Meaning
The first 15 Zernike modes are shown below with their conventional names (using Noll indexing):
Mode
\(n\)
\(m\)
Name
Physical Meaning
1
0
0
Piston
Uniform phase shift (no effect)
2–3
1
±1
Tip/Tilt
Linear phase; equivalent to beam pointing error
4
2
0
Defocus
Quadratic wavefront; changes focal plane
5–6
2
±2
Astigmatism
Cylindrical lens effect; different focus in \(x\), \(y\)
7–8
3
±1
Coma
Asymmetric aberration from misalignment
9–10
3
±3
Trefoil
Three-fold asymmetry
11
4
0
Spherical Aberration
Paraxial and marginal rays focus differently
12–13
4
±2
Secondary Astigmatism
Higher-order version of astigmatism
14–15
4
±4
Quatrefoil
Four-fold asymmetry
Physical importance: - Piston (mode 1): Just a global phase shift; doesn’t affect intensity (image-forming modes start at 2) - Tip/Tilt (modes 2–3): Beam walk; can be corrected by an AOM - Defocus (mode 4): Most common aberration; easily corrected by z-stage adjustment - Astigmatism (modes 5–6): Common in high-NA systems; requires SLM or deformable mirror to correct - Coma (modes 7–8): Signature of misalignment; usually fixed mechanically - Spherical aberration (mode 11): Depth-dependent; increases with depth in scattering tissue; adaptive optics gold standard target
4. Zernike Visualization and Aberration Impact
Code
fig, axes = plt.subplots(3, 5, figsize=get_size(15, 9))axes = axes.flatten()# Noll indexing: map linear index to (n, m)noll_modes = [ (0, 0), # 1: piston (1, -1), # 2: tip (1, 1), # 3: tilt (2, 0), # 4: defocus (2, -2), # 5: astigmatism (2, 2), # 6: astigmatism (3, -1), # 7: coma (3, 1), # 8: coma (3, -3), # 9: trefoil (3, 3), # 10: trefoil (4, 0), # 11: spherical (4, -2), # 12: secondary astigmatism (4, 2), # 13: secondary astigmatism (4, -4), # 14: quatrefoil (4, 4), # 15: quatrefoil]names = ['Piston', 'Tip', 'Tilt', 'Defocus', 'Astig. x', 'Astig. y','Coma x', 'Coma y', 'Trefoil x', 'Trefoil y', 'Sph. Aber.','Sec. Astig. x', 'Sec. Astig. y', 'Quatrefoil x', 'Quatrefoil y']# Radial Zernike polynomials (standard definition)def zernike_radial(n, m, rho):"""Radial part of Zernike polynomial"""if (n - m) %2!=0:return np.zeros_like(rho) result = np.zeros_like(rho, dtype=float)for k inrange((n - m) //2+1): coeff = ((-1)**k * math.factorial(n - k) / (math.factorial(k) * math.factorial((n + m) //2- k) * math.factorial((n - m) //2- k))) result += coeff * rho**(n -2*k)return resultdef zernike_mode(n, m, rho, theta):"""Full Zernike polynomial Z_n^m""" rad = zernike_radial(n, abs(m), rho)if m <0:return rad * np.sin(abs(m) * theta)elif m >0:return rad * np.cos(m * theta)else:return rad# Generate gridrho_grid = np.linspace(0, 1, 200)theta_grid = np.linspace(0, 2*np.pi, 200)Rho, Theta = np.meshgrid(rho_grid, theta_grid)for idx, ((n, m), name) inenumerate(zip(noll_modes, names)): ax = axes[idx]# Compute Zernike mode Z = zernike_mode(n, m, Rho, Theta)# Mask outside unit circle mask = Rho <=1 Z[~mask] =0# Plot im = ax.contourf(Theta, Rho, Z, levels=20, cmap='RdBu_r', vmin=-1, vmax=1) circle = plt.Circle((np.pi, 0), 1, fill=False, edgecolor='black', linewidth=1) ax.add_patch(circle) ax.set_xlim(0, 2*np.pi) ax.set_ylim(0, 1.1) ax.set_aspect('equal') ax.set_title(f'{idx+1}: {name}', fontsize=9) ax.set_xticks([]) ax.set_yticks([])plt.tight_layout()plt.savefig('img/zernike_modes.png', dpi=150, bbox_inches='tight')plt.show()print("✓ Zernike polynomial modes visualized")
Figure 5.1— Zernike polynomial modes (first 15, Noll indexing). Each panel shows the phase pattern \(Z_n^m(\rho, \theta)\) on the unit disk. Colors represent phase from \(-\pi\) (blue) to \(+\pi\) (red). Modes 2–3 (tip/tilt) are linear; mode 4 (defocus) is parabolic; mode 11 (spherical aberration) is quartic.
✓ Zernike polynomial modes visualized
5. Impact of Aberrations on PSF and OTF
To understand how aberrations degrade imaging performance, we now visualize the effect on PSF and OTF for realistic aberration magnitudes.
Figure 6.1— Effect of aberrations on PSF and OTF. Top row: pupil phase (hsv colormap, units of \(\lambda\)) for ideal (aberration-free), spherical aberration (~2 wavelengths), and coma (~1.5 wavelengths). Middle row: corresponding point-spread functions (lateral cross-section). Bottom row: magnitude of the OTF (frequency response), showing degradation of contrast at high spatial frequencies.
✓ Aberration impact on PSF and OTF visualized
Strehl ratio relationship: good (>0.8), acceptable (0.5-0.8), poor (<0.5)
6. Wavefront Sensing: The Shack-Hartmann Sensor
To correct aberrations, we must first measure them. The most common wavefront sensing technique is the Shack-Hartmann sensor.
Principle: From Wavefront Slope to Phase
A Shack-Hartmann sensor comprises a microlens array (typically 10×10 to 40×40 lenslets) placed at the pupil plane, with a detector at the focal plane.
Key insight: Each lenslet measures the local slope of the wavefront: \[\frac{\partial W}{\partial x} \bigg|_{(\rho,\theta)} = \text{slope in } x \text{ direction}\]
The centroid shift of the focused spot from each lenslet is proportional to the local slope. By measuring all lenslet spots, we reconstruct the 2D slope field: \[\nabla W = \left( \frac{\partial W}{\partial x}, \frac{\partial W}{\partial y} \right)\]
Then we integrate to recover the phase \(W(\mathbf{r})\).
Fourier-Space Perspective: Connection to Slope and Frequency
In Fourier space, taking a spatial derivative is equivalent to multiplication by \(i \mathbf{k}\): \[\mathcal{F}\left\{ \frac{\partial W}{\partial x} \right\}(\mathbf{k}) = i k_x \, \widetilde{W}(\mathbf{k})\]
The Shack-Hartmann measurement is thus a high-pass filter on the phase: it emphasizes high-frequency ripples and is blind to low-frequency (piston, tip, tilt) modes.
This is identical to the mathematical principle of Differential Interference Contrast (DIC) microscopy, where a pair of orthogonal Wollaston prisms create an interference between light that is spatially shifted by ~\(\lambda/2\). Both techniques exploit spatial derivatives in the Fourier domain.
Reconstruction Algorithm
Once slopes are measured: 1. Compute \(\nabla W\) at all lenslet positions (from spot centroid displacements) 2. Reconstruct \(W(\mathbf{r})\) by least-squares integration (Zonal method): \[W(\mathbf{r}) = \arg \min \sum_{\text{grid points}} \left| \nabla W_\text{meas}(\mathbf{r}) - \nabla W_\text{recon}(\mathbf{r}) \right|^2\] 3. Decompose into Zernike modes to identify which aberrations are present 4. Send correction signal to deformable mirror or SLM
7. Adaptive Optics for Microscopy
Wavefront Correction Devices
Once aberrations are measured, we correct them by modulating the wavefront. Two complementary approaches:
Spatial Light Modulators (SLMs)
Liquid-Crystal SLMs apply a spatially varying phase shift to the incident beam: \[\Delta \phi(\mathbf{r}) = \frac{2\pi \Delta n(\mathbf{r}) \, d}{\lambda}\]
where \(\Delta n\) is the liquid-crystal birefringence (controlled electrically, 0–1 V) and \(d\) is the cell thickness.
Advantages: - Arbitrary phase patterns (Zernike modes, holograms, custom aberration correction) - Reconfigurable in real time (frame rate: 60–1000 Hz) - Compact; can be placed at pupil plane or in Fourier plane
MoNa lab connection: SLMs are used for: - Beam shaping: Creating flat-top or Bessel beams - Holographic optical trapping: Generating multiple foci for particle manipulation - Aberration correction: Real-time feedback to flatten wavefront
Limitations: - Phase-only (cannot modulate amplitude in traditional LC-SLMs) - Pixelation limits high-frequency content - Efficiency ~70–90% (residual diffraction orders)
Deformable Mirrors
Membrane or Piezo Mirrors physically deform a mirror surface to introduce a desired phase shift: \[\Delta \phi = \frac{2 \times \text{surface deflection}}{\lambda} \times 2\pi\]
(Factor of 2 because light reflects, doubling the optical path.)
Advantages: - Higher reflectance (>95%) - Can correct large aberrations (many waves) - Continuous surface (no pixelation)
Disadvantages: - Limited to low-order corrections (typically <50 actuators → low-order Zernike only) - Slower response time (ms)
Choice: - SLM: Fast correction, arbitrary modes, lab demonstration - Deformable mirror: High-NA systems, deep-tissue imaging where many aberration modes matter
Sensorless Adaptive Optics
When a wavefront sensor is unavailable or impractical, we use sensorless AO: directly optimize an image quality metric (e.g., intensity variance, maximum intensity, or a deconvolution cost function) by iteratively adjusting Zernike coefficients.
Algorithm: 1. Start with \(W = 0\) (flat wavefront) 2. Vary Zernike coefficient \(c_{n,m}\) (e.g., defocus) and measure the quality metric 3. Move in the direction that improves metric 4. Repeat for all low-order modes 5. Refine with finer steps until convergence
Speed: 1–10 seconds per correction (much slower than sensor-based, but requires no extra hardware)
Best for: Deep-tissue imaging, where aberrations increase with depth and drift slowly over time.
8. Application: Deep-Tissue Confocal Imaging with Adaptive Optics
The Problem: Spherical Aberration at Depth
In thick, scattering tissue (e.g., brain, muscle), refractive index variations accumulate as light propagates. A homogeneous spherical aberration develops due to mismatched refractive indices (tissue ≠ design medium).
Figure 11.1— Widefield vs. confocal microscopy in real space and Fourier space. Left: PSF (lateral cross-section) showing confocal narrowing (blue: widefield, red: confocal). Middle: OTF magnitude (1D profile) showing confocal gain at high frequencies (blue: widefield, red: confocal, cyan dashed: cutoff). Right: Full 2D confocal OTF (hot colormap), illustrating recovery of the missing cone.
✓ Confocal vs. widefield PSF and OTF comparison visualized
11. Experimental Connections
Building a Simple Confocal Path
A teaching-lab confocal microscope can be built from: 1. Laser source (e.g., 488 nm diode laser, 5 mW) 2. Dichroic mirror to combine excitation and collection paths 3. Objective lens (40× or 60×, high NA) 4. Pinhole (adjustable aperture, ~20–50 μm diameter) 5. PMT or avalanche photodiode for point detection
Procedure: - Align laser to objective back aperture - Focus on fluorescent sample (e.g., beads, labeled cells) - Mechanically or acousto-optically scan the beam - Adjust pinhole diameter to observe trade-off: signal vs. contrast
Key observation: As you close the pinhole, out-of-focus haze disappears, but signal drops. The optimal point is ~0.5–1.0 Airy unit (AU).
Measuring Zernike Aberrations with a Hartmann Sensor
A Hartmann test requires: 1. Collimated beam through the microscope objective (reverse direction) 2. Microlens array (40×40, ~300 μm focal length; can use printed diffractive element) 3. CCD camera at focal distance 4. Software to find lenslet spot centroids and compute slopes
Observation: You will see predominantly defocus and spherical aberration. Remove mechanical defects (tilted objective), and astigmatism typically vanishes.
Adaptive Optics in Practice: SLM-Based Correction
With an SLM at the pupil plane: 1. Apply an initial correction pattern (e.g., measured aberration phase) 2. Image the specimen; compute a quality metric (e.g., Laplacian variance) 3. Slightly perturb one Zernike coefficient; re-measure metric 4. Move in direction of improvement; repeat 5. Cycle through 5–10 low-order Zernike modes
Confocal microscopy uses the product of two PSFs (illumination × detection) to improve OTF, particularly at high spatial frequencies
Aberrations modify the pupil function\(P = A \exp(iW)\); even small wavefront errors degrade OTF and reduce Strehl ratio
Zernike polynomials provide an orthonormal basis on the unit disk; low-order modes (defocus, astigmatism, coma, spherical) account for most real-world aberrations
Wavefront sensing (Shack-Hartmann) measures the gradient of the phase field—a Fourier operation (\(\nabla W \leftrightarrow i\mathbf{k} \widetilde{W}\))—and reconstructs the full phase by integration
Adaptive optics uses SLMs or deformable mirrors to correct measured aberrations, restoring diffraction-limited PSF even in aberrating media (thick tissue)
SLMs and AOMs are essential tools in modern microscopy and in the MoNa lab for beam shaping, holographic manipulation, and real-time wavefront control
All of these phenomena have a unified Fourier-optics interpretation: the pupil function is the master object that controls resolution, contrast, and aberration behavior.
Further Reading
The following resources expand on the topics in this lecture:
Mertz (2019) — Introduction to Optical Microscopy, Chapters 2–4. Comprehensive treatment of confocal imaging and the OTF framework.
Goodman (2017), Ch. 6–7 — Fourier optics foundations and propagation through optical systems.
Born & Wolf (1999), Ch. 8 — Aberrations, Zernike polynomials, and the theory of optical systems.
Tyson (2015) — Principles of Adaptive Optics, 3rd ed. Standard reference for wavefront sensing and correction.
Booth, M.J., et al. (2021) — “Adaptive optics in microscopy.” Phil. Trans. R. Soc. A379, 20200110. Review of AO in biomedical imaging.
Shack, R.V. & Platt, B.C. (1971) — “Production and use of a lenticular Hartmann screen.” J. Opt. Soc. Am.61, 656–660. Foundational Shack-Hartmann paper.
Lecture 10: Confocal Microscopy & Wavefront Control — Introduction to Photonics