Expand this Topic clickable element to expand a topic
Skip to content
Optica Publishing Group

zPIE: an autofocusing algorithm for ptychography

Open Access Open Access

Abstract

An autofocusing algorithm for ptychography is proposed. The method optimizes a sharpness metric that would be observed in a differential interference microscope and is valid for both amplitude and phase modulating specimens. We experimentally demonstrate that the algorithm, based on the extended ptychographic iterative engine (ePIE), calibrates the sample–detector distance with an accuracy within the depth of field of the ptychographic microscope. We show that the method can be used to determine slice separation in multislice ptychography, provided there are isolated regions on each slice of the specimen that do not axially overlap.

© 2020 Optical Society of America under the terms of the OSA Open Access Publishing Agreement

Ptychography has gained wide popularity throughout the last decade [1,2]. It enables computational reconstruction of both complex illumination and specimen transmission functions in coherent scanning microscopes, in principle without the use of lenses [35]. The large amount of diversity in ptychographic data sets makes it possible to infer additional properties of the experimental setup, such as the degree of spatial and spectral coherence [68]. In addition, ptychography has the ability to correct for misalignment and calibrate experimental setups [9]. Lateral position correction algorithms have been reported to mitigate the effect of sample drift and errors in the encoders of $xy$ translation stages [1013]. On the other hand, axial uncertainty in the sample–detector distance results in scaling of the reconstruction pixel size and as such introduces spatially dependent artifacts [14]. In multislice ptychography [15] the slice separation between layers of a thick specimen is a priori unknown, but can be optimized using gradient descent techniques [16]. Here, we propose an algorithm that calibrates both the sample–detector distance for single-slice ptychography and the axial separation in multislice ptychography. Previous work by others have demonstrated autofocusing in ptychography using a sharpness metric that is sensitive to amplitude-modulating specimens [17]. Here, we propose an approach sensitive to both amplitude- and phase-modulating specimens, which makes the technique of use in particular for hard X rays where the object imprints mainly phase contrast on the incoming illumination. Unlike holography, the method requires no a priori knowledge and uses the unique feature of ptychography that diffraction intensities from adjacent scan positions can be made self-consistent only when the sample–detector distance and the slice separation are estimated correctly.

The effect of axial misalignment is illustrated in Fig. 1. In ptychographic reconstruction algorithms, the physical coordinates of the translation stage encoder $ {{\boldsymbol r}_j} $ are converted into discrete pixel units $ {{\boldsymbol p}_j} $ via $ {{\boldsymbol p}_j} = {{\boldsymbol r}_j}/\Delta x, $ where $ \Delta x = \lambda z/D $ is the object reconstruction pixel size, $ \lambda $ denotes wavelength, $ D $ is the physical detector size in units of meters, and $ j = 1,\ldots,J $ denotes scan position. Miscalibration of the sample–detector distance by an amount $ \delta z $ results in a perturbed scan grid with coordinates

$${\bar{\boldsymbol p}_j} = \frac{{D{{\boldsymbol r}_j}}}{{\lambda \left( {z \pm \delta z} \right)}} \approx {{\boldsymbol p}_j} \mp \frac{{D{{\boldsymbol r}_j}}}{{\lambda {z^2}}}\delta z,$$
where we assume $ \delta z \ll z $. The situation in Fig. 1 corresponds to $ \delta z \lt 0 $ resulting in an inflated scan grid. From Eq. (1) and Fig. 1, it is expected that axial misalignment leads to spatially dependent grid miscalibration. This in turn causes reduced reconstruction quality due to inconsistencies in the forward model of the inversion algorithm. Below we describe an auto-focusing algorithm that detects and corrects for scan grid miscalibration, which results in a determination of the optimal sample–detector distance $ z $.

The autofocusing algorithm termed “zPIE” (“PIE” being the ptychographic iterative engine), is summarized in Algorithm 1. For a predetermined number of iterations $ n $ an ePIE algorithm [5] is used to get estimates for both the illumination $ P $ and object $ O $. The estimated object is propagated to $ K $ distances around the reconstruction plane using an angular spectrum propagator [18] given by

$$O ( {x,y,z} ) = {{\cal F}^{ - 1}}{H_{k\Delta z}} ( {{f_x},{f_y}} ){\cal F}O ( {x,y,0}),$$
where $ ( {x,y} ) $ and $ ( {{f_x},{f_y}} ) $ denote real and reciprocal space coordinates, respectively, and the transfer function $ H $ is given by
$${H_{k\Delta z}} ( {{f_x},{f_y}} ) = \exp \left[ {i2\pi /\lambda k\Delta z\sqrt {1 - {{ ( {{f_x}x})}^2} - {{( {{f_y}y} )}^2}} } \right].$$
 figure: Fig. 1.

Fig. 1. Axial misalignment in the sample–detector distance results in scan grid miscalibration. The black coordinates (dashed line) illustrate an inflated scan grid as compared to the true encoder positions (gray coordinates, solid line). The depicted situation arises when underestimating the sample–detector distance, while an overestimation would result in a compressed scan grid.

Download Full Size | PDF

The propagation interval $ \Delta z $ is chosen to be on the order of the depth of field [16,19], which under the paraxial approximation is given by

$$\Delta z = \lambda {( {2z/D} )^2}.$$
Tables Icon

Algorithm 1. Axial position correction algorithm (zPIE)

The sharpness of the propagated object is evaluated using the total variation (TV) functional

$$S\left( z \right)=\iint \sqrt{{{\left| {{\partial }_{x}}O\left( x,y,z \right) \right|}^{2}}+{{\left| {{\partial }_{y}}O\left( x,y,z \right) \right|}^{2}}+\epsilon }{\rm d}x{\rm d}y,$$
where the derivatives may be approximated by subtracting row- and column-shifted and unshifted versions of the input function from each other. The parameter $ \epsilon \gt 0 $ in Eq. (5) is a small constant that makes the TV functional differentiable when the lateral object gradient is zero. In what follows, we choose $ \epsilon { = 10^{ - 2}} $. Intuitively $ S(z) $ mimics the sharpness that would be observed in a differential interference contrast microscope with small lateral offset [20]. In particular, the sharpness metric is valid for both amplitude- and phase-modulating specimens, the latter of which was not considered in previous work [17]. The sharpness metric $ S $ can be expanded into a second-order Taylor series in $ z $:
$$S ( z ) \approx S ( {{z^\prime}} ) + ( {z - {z^\prime}}){\partial _z}S ( {{z^\prime}} ) + \frac{1}{2}{ ( {z - {z^\prime }} )^2} \partial _z^2S ( {{z^\prime }} ),$$
where $ {z^\prime } $ is an arbitrary point. At the optimum $ {z^*} $, the first-order term vanishes:
$$S ( z ) \approx S ( {{z^*}} ) + \frac{1}{2}{ ( {z - {z^*}} )^2}\partial _z^2S ( {{z^*}} ).$$

Since $ S( z ) $ is symmetric around $ {z^*} $ to second order, the feedback term $ \sum\nolimits_k s( k )k\Delta z/\sum\nolimits_k s( k ) $ in Algorithm 1 is zero at the optimum. For non-optimal $ z $, the skewness of the Taylor series expansion of $ S( z ) $ can be used to compute a feedback on $ z $. In addition to the feedback term, the search direction $ \delta z $ has a damped momentum term $ \eta $, which allows the algorithm to accelerate the search in the case of repeated steps in the same direction [21]. We note that the search can be accelerated by increasing the proportionality factor $ c $ in front of the feedback term in Algorithm 1. However, this can potentially result in less numerical stability and overshooting around the optimum. All results reported here were obtained with $ K = 10 $, $ c = 1 $, and $ \eta = 0.7 $. Last, we note that the ePIE subroutine in Algorithm 1 depends on $ z $, which implies resampling the scan grid according to Eq. (1).

 figure: Fig. 2.

Fig. 2. Experimental setup. A spatially filtered (L, lens; PH, pinhole) beam is focused to produce a divergent beam illuminating a sample mounted on a $xy$ translation stage. The diffraction data are recorded in a lensless geometry.

Download Full Size | PDF

We tested the performance of the autofocusing method using the experimental setup depicted in Fig. 2. A supercontinuum laser spectrally filtered to a wavelength of $ \lambda = 708.9\;{\rm nm} $ ($ \Delta \lambda = 0.6\;{\rm nm} $) was spatially filtered and focused to illuminate a sample mounted on an $xy$ translation stage ($2\times$ Smaract SLC-1770-D-S). The sample–detector distance $ z $ was set to be approximately 35 mm. An AVT Prosilica CCD camera ($ 1456 \times 1936 $ pixels with pixel size of 4.54 µm) was used to record a set of 200 diffraction intensities downstream the specimen. The average linear overlap in the scan was around 80% [22] at a beam size (FWHM) of 572 µm. We used a USAF resolution target (Thorlabs R3L1S4P) as a test sample, as it allows to compare the physical dimensions of the reconstructed image with the nominal dimensions according to the manufacturer. In this way, we validate the retrieved sample–detector distance $ z $, assuming $ \lambda $ and $ D $ are known. The experimental results are shown in Fig. 3. Figures 3(a) and 3(b) show an object reconstruction obtained with an initial estimate of $ {z_0} = 35.5\;{\rm mm} $ and using zPIE. The smallest resolved feature, group 7/element 1, has a line width of 3.9 µm, indicating a half-period spatial resolution close to the diffraction limit of 3.8 µm. The line widths of group 4/element 1 have a size of 31.1 µm, which deviates less than 1% from the nominal value of 31.3 µm. In contrast, Figs. 3(c) and 3(d) show a reconstruction obtained with an initial estimate of $ {z_0} = 35.5\;{\rm mm} $ without using zPIE. While for the larger spatial structures the reconstruction quality is comparable to Fig. 3(a), the reconstructed high-resolution features suffer from an incorrect sample–detector distance estimate, as seen by comparing Figs. 3(b) and 3(c). Figure 3(e) shows the estimated $ z $ as a function of iteration. Here we varied the initial estimate of the sample–detector distance from 30 mm to 40 mm and used zPIE to find the correct value of $ z $. For small excursions around the true value, the algorithm recovered the sample–detector distance and reconstructed both beam and object within 200 iterations. For larger deviations, the algorithm required more iterations, but consistently improved the estimated sample–detector distance in the correct direction. Those estimates that converged within 200 iterations exhibited final values of $ z $ in the range of 34.92 mm to 34.99 mm. Thus, the uncertainty in the retrieved sample–detector distance remained within the depth of field of the experimental setup, which is about 80 µm [cf. Eq. (4)] for the experimental configuration in Fig. 2.

 figure: Fig. 3.

Fig. 3. Ptychographic reconstruction (a), (b) with autofocus and (c), (d) without autofocus using an initial object–detector distance of $ {z_0} = 35.5\;{\rm mm} $. (e) Estimated sample–detector distance $ z $ versus iteration with varying initial estimates $ {z_0} $. (a), (b) correspond to the central dotted-dashed line in (e).

Download Full Size | PDF

We carried out a second experiment to test the performance of zPIE in recovering the slice thickness of a thick substrate. To this end, we turned around the USAF resolution target and used zPIE to estimate the new sample–detector distance. From the difference of the estimated sample–detector distances of the experiments with the sample facing the detector and the sample flipped around, the substrate’s thickness can be inferred provided its refractive index is known. The substrate of the USAF resolution target has a geometrical thickness of 1.5 mm and a refractive index of $ n = 1.52 $ (soda lime glass) at a wavelength of 708.9 nm. Using zPIE, we obtained an increase in the estimated equivalent free-space sample–detector distance by $ 0.97 \pm 0.04\;{\rm mm} $. One might expect a larger value due to the increased optical path inside the soda lime glass substrate. However, due to the higher refractive index inside the substrate, the estimated free-space sample–detector distance is decreased by a factor of $ n $, forming a virtual image closer to the exit surface. This is illustrated in Fig. 4(a). Here a signal emanating from the real point source (black point) on the left side of the substrate refracts at the glass–air interface resulting in a signal equivalent to a virtual point source (gray point) closer to the right boundary of the medium and traveling in free space. Thus, the difference in the sample–detector distance before and after flipping the sample of 1 mm found by zPIE is due to neglecting refraction at the interface and assuming free-space propagation. The correct geometrical thickness of the substrate $ t = 1.5\;{\rm mm} $ is obtained by multiplying the virtual free-space difference in sample–detector distance with the refractive index of the substrate.

In a third experiment, we used the same procedure as above to estimate the slice separation in multislice ptychography. Figure 4(b) depicts a microscopy slide with fingerprints on the front and back sides facing the illumination and detector, respectively. The glass slide (Thermo Scientific, Menzel Gläser) has a geometrical thickness of 1 mm and a refractive index of 1.52 at a wavelength of 708.9 nm. On the front and back sides of the slide, fingerprints were placed such that there were both overlapping and non-overlapping regions in the axial direction. First, we carried out single-slice experiments on the axially non-overlapping regions, using zPIE to recover the thickness of the glass substrate. This resulted in a (geometrical) thickness of $ t = 1.04 \pm 0.04\;{\rm mm} $, where the uncertainties are estimated by repeating the experiment at different locations. A value 1.52 times lower was used in the 3PIE algorithm [15] to emulate the equivalent free-space distance between the individual slices. The results of the multislice reconstruction are shown in Fig. 5. Figures 5(a) and 5(b) show the recovered object amplitude using single- and multislice ptychography, respectively. Figure 5(b) shows the product of the individual object amplitudes $ \prod\nolimits_k | {{O_k}} | $. Comparing the amplitude reconstructions in Figs. 5(a) and 5(b) indicates that the single-slice model exhibits inferior spatial resolution in recovering the back-slice of the specimen. Figure 5(c) shows the reconstructed probe, which is a 500 µm diameter pinhole with Scotch Tape stuck on top of it and imaged onto the backside of the specimen. The Scotch Tape generates a highly structured beam with increased spatial frequency content, resulting in reduced dynamic range requirements on the detector [15,2326]. Figure 5(d) shows the individual reconstructed slices obtained by 3PIE overlain in green (front) and red (back).

 figure: Fig. 4.

Fig. 4. (a) Due to refraction at the glass–air interface and assumed free-space propagation from the sample to the detector, the autofocusing algorithm recovers a virtual point source inside the specimen. (b) Experimental geometry for multislice ptychography.

Download Full Size | PDF

 figure: Fig. 5.

Fig. 5. Comparison of (a) single- and (b) multislice amplitude reconstructions of crossed fingerprints. (b) Both object slices projected into the same plane. (c) 3PIE beam reconstruction. Hue and brightness show phase and amplitude, respectively. (d) Overlay of back (green, illumination-sided) and front (red, detector-sided) slices of object reconstruction.

Download Full Size | PDF

The results reported here show that zPIE is a useful calibration tool for ptychography. For single-slice ptychography, we used a USAF resolution target to verify that the algorithm reconstructed the correct pixel size and thereby the correct sample–detector distance. Flipping the sample around and knowing the refractive index a priori, zPIE allowed us to measure the USAF target’s substrate thickness. For the multislice experiments, a biological multislice specimen was chosen to show both that the sharpness metric in Eq. (5) holds for mixed amplitude and phase specimens and that zPIE can be used to calibrate slice separation in multislice ptychography. With regard to the latter, we investigated a specimen that contained slices with regions that were not obscured by the other respective slice. Rewriting Eq. (4) as $ \Delta z = 4{( {\Delta x} )^2}/\lambda $, it is seen that our autofocusing method works best in the presence of sufficiently small features of size $ \Delta x $, which diffract under axial displacement $ \Delta z $. In the case of both 3D specimens where multiple slices obscure each other and smooth 2D specimens, small calibration markers at the lateral resolution limit of the system may be added to the side of the specimen to calibrate the sample–detector distance. Furthermore, zPIE may serve as a useful tool in particular for multislice near-field ptychography [25]. As has been noted previously [15], in single-slice ptychography an imprecise knowledge of the quadratic phase in the integrand of the Fresnel diffraction integral can be absorbed into the probe. In contrast, in multislice ptychography, this is not the case due to scattering from multiple slices of the sample. In summary, we have shown an autofocusing algorithm for ptychography that allows to calibrate the sample–detector distance and the slice separation in single- and simple multislice specimens. We expect the method to find application in automated calibration applications for ptychographic scanning microscopes.

Funding

Nederlandse Organisatie voor Wetenschappelijk Onderzoek (TTW-HTSM 13934); European Research Council (ERC-StG 637476).

Acknowledgment

We would like to thank Andrew Maiden for providing insights on multislice ptychography.

Disclosures

The authors declare no conflict of interest.

REFERENCES

1. J. M. Rodenburg and H. M. L. Faulkner, Appl. Phys. Lett. 85, 4795 (2004). [CrossRef]  

2. F. Pfeiffer, Nat. Photonics 12, 9 (2018). [CrossRef]  

3. P. Thibault, M. Dierolf, A. Menzel, O. Bunk, C. David, and F. Pfeiffer, Science 321, 379 (2008). [CrossRef]  

4. P. Thibault, M. Dierolf, O. Bunk, A. Menzel, and F. Pfeiffer, Ultramicroscopy 109, 338 (2009). [CrossRef]  

5. A. M. Maiden and J. M. Rodenburg, Ultramicroscopy 109, 1256 (2009). [CrossRef]  

6. P. Thibault and A. Menzel, Nature 494, 68 (2013). [CrossRef]  

7. D. J. Batey, D. Claus, and J. M. Rodenburg, Ultramicroscopy 138, 13 (2014). [CrossRef]  

8. B. Enders, “Development and application of decoherence models in ptychographic diffraction imaging,” Ph.D. dissertation (Technical University Munich, 2016).

9. M. Odstrčil, “Coherent diffractive imaging using table-top sources,” Ph.D. Thesis (University of Southampton, 2017).

10. M. Guizar-Sicairos and J. R. Fienup, Opt. Express 16, 7264 (2008). [CrossRef]  

11. A. M. Maiden, M. J. Humphry, M. C. Sarahan, B. Kraus, and J. M. Rodenburg, Ultramicroscopy 120, 64 (2012). [CrossRef]  

12. M. Beckers, T. Senkbeil, T. Gorniak, K. Giewekemeyer, T. Salditt, and A. Rosenhahn, Ultramicroscopy 126, 44 (2013). [CrossRef]  

13. F. Zhang, I. Peterson, J. Vila-Comamala, A. Diaz, R. Bean, B. Chen, A. Menzel, I. K. Robinson, and J. M. Rodenburg, Opt. Express 21, 13592 (2013). [CrossRef]  

14. L. Loetgering, M. Rose, K. Keskinbora, M. Baluktsian, G. Dogan, U. Sanli, I. Bykova, M. Weigand, G. Schütz, and T. Wilhein, Opt. Eng. 57, 084106 (2018). [CrossRef]  

15. A. M. Maiden, M. J. Humphry, and J. M. Rodenburg, J. Opt. Soc. Am. A 29, 1606 (2012). [CrossRef]  

16. E. H. R. Tsai, I. Usov, A. Diaz, A. Menzel, and M. Guizar-Sicairos, Opt. Express 24, 29089 (2016). [CrossRef]  

17. J. Dou, Z. Gao, J. Ma, C. Yuan, Z. Yang, and L. Wang, Opt. Laser Eng. 98, 56 (2017). [CrossRef]  

18. J. W. Goodman, Introduction to Fourier Optics, 4th ed. (WH Freeman, 2017).

19. J. M. Rodenburg and R. H. T. Bates, Philos. Trans. R. Soc. London, Ser. A 339, 521 (1992). [CrossRef]  

20. D. D. Nolte, Optical Interferometry for Biology and Medicine (Springer, 2011).

21. A. Maiden, D. Johnson, and P. Li, Optica 4, 736 (2017). [CrossRef]  

22. O. Bunk, M. Dierolf, S. Kynde, I. Johnson, O. Marti, and F. Pfeiffer, Ultramicroscopy 108, 481 (2008). [CrossRef]  

23. A. M. Maiden, J. M. Rodenburg, and M. J. Humphry, Opt. Lett. 35, 2585 (2010). [CrossRef]  

24. M. Guizar-Sicairos, M. Holler, A. Diaz, J. Vila-Comamala, O. Bunk, and A. Menzel, Phys. Rev. B 86, 1 (2012). [CrossRef]  

25. M. Stockmar, P. Cloetens, I. Zanette, B. Enders, M. Dierolf, F. Pfeiffer, and P. Thibault, Sci. Rep. 3, 1927 (2013). [CrossRef]  

26. M. Odstrcil, A. Menzel, and M. Guizar-Sicairos, Opt. Express 26, 3108 (2018). [CrossRef]  

Cited By

Optica participates in Crossref's Cited-By Linking service. Citing articles from Optica Publishing Group journals and other participating publishers are listed here.

Alert me when this article is cited.


Figures (5)

Fig. 1.
Fig. 1. Axial misalignment in the sample–detector distance results in scan grid miscalibration. The black coordinates (dashed line) illustrate an inflated scan grid as compared to the true encoder positions (gray coordinates, solid line). The depicted situation arises when underestimating the sample–detector distance, while an overestimation would result in a compressed scan grid.
Fig. 2.
Fig. 2. Experimental setup. A spatially filtered (L, lens; PH, pinhole) beam is focused to produce a divergent beam illuminating a sample mounted on a $xy$ translation stage. The diffraction data are recorded in a lensless geometry.
Fig. 3.
Fig. 3. Ptychographic reconstruction (a), (b) with autofocus and (c), (d) without autofocus using an initial object–detector distance of $ {z_0} = 35.5\;{\rm mm} $ . (e) Estimated sample–detector distance $ z $ versus iteration with varying initial estimates $ {z_0} $ . (a), (b) correspond to the central dotted-dashed line in (e).
Fig. 4.
Fig. 4. (a) Due to refraction at the glass–air interface and assumed free-space propagation from the sample to the detector, the autofocusing algorithm recovers a virtual point source inside the specimen. (b) Experimental geometry for multislice ptychography.
Fig. 5.
Fig. 5. Comparison of (a) single- and (b) multislice amplitude reconstructions of crossed fingerprints. (b) Both object slices projected into the same plane. (c) 3PIE beam reconstruction. Hue and brightness show phase and amplitude, respectively. (d) Overlay of back (green, illumination-sided) and front (red, detector-sided) slices of object reconstruction.

Tables (1)

Tables Icon

Algorithm 1. Axial position correction algorithm (zPIE)

Equations (7)

Equations on this page are rendered with MathJax. Learn more.

p ¯ j = D r j λ ( z ± δ z ) p j D r j λ z 2 δ z ,
O ( x , y , z ) = F 1 H k Δ z ( f x , f y ) F O ( x , y , 0 ) ,
H k Δ z ( f x , f y ) = exp [ i 2 π / λ k Δ z 1 ( f x x ) 2 ( f y y ) 2 ] .
Δ z = λ ( 2 z / D ) 2 .
S ( z ) = | x O ( x , y , z ) | 2 + | y O ( x , y , z ) | 2 + ϵ d x d y ,
S ( z ) S ( z ) + ( z z ) z S ( z ) + 1 2 ( z z ) 2 z 2 S ( z ) ,
S ( z ) S ( z ) + 1 2 ( z z ) 2 z 2 S ( z ) .
Select as filters


Select Topics Cancel
© Copyright 2024 | Optica Publishing Group. All rights reserved, including rights for text and data mining and training of artificial technologies or similar technologies.