  Motion correction is the first in a pipeline of algorithms to analyze calcium
imaging videos and extract biologically relevant information, for example the
network structure of the neurons therein. Fast motion correction would be
especially critical for closed-loop activity triggered stimulation experiments,
where accurate detection and targeting of specific cells in necessary. Our
algorithm uses a Fourier-transform approach, and its efficiency derives from a
combination of judicious downsampling and the accelerated computation of many
$L_2$ norms using dynamic programming and two-dimensional, fft-accelerated
convolutions. Its accuracy is comparable to that of established community-used
algorithms, and it is more stable to large translational motions. It is
programmed in Java and is compatible with ImageJ.
