Yun Xie, Bianli Zhao, Han Yue, Zhiyi Huang, Youyang Zhou, Rui Zhang, Steve F Shu
In ptychography, errors in the sample-to-detector distance disturb the sampling relation and can cause defocused or unstable reconstructions. We demonstrate a focus-adaptive ptychographic iterative engine (FA-PIE) that refines this distance during reconstruction. In each focus-update cycle, a complex-valued region of interest from the current object estimate is propagated to candidate axial planes using the angular-spectrum model, and the best-focused plane is identified by a gradient-based focus response with golden-section search. Experiments on a USAF 1951 resolution target and a rabbit testis tissue section show stable convergence from different initial distances and improved structural recovery, while FA-PIE achieves a speedup of more than fourfold over the 1000-iteration z ptychographic iterative engine (zPIE) baseline.