## 1.

## Introduction

High-resolution microscopic imaging presents fine details of the samples and becomes an indispensable tool for biological observation, medical diagnosis, and material analysis.^{1}^{,}^{2} To realize ideal imaging quality and spatial resolution, samples should always be sliced before being observed. Generally, these sample slices have the thickness of several micrometers and are roughly transparent objects, to obtain a high-contrast image with a common wide-field microscope, sample staining is required for most applications, though it not only requires complicated sample pretreating but also may damage the sample itself. Phase imaging is an alternative technique to realize high-contrast imaging without sample staining, where the spatial features of the samples are shown with the phase retardation of the transmitted light rather than the energy attenuation. Digital holography is a well-developed quantitative phase imaging technique, which can reconstruct both the amplitude and phase images of the sample simultaneously.^{3}^{–}^{7} Compared to the phase contrast microscopy and differential interference contrast microscopy, which are mainly for qualitative observations, digital holography can provide quantitative information on the sample amplitude and phase distributions. However, the additional reference beam makes the imaging system complicated and sensitive to environmental disturbances. Transport of intensity equation (TIE)-based phase microscopy is a noninterference phase sensing technique,^{8}^{–}^{15} which has a much lower requirement on the stability of the imaging system and working environment. However, like other lens-based imaging techniques, the image quality and accuracy of TIE heavily depend on the quality of imaging optics.

Coherent diffraction imaging (CDI), which is especially developed to solve the problems related to the lack of high-quality optics in the regime of x-ray, can retrieve both the amplitude and the phase of samples from recorded diffraction patterns via iterative computations. Since no lens or other complex optics is required, its resolving capability is only limited by the numerical aperture of the imaging system, and the diffraction limited resolution can be reached in theory. Unfortunately, the performance of traditional CDI algorithms, including the Gerchberg–Saxton algorithm,^{16} Fienup’s error reduction, hybrid input–output algorithms,^{17}^{,}^{18} and axial multi-intensity algorithm,^{19} are not ideal in terms of poor reliability, small field of view, and slow convergence speed. Ptychographical iterative engine (PIE),^{20}^{–}^{26} which scans the object through a localized illuminating probe to a raster of positions and records all the diffraction patterns formed in the far field, can reconstruct the transmission function of the sample and the complex amplitude of the illumination accurately and rapidly with two counterpart updating formulas from the recorded diffraction patterns array. Compared to traditional CDI algorithms, PIE has outstanding advantages of fast convergence speed, high reconstruction quality, and theoretically infinite field of view, and accordingly it is regarded as a breakthrough of the CDI technique. PIE can also be adopted in the Fourier frequency domain to realize the so-called Fourier ptychographic microscopy,^{27}^{,}^{28} which does not require purely coherent illumination and extends the application range of PIE remarkably. Additionally, considering the reconstruction of other CDI techniques is only the exiting field from the sample, PIE can reconstruct the sample and the illumination separately and simultaneously, so the reconstructed image is free of the aberration from the illumination beam, and it lowers the requirement on the quality of the illumination optics. This is another outstanding advantage of PIE over other CDI techniques.

In the data acquisition, the sample should be scanned to many positions relative to a static illumination probe with a proper overlapping ratio between two neighboring illuminated regions.^{29} High information redundancy introduced by a vast number of diffraction patterns is one prerequisite for high-quality reconstruction in PIE. Since about $10\times 10$ diffraction patterns are recorded in most experiments to obtain satisfactory reconstruction, several minutes are often needed for a mechanical translation stage-based PIE system to finish the data acquisition, and high stability is required for both imaging system and working environment. Therefore, speedy PIE design using fast scanning devices to record as few diffractions patterns as possible is required. A kind of aperture scanning PIE was proposed recently,^{30} where a parallel beam is incident on a tiny aperture to form the illumination on the sample, and faithful information of the sample can be reconstructed from few diffraction intensities sequentially recorded when the aperture is changed to various sizes step by step. Since many fewer diffraction patterns are required, the data acquisition time can be remarkably reduced; however, various experimental problems should be solved before this method can be realized in practices. For example, it is impossible to obtain a perfectly planar illuminating beam on the variable aperture, and both the position and the shape of the aperture cannot be known exactly in experiments. In this paper, an improved variable aperture-based PIE (vaPIE) is designed, and the variable aperture is generated with a digital micromirror device (DMD), at the same time, the reconstruction algorithm is correspondingly modified to make it applicable for real experiments. To be specific, unlike the original algorithm processing the reconstruction between the detector plan and the sample plane,^{30} the modified algorithm carries out the reconstruction among the aperture plane, the sample plane, and the detector plane to retrieve the information of both sample and aperture, thus the illumination beam on the variable aperture needs not to be ideally planar, as well as both the shape and the center of the aperture. The underlying physics for this method to realize fast PIE imaging with less diffraction patterns is similar to that of the probe-diversity ptychography,^{31} which applies two probes to record the diffraction patterns and then can mathematically change the searching step more effectively than standard single-probe PIE.^{32}^{,}^{33} The vaPIE achieves the probe diversity with more probes using size changing apertures; therefore, it is more robust in avoiding the stagnation of local minimizations during the iterative computation.

In this paper, the feasibility of the vaPIE is demonstrated both numerically and experimentally, and it is found that the satisfactory reconstruction can be obtained from only 12 diffraction patterns recorded within 3 s. Moreover, both the shape and position of the apertures need not to be known exactly. The principle of the vaPIE is analyzed in Sec. 2, and the feasibility of this method is verified both numerically in Sec. 3 and experimentally with visible light in Sec. 4.

## 2.

## Principle

The principle of vaPIE is shown in Fig. 1, where Fig. 1(a) shows the data collection procedure and Fig. 1(b) shows the reconstruction process. In Fig. 1(a), the roughly parallel beam is incident on the $n$’th ($n=1,\dots ,N$) aperture ${S}_{n}(r)=\{\begin{array}{l}1,r<{r}_{n}\\ 0,r\ge {r}_{n}\end{array}$, and the exiting light from the aperture forms the probe ${P}_{n}(r)$ incident on the sample after propagating a distance of ${d}_{1}$. The diffraction intensity ${I}_{n}(r)$ is recorded by an image recorder with the distance ${d}_{2}$ behind the sample. Assuming the transmitting function of the sample and the illumination on the aperture as $O(r)$ and $E(r)$, respectively, the illumination on the sample and the diffraction at the recording plane can be calculated as ${P}_{n}(r)={\mathrm{F}}_{{d}_{1}}[E(r){S}_{n}(r)]$ and ${U}_{n}(r)={F}_{{d}_{2}}[{P}_{n}(r)O(r)]=|{U}_{n}(r)|\xb7\mathrm{exp}[i{\phi}_{n}(r)]$, where ${\mathrm{F}}_{d}$ represents the Fresnel propagation of distance $d$.

The iterative reconstructing computation is carried out with the following steps after two uniform initial guesses are given to the illumination $E(r)$ and the sample function $O(r)$, respectively.

1. In the $m$’th round iterative reconstruction, the $n$’th illuminating probe ${P}_{m,n}(r)$ on the sample is calculated as

2. The transmitting field of the sample ${T}_{m,n}(r)$ and the complex field at the recording plane are computed as

3. Replace the modulus of ${U}_{m,n}(r)$ with the square root of the recorded diffraction intensity ${I}_{n}(r)$ and keep its phase unchanged as

4. Backpropagate the updated complex field ${U}_{m,n}^{\prime}(r)$ to the sample plane as

5. Update the probe light ${P}_{m,n}(r)$ and the sample function with Eq. (5), where both $\alpha $ and $\beta $ are constants with values between 0 and 1

## Eq. (5)

$${O}_{m}(r)={O}_{m}(r)+\frac{|{P}_{m,n}(r)|}{|{P}_{m,n}(r){|}_{\mathrm{max}}}\frac{{P}_{m,n}^{*}(r)}{[|{P}_{m,n}(r)|+\alpha ]}[{T}_{m,n}^{\prime}(r)-{T}_{m,n}(r)]\phantom{\rule{0ex}{0ex}}{P}_{m,n}(r)={P}_{m,n}(r)+\frac{|{O}_{m}(r)|}{|{O}_{m}(r){|}_{\mathrm{max}}}\frac{{O}_{m}^{*}(r)}{[|{O}_{m}(r)|+\beta ]}[{T}_{n,j}^{\prime}(r)-{T}_{n,j}(r)].$$6. Propagate ${P}_{m,n}(r)$ to the aperture plane and update the illuminating field ${E}_{m}(r)$ as

7. Jump to step 1 until all the aperture sizes are addressed.

8. Calculate the residual error $\u03f5$ with Eq. (7), if the accuracy meets the requirement, the iteration stops, or else jump to step 1 to start another round of iterative computation

Since the shape of the aperture forming the illuminating probes $P(r)$ cannot be known exactly in practice, in the iterative computations, the aperture size used in Eq. (6) should be slightly larger than the real value, and it will be discussed in detail in Sec. 3.

## 3.

## Numerical Simulations

To check the performance of the vaPIE, numerical simulations were used to determine the main parameters for real experiments. In simulations, the distances of the sample to the aperture plane and that to the recording plane were set as 315 and 18 mm, respectively. The wavelength was 632.8 nm, and the pixel size of the detector was $7.4\text{\hspace{0.17em}\hspace{0.17em}}\mu \mathrm{m}$. The diameter of the circular aperture was scanned from 0.74 to 2.54 mm with an increment step of 0.15 mm, and 12 frames of diffraction patterns were captured for reconstructing the complex transmitting function of the sample. Figure 2(a) shows the setting amplitude and phase distributions of the sample, and Fig. 2(b) exhibits all the diffraction patterns formed at the recording plane. With the above described reconstruction algorithm, the reconstructed phase and amplitude distributions with 50 iterations are shown in Fig. 2(c), where the residual error calculated by Eq. (7) was only about 1.0%. Since only 12 diffraction patterns are required, compared to the common PIE, which often needs 100 or more diffraction patterns and about 10 min for data acquisition, the data acquisition of this method is remarkably accelerated, making the vaPIE more applicable in practice.

In the simulations shown in Fig. 2, both the shape and the position of each tiny aperture are assumed to be ideally accurate; however, in real experiments, both of them cannot be known exactly. Thus, the influence of the shape and position error on the reconstruction accuracy should be quantitatively evaluated. First, the influence of the aperture deviation was discussed in detail. Figure 3(a) shows the comparison between the apertures used for diffraction patterns calculation and sample reconstruction, indicating the definition of the aperture deviation. Figure 3(b) shows the convergence speed changes with different aperture deviations, where the reconstruction error increases with the inaccuracy of the aperture size. When the size of the reconstructing aperture is 20% larger than that of the real aperture, the reconstruction error increases from 1% to about 2%, and the reconstructed image shown in Fig. 3(c) is still of high quality; but when the size of the reconstructing aperture is 33.3% larger than that of the real aperture, the reconstruction error increases to 6%, and the reconstructed image is seriously blurred. This means that in real experiments, good reconstruction can still be available when the size and the shape of the aperture are only approximately known.

The positions or the centers of all the apertures are difficult to keep unchanged in the whole data acquisition in experiments, in other words, the positions of the apertures cannot be known exactly in practices. To find out the influence of the center deviation on the reconstruction quality, another set of simulations was carried out in Fig. 4, where Fig. 4(a) shows the definition of the center deviation $\mathrm{\Delta}d$, and Fig. 4(b) shows the convergence and the residual reconstruction error according to various center deviations. It is found that with the increasing center deviation, the convergence speed obviously slows down and the residual error in the reconstructions increases remarkably. However, for the case of center deviation as 6% shown in Fig. 4(c), the residual error in the final reconstruction is only about 3.5%, proving that the proposed vaPIE is still robust in sample retrieval even with existing center deviations.

During the data acquisition, the size of the aperture forming the illumination on the sample increases step by step, Fig. 5 shows the simulation results reflecting the influence of the step size $\mathrm{\Delta}r$ on the reconstruction quality, where Fig. 5(a) shows the definition of $\mathrm{\Delta}r$, and Fig. 5(b) shows the convergence speeds and the residual error of the reconstruction when the aperture size increases from 0.74 to 2.54 mm with $\mathrm{\Delta}r=0.05$, 0.10, 0.15, 0.20, and 0.25 mm, respectively. It is found that the reconstruction error increases slowly with the step size, for the step size of 0.05 mm, the residual error is $<1\%$, and for the step size of 0.25 mm, the residual error is about 6%. The underlying physics for the influence of step size on the reconstruction quality is that, with the increasing step size, fewer diffraction patterns and accordingly less information on the object are recorded and then the reliability of the reconstruction degrades.

The numerical simulations illustrated above show that the proposed vaPIE can reconstruct both the phase and amplitude images simply from diffraction patterns obtained using a variable aperture to form the changing illumination on the sample. Moreover, according to the numerical simulation, the size, the shape, and the position need not to be known exactly in the reconstruction, and the step size of the changing aperture should be as small as possible to record as many diffraction patterns as needed to achieve faithful reconstruction.

## 4.

## Experiments

To verify the feasibility of the proposed method experimentally, a series of experiments were proposed with visible light. Figure 6(a) shows the experimental setup, where the illumination on the object was a parallel He-Ne laser beam reflected from a DMD (DLP Discovery D4100, Texas Instruments). Since DMD can be programmed into reflecting mirrors of any shape to reflect the laser beam to the sample, it acted as the variable aperture in experiments. The top row of Fig. 6(b) shows three apertures of different sizes, where the white regions within the red circles are the effective reflecting regions and the bottom row shows the corresponding recorded diffraction patterns. The sample was placed 315 mm behind the DMD, and a CCD camera (AVT Pike F421B, Germany) positioned 18 mm behind the sample was used to record the diffraction patterns. During the data acquisition, the radius of the aperture increased from 54 pixels (0.74 mm) to 185 pixels (2.54 mm), and the radius increment was 11 pixels (0.15 mm). The exposure time of the CCD was set to 200 ms, and the whole data acquisition was finished within 3 s to record 12 diffraction patterns. The final field of view is roughly estimated as ${2}^{2}\pi \approx 12\text{\hspace{0.17em}\hspace{0.17em}}{\mathrm{mm}}^{2}$ determined by the central region of the largest aperture. Note that the largest field of view achievable for this method is mainly limited by the size of the DMD, and this can be a shortcoming compared to common PIE, which has infinite field of view in theory. However, since DMD has a size of $10\text{\hspace{0.17em}\hspace{0.17em}}\mathrm{mm}\times 14\text{\hspace{0.17em}\hspace{0.17em}}\mathrm{mm}$, this size is large enough for most applications.

A 1951 USAF resolution target (Edmund Optics) was first used to test the resolution of the imaging system. Figure 7(a) lists partial diffraction patterns recorded with different apertures. Figure 7(b1) is the reconstructed image and Fig. 7(b2) is the zoomed-in image, where we can find that the third element of group six can be clearly resolved as shown in Fig. 7(c), corresponding to a resolution of $6.20\text{\hspace{0.17em}\hspace{0.17em}}\mu \mathrm{m}$. Since the probe generated by a small aperture is remarkably smaller than that of a large aperture, the image will be updated more times at the center than at the edge in the iterative computation from steps 1 to 7, the central region becomes clear first in the iterative computation, but after many rounds of iterations, the region close to the edge will also be updated for enough times and then becomes clear at last.

Next, two fixed biological samples were imaged to check the performance of the vaPIE: one was the corn section and another was the monocotyledon section. Figure 8 shows the reconstructed phase and amplitude images, where Figs. 8(a1) and 8(b1) are the two amplitude images, and Figs. 8(a2) and 8(b2) are the two corresponding phase images. It is found that the structure of each individual cell can be clearly identified, proving the high reconstruction quality of the proposed vaPIE. The structure of the deemed concentric circles can be found in these reconstructed images, and according to the simulations shown Fig. 5, this is the reconstruction noise related to the big increment step in changing the aperture size and can disappear when the finer increment step is used.

## 5.

## Conclusion

An improved vaPIE is proposed to reconstruct the sample amplitude and phase images, and its feasibility is verified both numerically and experimentally. Using a DMD to generate the aperture with variable sizes, the data acquisition of 12 frames of diffraction patterns can be finished within 3 s. Moreover, combining with the modified reconstruction algorithm to carry out the iterative computation among the aperture plane, the sample plane and the detector plane, satisfactory reconstruction can be obtained within 50 iterations. In other words, the vaPIE can realize speedy microscopic quantitative images by remarkably reducing the data acquisition and reconstruction time. At the same time, since the shape, the size, and the position of the variable aperture need not to be known exactly, the vaPIE is less dependent on the mechanical accuracy of the imaging system. Considering its advantages of fast convergence speed, rapid data acquisition, high reconstruction quality, and simplified setup, the proposed vaPIE can also be applied in many applications for scientific research.

## Disclosures

All of the authors have no relevant financial interests in this article and no potential conflicts of interest to disclose.

## Acknowledgments

This research was supported by the National Natural Science Foundation of China (Nos. U1730132, 61705092, 31522056, and 11647144), the Natural Science Foundation of Jiangsu Province of China (Nos. BK20130162 and BK20170194), the Shanghai Sailing Program (No. 17YF1407000), and the Fundamental Research Funds for the Central Universities (Nos. JUSRP115A14 and JUSRP51721B).