Functional 2-photon microscopy is a key technology for imaging neuronal activity. The recorded image sequences, however, can contain non-rigid movement artifacts which requires high-accuracy movement correction. Variational optical flow (OF) estimation is a group of methods for motion analysis with established performance in many computer vision areas. However, it has yet to be adapted to the statistics of 2-photon neuroimaging data. In this work, we present the motion compensation method Flow-Registration that outperforms previous alignment tools and allows to align and reconstruct even low signal-to-noise ratio 2-photon imaging data and is able to compensate high-divergence displacements during local drug injections. The method is based on statistics of such data and integrates previous advances in variational OF estimation. Our method is available as an easy-to-use ImageJ / FIJI plugin as well as a MATLAB toolbox with modular, object oriented file IO, native multichannel support and compatibility with existing 2-photon imaging suites.

Video Results

Supplemental video 1 (drug injection sequence)

Supplemental video 2 (saline injection sequences)

Supplemental video 3 (layer23 - layer1 - layer5 - CaPKA)

Supplemental video 4 (Jupiter demo)

Code and Citation


The Flow-Registration toolbox will be available for download from GitHub soon.


Our paper preprint is available on BioRxiv.

Please cite our work with:

P. Flotho, S. Nomura, B. Kuhn and D. J. Strauss, “Software for Non-Parametric Image Registration of 2-Photon Imaging Data,” bioRxiv, 2021.

    author = {Flotho, P. and Nomura, S. and Kuhn, B. and Strauss, D. J.},
    title = {Software for Non-Parametric Image Registration of 2-Photon Imaging Data},
	elocation-id = {2021.07.25.453381},
	year = {2021},
	doi = {10.1101/2021.07.25.453381},
    publisher = {Cold Spring Harbor Laboratory},
    journal = {bioRxiv}