Skip to content
Open access

ZenReg: A modular Python platform for fast and memory-efficient N-dimensional microscopy image registration

Aug 2026 · bioRxiv · 1 citation · 31 references
Biology

Abstract

Motion artifacts are almost unavoidable in functional time-lapse and structural volumetric multiphoton microscopy. They arise from respiration, heartbeat, locomotion, awake behavior, instrument heating, mechanical vibration, and slow drift, while the recorded signal is often photon-limited, blurred by scattering, and biologically time varying. Consequently, motion correction is frequently an essential prerequisite for quantitative bioimage analysis rather than a merely cosmetic preprocessing operation. Edge- and landmark-centric registration strategies are often poorly matched to these data because useful structures may be sparse, diffuse, out-of-focus, or changing in fluorescence intensity. We present ZenReg, an open-source Python platform that formulates common 2D+t, 3D, and 3D+t microscopy registration tasks as modular, geometry-preserving alignment problems. ZenReg combines FFT- and intensity-based translational registration, projection-based rotation estimation, piecewise translational motion correction, and dense or sparse six-degree-of-freedom volume registration within one canonical microscopy stack model. Disk-backed arrays support chunked processing of large or remote image stacks, and every run can produce registered images together with shift tables, correlation metrics, summary plots, and machine-readable settings. In synthetic benchmarks with known ground truth, ZenReg recovered global 2D and 3D translations with subpixel accuracy across moderate noise and drift regimes. High-noise and large-drift tests separated the registration models: FFT-based methods failed abruptly once image information or shared support became insufficient, intensity-based translational alignment degraded more gradually under severe noise, and piecewise translational correction improved spatially varying local motion where a single global transform was inadequate. In real biological data, ZenReg increased mean template correlation in a 3000-frame calcium-imaging movie from 0.334 to 0.487 and recovered imposed continuous three-photon volume motion with a mean translational error of 0.055 px or, for six-degree-of-freedom rigid motion, a mean shift error of 0.068 px and a mean rotation error of 0.015 degrees. By coupling modular registration backends to transparent sidecar outputs, ZenReg turns motion correction into an inspectable, memory-aware, and FAIR-oriented component of reproducible bioimage analysis.

Read PDF