Rev Sci Instrum. 2026 Aug 1;97(8):081305. doi: 10.1063/5.0332420.
ABSTRACT
Time-lapse scanning tunneling microscopy (STM) captures how surface structures evolve in real time, but extracting quantitative kinetics from the resulting image series is hampered by drifts and the labor of frame-by-frame processing. We present AutoSPy, a modular software package that automates the conversion of raw time-lapse STM image stacks into analyzable time-series measurements. AutoSPy aligns consecutive frames using scale-invariant feature transform feature matching with RANSAC-based outlier rejection and an affine registration model, correcting not only translational drift but also drift-induced rotation and anisotropic distortion. An adaptive flattening routine combining Sobel gradient detection, Otsu thresholding, region growing, and least-squares plane fitting standardizes background subtraction across large datasets. For analysis, it integrates the Segment Anything Model 2 to segment and track user-selected features across registered frames, yielding trajectories, displacement statistics, and time-dependent area changes for clusters and vacancies with minimal manual input. AutoSPy, thus, provides a generalizable toolkit for quantitative studies of dynamic surface evolution and kinetics under working conditions.
PMID:42663515 | DOI:10.1063/5.0332420