Large depth-of-field tracking of colloidal spheres in holographic microscopy by modeling the objective lens

Holographic microscopy has developed into a powerful tool for 3D particle tracking, yielding nanometer-scale precision at high frame rates. However, current particle tracking algorithms ignore the effect of the microscope objective on the formation of the recorded hologram. As a result, particle tracking in holographic microscopy is currently limited to particles well above the microscope focus. Here, we show that modeling the effect of an aberration-free lens allows tracking of particles above, near, and below the focal plane in holographic microscopy, doubling the depth of field. Finally, we use our model to determine the conditions under which ignoring the effect of the lens is justified, and in what conditions it leads to systematic errors.


Introduction
Digital holographic microscopy excels at fast, precise three-dimensional (3D) imaging of colloidal particles and nanoparticles. In a typical in-line digital holographic microscope, coherent light illuminates a sample, an objective collects the scattered and transmitted light, and a digital camera records the resulting interference pattern, or hologram (Fig. 1a). Compared to bright-field and confocal microscopy, holographic microscopy has three advantages for imaging small particles. First, because a hologram records both the phase and amplitude of the scattered wave, a single camera exposure captures information about the particles' 3D position, shape, and size. Second, because the technique does not require fluorescent labels, the incident beam power is not limited by bleaching. Third, the depth of field in holography is tens to hundreds of micrometers. Combined, these three advantages give holographic microscopy an enormous dynamic range: 3D information can be captured at rates of thousands of frames per second and over durations of hours or more. Moreover, the precision of the technique is unparalleled: micrometer-sized particles can be localized to nanometer-scale precision in all three dimensions [1]. Holographic microscopes have been used to track both individual colloidal particles [2,3] and colloidal clusters [4] in 3D, to watch colloidal particles breach interfaces [5], and to characterize 3D fluid turbulence [6,7]. Because it is noninvasive, holographic microscopy has also proven useful for imaging living specimens, including bacterial [8] and eukaryotic cells [9][10][11][12].
Extracting 3D information about the sample, such as the 3D position of a particle, requires analyzing the recorded hologram. One method, based on Gabor's original conception of holography [13], is to reconstruct the electric field everywhere in space using the phase and amplitude information recorded in the hologram and to identify the particle's location from the reconstructed field [14]. This approach is indirect: the hologram is processed to yield a reconstruction of the field, which is then processed again to extract the particle's position. Furthermore, the depth resolution is poor [15], and artifacts arise when the particle is comparable in size to the wavelength of the incident light [16].
A more direct and precise approach is forward modeling combined with inference, wherein the recorded hologram is compared to a simulation from a scattering model [1,17,18]. The parameters of the model-which might include the particle's position, size, and refractive index-can then be determined by fitting the simulated hologram to the measured one. With this approach, one can not only track particles with high precision [5,19,20] but also calculate uncertainties on the particle positions using Bayesian inference [21].
Although many forward models start from exact solutions of Maxwell's equations to describe the particle scattering [3,22,23], modeling the hologram formation from the scattered wave involves approximations that ultimately limit our ability to track particles. In most approaches, the hologram H(x p ) recorded on the detector is modeled as the magnified image of the scattered field E sc and the incident field E in at the focal plane of the objective: where x p is the particle's position relative to the point in the focal plane conjugate to a detector pixel, and α is a field-rescaling parameter that accounts for experimental imperfections in the optical setup [1]. When the particle is well above the focal plane, this lensless model works well. However, when the particle is near or below the focal plane, the lensless model makes the unphysical prediction that the hologram results from the internal or backscattered electric field. Accordingly, the lensless model is not useful for tracking the motion of particles near or below the focus of the objective; therefore, this approximation limits the depth of field. Furthermore, the lensless model does not account for physical effects of the lens such as the Gouy phase shift [24-27]. As we shall show, modeling these effects is critical to accurately simulating the hologram when the particle is near the focus.
Here we show that explicitly modeling the effects of the objective lens doubles the depth of field of the holographic microscope by reducing systematic errors near and below the objective's focus. We model the lens by describing the scattered electric field as defocused, forward-scattered light, in an approach similar to that of Ovryn and Izen [17] but with additional simplifications that allow for a compact representation of the recorded hologram. With this model, we can track particles above, near, and below the focus of the objective. Finally, by comparing the results of our model to the lensless model, we determine the conditions under which the lens can be safely ignored.

Theory
To create an analytically tractable model for the effect of the lens, we simplify the full optical train of an inline holographic microscope. First, we ignore any reflections or aberrations due to the optical interface of the cover slip [17,28], because these can be minimized with an immersion lens. Second, we describe the combination of the objective and tube lens as a single effective lens with the same magnification and numerical aperture, because this is the simplest model that captures the phase, polarization, and resolution effects of the imaging system [29]. Third, we assume an aberration-free and translationally invariant aplanatic system, which is a good approximation for modern microscope lenses. This simplified model of the imaging system is shown in Fig. 1b.
To calculate the hologram on the detector plane, we treat the scattered beam and the incident beam separately. We calculate the image of the scattered field following derivations of microscope point-spread functions [28][29][30]. In Sec. 2.1, we evaluate the scattered electric field on the lens's entrance pupil, represented as a Gaussian reference sphere S o centered on the object point of the effective lens. In Sec. 2.2, we model how the lens transforms the field on its entrance pupil to that on its exit pupil, represented as the Gaussian reference sphere S i centered on the image point of the effective lens. In Sec. 2.3, we use a diffraction integral to propagate the scattered field from the surface S i to the detector plane. This step yields a two-dimensional integral equation for the field scattered from a generic particle as imaged through a large-aperture microscope objective. In Sec. 2.4, we simplify this integral for spherically symmetric scatterers, reducing it to a one-dimensional integral that is easily evaluated numerically. Finally, in Sec. 2.5, we model the hologram by calculating the interference between the scattered field and the transmitted field, which propagates through the same optical train.
We work in physical limits relevant for holographic microscopy. We assume that the microscope dimensions are large compared to the wavelength of light (kd o 1, kd i 1, where k is the wavevector of the light in the medium; that the position of the particle x p is close to the focus of the imaging system (|x p |/d o 1); and that the ratio of the microscope's numerical aperture NA to its magnification M is small-an assumption equivalent to θ i 1, where θ i is defined in Fig. 1b. For a 100× magnification, NA = 1.0 microscope with a working distance of 0.2 mm and a 200 mm tube lens that images a particle 5 µm from its focal plane using 660 nm red light, kd o ≈ 2 × 10 3 , kd i ≈ 2 × 10 6 , |x p |/d o ≈ 0.02, and NA/M ≈ 0.01, and these approximations are well justified. We allow the numerical aperture to be large and do not make a paraxial approximation.
2.1. Scattered field on the entrance pupil of the lens We first evaluate the electric field on the Gaussian reference sphere S o , as scattered from a particle located at a position x p from the center of S o (see Fig. 1b for a coordinate diagram). Let d o be a point on S o , which we represent in spherical polar coordinates from the center of The point d o is located at r op ≡ d o − x p relative to the particle. Because the lens is a macroscopic distance from the particle, the magnitude of r op is much larger than the wavelength of light, and the scattered electric field on S o is in the far-field limit. For a generic scatterer excited by an incoming wave E 0x e ikz , the scattered electric field in the far-field limit takes the form [31] where (r op , θ op , φ op ) is the decomposition of r op in spherical polar coordinates and S is the far-field scattering matrix. To lowest order in |x p |/d o , these components are θ op = θ o , and φ op = φ o , and the scattered field on the surface S o is where (ρ p , φ p , z p ) is the particle position in cylindrical coordinates, with +z p oriented away from the lens. The paraxial approximation differs from Eq. (3) by making the approximations sin θ o ≈ θ o and cos θ o ≈ 1. We do not use the paraxial approximation because the scattered field in this approximation does not provide any information about the particle's axial position z p .

Transformation of the scattered field by the lens
The lens transforms the phase, polarization direction, and magnitude of the scattered field on S o to new values on S i . To understand this transformation, we consider a simple model of a perfect lens [29,30]. A perfect lens stigmatically images a point at the object plane to a point on the image plane; all rays from the object point which enter the lens pupil intersect at the image point. By Fermat's principle, each of these rays traverses an equal optical path. Since the surface S o is a sphere centered at the object point, each ray leaving the object point accumulates the same phase at S o . Likewise, each ray leaving the second spherical surface S i accumulates the same phase at the image point. Thus, to stigmatically image the object point to the image point, the lens maps the rays on the first surface S o to the second surface S i with the same constant phase shift Φ for each ray. The lens also rotates the electric field's polarization, applying the same rotation to the polarization vectors as it does to the ray directions [32]. The lens rotates the polarization projection along the unit vectorθ o on S o to alongθ i on S i , and fromφ o toφ i , where (θ i , φ i ) are coordinates on the surface S i , and (θ i ,φ i ) are the associated unit vectors. For a typical microscope imaging configuration, d i d o , and the polarization vectors exiting the lens will be approximately parallel to the detector plane-that is,θ i ≈x cos φ i +ŷ sin φ i andφ i ≈ −x sin φ i +ŷ cos φ i .
Finally, the lens slightly rescales the magnitude of the electric field as the rays propagate from S o to S i [29]. Consider the flux of energy from the rays that enter through a small surface area dS o centered at (θ o , φ o ) on the entrance pupil and exit through the area dS i on the exit pupil. By conservation of energy, the incident flux |E S o | 2 /c × dS o must equal the outgoing flux |E S i | 2 /c × dS i . For a translationally-invariant aplanatic system of magnification M, the Abbe sine condition, sin θ o = M sin θ i , relates the two elements of area as cos θ i dS i = cos θ o dS o . Substituting this relation into the outgoing flux and approximating cos θ i ≈ 1 relates the field magnitudes as Combining the phase shift, polarization rotation, and the change in magnitude due to the lens yields the field on the exit pupil S i : 2.3. Propagation of the scattered field to detector plane Finally, the electric field propagates from S i to the detector. For a translationally-invariant optical system, we need only consider the electric field at the detector's center, corresponding to the center of the sphere S i , because examining a different location on the detector is equivalent to shifting the particle. A Kirchoff diffraction integral over the surface S i yields the scattered field at the center of the detector plane: where dΩ i is the element of solid angle on S i . Here, the Green's function ik/4πr × e −ikr is constant, because every point on the spherical cap S i is a distance d i from the focus of the imaging system. Substituting Eqs. (3) and (4) into Eq. (5), approximating cos θ i ≈ 1, and transforming the domain of integration from S i to S o using the Abbe sine condition for the Jacobian dΩ i /dΩ o yields the scattered electric field at the detector: where β is the acceptance angle of the objective, related to the numerical aperture NA through the immersion fluid index n f as NA = n f sin β. Equation (6) gives the electric field from an arbitrary scatterer as imaged on the detection plane of a microscope.

Simplified form for Mie scatterers
Up to this point, we have made no assumptions about the type of scatterer. For spherically symmetric scatterers, the symmetry of the scattered field greatly simplifies Eq. (6), allowing us to analytically integrate over the φ coordinate. The far-field scattering matrix becomes where S and S ⊥ are given by Mie theory [31]. Substituting the scattered field into Eq.
where we define the integrals I 0 and I 2 as where J n is the Bessel function of the first kind of order n.

Incident beam and hologram
The change to the incident beam as it passes through the lens is much simpler to evaluate. As the initially collimated incident beam propagates to the surface S o , it accumulates a phase exp(−ikd o ). Since the incident beam strikes the lens axially, its polarization vector and amplitude are unchanged, and the lens only imparts a phase factor exp(iΦ). On exiting, the incident beam passes through a focus at the back focal point of the lens, eventually accumulating a Gouy phase shift of −1 [26]. The beam continues to propagate to the detector plane, accumulating an additional phase shift of exp(−ikd i ). On striking the detector, the incident beam has a magnification of M, which decreases the magnitude of the field by 1/M. Combining these effects, we find that the incident field at the detector plane is With the addition of the field-rescaling parameter α used to capture imperfections in the optical setup, the intensity recorded at the detector is proportional to |E in,det + αE sc,det | 2 . Absorbing the shared phase factors and constants into an overall scaling factor H 0 yields an expression for the recorded hologram: Equation (12) is the basis of what we call the lens model, which predicts the hologram at a single point on the detector plane for a particle at an arbitrary position x p from the conjugate point in the object plane. Calculating a hologram with the lens model is more straightforward than with the model of Ref. 17, in that it requires the evaluation of only two integrals I 0 and I 2 in Eqs. (9)-(10) and their combination in Eq. (12). Although derived for a point at the center of the detector, Eq. 13 is valid for any point on the detector plane, owing to the translational invariance of the imaging system. To calculate the hologram on the entire detector plane, we repeat this calculation, measuring the particle position x p from the object point conjugate to each point on the detector plane.

Experimental Results and Discussion
To validate our model, we do an experiment in which we immobilize 1-µm-diameter polystyrene sphere in a gel and obtain holograms of an isolated particle as we sweep the microscope focus  Comparison of (a) experimental holograms of a 1-µm-diameter polystyrene particle in an acrylamide gel to predictions from (b) the lens model and (c) lensless model, over a range of particle z p positions. The left half of each panel shows holograms for a particle 11 µm above, 1 µm above, and 12 µm below the focal plane of the objective, while the right half of each panel shows xz-cross-sections as a function of the focal position, where each cross-section is the intensity of the hologram across a line running through the center of the central lobe. All images are shown at the same scale. The lensless model cannot predict the recorded holograms when the particle is in or below the focus.
through it (see Appendix B). When the particle is far above the focal plane, the recorded hologram consists of a bright central lobe surrounded by rings (Fig. 2a). The ring spacing is primarily set by z p and is visible as the cone-like structures in the xz-cross-section. As the particle approaches the focal plane, these rings come closer together, until the hologram becomes an image of the particle in focus. As the particle passes below the focus, the recorded hologram once again consists of rings centered on a central lobe with a spacing set primarily by the particle z p , but with a dark rather than bright central lobe.
Both models predict holograms that agree with the experimental data when the particle is well above the focal plane (Fig. 2b,c). However, as the particle nears the focus, the predictions of the lensless model start to deviate from the measurements. The lensless model is not designed to predict the hologram when the particle is at or below the focal plane, and in these regions, the lensless model produces unphysical predictions: it predicts that the hologram of a particle straddling the focus depends on the particle's internal field, and that of a particle below the focus depends on the back-scattered field. In contrast, the lens model uses only the forward-scattered light and generates holograms that agree with the experimental data throughout the depth of field.
To test how the lens model performs in a 3D particle tracking experiment, we record a movie of a 2.4-µm-diameter polystyrene particle sedimenting in water. The particle starts tens of micrometers above the focus and sediments through the focus as it diffuses. We do not change the focus of the objective during the experiment. We measure the particle's trajectory by fitting the lens model to each frame of the video, fitting for the particle's 3D position, radius, and refractive index, as well as the objective's acceptance angle β and the field rescaling parameter α. For comparison, we also fit the lensless model to the data when the particle is above the focal plane, fitting for the particle's 3D position, radius, and refractive index, as well as the field rescaling parameter α. We then compare the particle trajectories inferred from the two models to each other and to the sedimentation velocity predicted from Stokes's law (Fig. 3).
Both above and below the focus, the trajectory inferred using the lens model is consistent with that expected from Stokes's law for a diffusing, sedimenting particle. We measure a sedimentation From the recorded holograms, we reconstruct (d) the particle's 3D trajectory, including (e) its height above the focus z p as a function of time. Using the lensless model, we track the particle only above the focus (red triangles in (e)). By modeling the lens, we extend the range of particle tracking to within and below the focus (trajectory in (d) and blue circles in (e). velocity of 0.18 ± 0.06 µm/s, where the uncertainty is primarily from the particle's diffusion. We predict a velocity of 0.18 ± 0.04 µm/s, where the uncertainty is primarily from limited knowledge of the particle radius.
When the particle is well above the focus, the positions that we infer using the lens model agree quantitatively with those we infer using the lensless model. However, when the particle is within 3 µm of the focus, the best-fit holograms from the lensless model fail to reproduce the recorded images. Instead, the best fits from the lensless model converge to α = 0, corresponding to a structureless hologram.
There are differences between holograms predicted by the lensless model and those predicted by the lens model even when the particle is above the focal plane. These differences are shown in Fig. 4. When the particle is 10 µm above the focus, a hologram simulated with the lensless model is indistinguishable from one simulated with the lens model for a high-NA lens (Fig. 4a). However, as either the NA decreases (Fig. 4b) or the particle approaches the focus (Fig. 4c), the two models differ in their predictions, particularly in the fringe spacing and contrast. When the particle is close to the focal plane and imaged with a low-aperture lens, the difference in fringe spacing predicted by the models becomes dramatic (Fig. 4d). Furthermore, in this case the lens model predicts a dark central lobe, while the lensless model predicts a bright one (Fig. 4d).  A dark central lobe near the focus is more physically realistic than a bright one: as the particle passes through the focus, the Gouy phase shift must lead to an inversion of the contrast of the hologram's central lobe, as is well appreciated in both brightfield and holographic microscopy [26,27]. When the particle is far above the focal plane, the scattered beam comes to a focus behind the detector and does not have a Gouy phase shift at the detector plane. But as the particle passes below the focal plane, the scattered beam comes to a focus in front of the detector, smoothly accumulating a Gouy phase shift of π. Thus, the central fringe should become dark near and below the focus, as predicted by the lens model and as shown in our measurements (Fig. 2a). The lensless model predicts no change in contrast as the particle nears the focus, because it predicts no change in phase of the forward-scattered beam relative to the incident beam as z p changes.
To understand why the fringe spacing differs between the two models, we consider the effect of the lens acceptance angle β on the fringe spacing. The lens model predicts that near the focus the fringe spacing should increase significantly with decreasing β, as shown in Fig. 5. In the lens model, this increase in fringe spacing is due to the point-spread function. A lens images slowly-varying electric fields but blurs out any features with periodicity less than the objective's resolution limit λ/NA = λ/n f sin β. As a result, the smallest possible fringe spacing in a hologram from the lens model is λ/NA, larger than the shortest possible fringe spacing of λ in the lensless model. This difference is especially noticeable when the fringes are closely spaced, as happens either far from the hologram's center or when the particle is near the focus.
The variation of the fringe spacing with lens acceptance angle can lead to systematic errors when one uses the lensless model to infer the particle position from a measured hologram. To illustrate this point, we quantify the change in fringe spacing as a function of the lens acceptance angle. Specifically, we calculate the distance from the hologram's central lobe to the fourth fringe ( Fig. 5a-d)  changes significantly with the lens acceptance angle β, from 6.9 µm when β = 0.3 to 4.3 µm when β = 1.1 (Fig. 5e). Because information about the particle height z p is contained primarily in the fringe spacing, and because the lensless model does not account for the change in fringe spacing due to the objective's limited resolution, using the lensless model to infer z p from a measured hologram will lead to a systematic error.
To determine the imaging conditions under which this systematic error is significant, we calculate the minimum particle z p at which a hologram predicted by the lensless model agrees with that of the lens model (Fig. 5f), as quantified by the difference in the fourth fringe position. As the particle approaches the focus, the scattered electric field in the focal plane varies on finer and finer scales. When the particle is closer than a certain z p , the field varies on a finer scale than the objective's resolution limit λ/NA, and the resolution limit rather than z p sets the fringe spacing in the lens model. At this z p , the lens and lensless models predict different holograms. For a lens with β = 0.3 (corresponding to an NA of 0.4 for a water-immersion objective), the particle z p must be at least 20 µm above the focus for the two models to agree. As the lens acceptance angle increases to β = 0.8 (NA of 1.0 for water-immersion), the particle can be as low as 5 µm above the focus before the fringe spacing differs significantly from that predicted by the lensless model.
The lensless model omits two effects: the Gouy phase shift and the objective's resolution limit. Both of these effects are important when the particle is within the objective's depth of field: the Gouy phase shift because the scattered beam's waist straddles the detector, and the resolution limit because the hologram's structure varies rapidly. In fact, we find that the minimal z p for a hologram to be accurately described by the lensless model scales as 3 µm/β 2 (Fig. 5f), proportional to the theoretical scaling of the objective's depth of field [26,32].
Modeling the lens also resolves a puzzle about holographic imaging of particles near the focus: the lensless model requires the near-field dependence of the scattered field to predict the hologram accurately [3,22,23], even though the detector is hundreds of millimeters downstream of the lens, well in the far field. For a 1 µm-diameter particle 15 µm above the focus, holograms calculated by the lensless model which use the far-field approximation deviate by 10% from those which use the full near-field dependence [33]. Why does the near-field form provide a better approximation than the far-field solution? The reason is that the far-field form of the electric field as predicted by the lensless model is only an approximate solution to the wave equation, not an exact solution. In contrast, the near-field form is an exact solution to the wave equation, albeit for a different imaging setup than used in holographic microscopy. By constraining the field to be an exact solution to the wave equation, the near-field version of the lensless model describes the actual hologram more closely than the far-field version does. By contrast, the electric field predicted by the lens model is an exact solution to the wave equation for the imaging setup.

Conclusion
We have presented a model that accounts for the effect of an aberration-free objective lens on in-line holograms of isolated spherical particles, and we show that the fringe spacing and contrast depend strongly on the lens acceptance angle. This variation agrees well with that observed experimentally above, near, and below the focus of the objective. We have shown also that the lens model can be used to infer the 3D position of a colloidal sphere near and below the focus of the objective, effectively doubling the depth of field as compared to the lensless model. Furthermore, because the model accounts for the effect of the lens aperture on the fringe spacing, it can be used to infer the height of the particle from a measured hologram with lower systematic error, even above the focus.
By capturing physical effects of the lens such as the Gouy phase shift, our results also provide insight into holograms of more complex scatterers. The compact representation we derive for homogeneous spherical scatterers does not apply to more complex scatterers such as ellipsoids or clusters, but in these cases a lensless model can be used so long as the scatterer is above the depth of focus of the objective. The lens model can be used to quantitatively estimate this minimum height as a function of the numerical aperture of the objective. Therefore, the model is useful not only for fitting holograms of spherical scatterers, but also for determining the range of validity of general lensless models, which might be easier to implement computationally.
For spherical particles, all the physics described by the lens model is also described in the earlier work of Ref. 17. However, our simplified model requires the calculation of only the integrals I 0 and I 2 in Eqs. (9) and (10), allowing for a straightforward and efficient computational implementation. We find that calculating a hologram with the lens model takes roughly the same time as with the lensless model, because much of the time is spent computing the Mie scattering matrices. With the numerical optimizations detailed in Appendix A, the implementation of the lens model becomes three times as fast as the lensless model. This fast implementation is available in the open-source package holopy [34].

A. Numerical Methods
Calculating a hologram of shape N × N with the lens model for a single particle involves numerically integrating Eqs. (9)-(10) over each of the N 2 values of ρ p in the image. We perform this integration through Gauss-Legendre quadrature over cos θ o . For large ρ p , the J n (u sin(θ o )) terms oscillate rapidly and require many quadrature points for accurate integration; empirically, we find 100 quadrature points provides good accuracy for k ρ p < 400. Because the Mie scattering coefficients S (θ) and S ⊥ (θ) do not depend on ρ p or z p , we pre-compute the scattering coefficients once at the quadrature nodes and use these values for each of the separate integrations over ρ p . With the pre-computed scattering coefficients, the slowest part of the integration is the computation of the Bessel functions at the N 2 values of ρ p . Since the maximum ρ p is only of O(N), we reduce this near-redundant computation by creating an interpolator for I n . Interpolating I n with piecewise Chebyshev interpolators of degree 32 over windows of size ∆u = 39 provides a fifteen-fold speed increase, with a relative accuracy on the order of 10 −12 . We use holopy to calculate the lensless model, using methods described in [34].
We validate this numerical implementation of Eqs. (8)- (12) with the following test derived from using conservation of energy of the scattered beam. The power scattered from the particle crossing the surface S o must be equal to that striking the detector plane. By construction, the Poynting vector is perpendicular to S o , so the flux on S o is |E S o | 2 /c. Substituting the field from a Mie scatterer (Eqs. (3) and (7)) and integrating over φ o gives the power on S o : To the accuracy of the approximations, the Poynting vector is perpendicular to the detector plane, and the flux on the detector is |E sc,det | 2 /c. Substituting the scattered field from Eq. (8) and integrating over φ det gives Equating the powers in Eqs. (13) and (14) and substituting u ≡ k ρ det /M in Eq. (14) relates the scattered field on the detector plane to the scattering matrix as We use this integral relationship as a unit test of our numerical implementation of the scattered field, testing the implementation over a range of lens acceptance angles, particle positions, particle refractive indices, and particle radii. The analogous test for conservation of total energy in the scattered and incident beams is not numerically practical; however, one can show that conservation of energy combined with Eqs. (12) yields the optical theorem.

B. Experimental Methods
The data in Fig. 2 were obtained on a sample of colloidal spheres in a polyacrylamide hydrogel prepared by free radical polymerization. To make the hydrogel, we first combine 2 parts water and 1 part Protogel (30% w/v acrylamide, 0.8% w/v bis-acryl-amide, National Diagnostics). We then mix 27 µL of the Protogel mixture with 1.5 µL of a 10 −4 % w/v suspension of 1.0-µm-diameter polystyrene spheres (Polysciences 19404) in water and with 0.2 µL of the UV polymerization initiator Darocur 1173 (2-hydroxy-2-methylpropriophenone, Aldrich). We place the mixture in a sample cell composed of glass slides separated by a 50 µm thick spacer, seal the edges of the cell with vacuum grease, and irradiate the cell with an ultraviolet lamp to cure the hydrogel. This procedure produces a transparent polyacrylamide hydrogel with refractive index of 1.348, as measured by an Abbe refractometer. To prevent the hydrogel from drying during the experiment, we fill the chamber surrounding the gel with water using a syringe inserted through the vacuum grease. We then image the particle at 51 defocus positions spanning 50 µm, centered on the particle. Details of the imaging setup are given below. For the sedimentation experiment in Fig. 3, we image a dilute suspension of polystyrene microspheres with a reported diameter of 2.4 µm (density 1.055 g/mL, index 1.591 at 590 nm, Invitrogen S37502). We prepare a 10 −4 % w/v colloidal suspension and place it in a sample chamber made of a glass coverslips separated by 50-µm-thick plastic spacers. We invert the sample chamber for several minutes to give the particles time to sediment to the top coverslip, then place the sample chamber right-side up onto the microscope. We adjust the focal position of the objective to be within the sample chamber and image the particles as they sediment through the focus.
In both experiments, the imaging setup consists of a Nikon Eclipse Ti TE2000 microscope with a water-immersion objective (Plan Apo VC 60×/1.20 WI, Nikon), with the correction collar set to the thickness of the coverslip to minimize aberrations. The images in Fig. 2 are obtained from a 1280×1024-pixel CMOS color sensor array (Edmund Optics 1312C) and in Fig. 3 from a 1024×1024-pixel CMOS monochrome sensor array (PhotonFocus A1024). After obtaining images of each particle, we record a set of background images by moving the particle out of the field of view in several directions. The raw holograms are processed prior to fitting by dividing by the average background intensity. In addition, we take dark-count data by acquiring images with the primary light source switched off. We average these dark-count images and subtract them from the background-corrected data before analysis. For the sedimentation data, we fit the processed holograms using a parallel-tempered [35], affine-invariant [36], Markov-chain Monte Carlo ensemble sampler, as implemented in the Python package emcee [37]. We find that parallel tempering improves tracking by avoiding local minima in the posterior landscape.

Funding
We acknowledge support from the National Science Foundation through grant number DMR-1420570.