Source-linked AI summary

moco: Fast Motion Correction for Calcium Imaging

Alexander Dubbs, James Guevara, Darcy S. Peterka, Rafael Yuste

arXiv:1506.06039v1cs.CV

TL;DR

Calcium imaging analysis requires fast motion correction, especially for closed-loop experiments where correction speed affects whether experiments can run in real time. The paper introduces moco, a Fourier-transform method combining downsampling, dynamic programming, and FFT-accelerated convolutions; it is reported as fast, accurate, and robust to large translations.

  • Problem

    Calcium imaging videos contain noise and motion artifacts that must be corrected before neural activity and network analyses, while slow correction prevents real-time closed-loop experiments.

  • Method

    moco aligns each image to a template by evaluating translations with normalized L2 differences, using downsampling, dynamic programming, FFT-accelerated convolutions, and local upsampling.

  • Results

    moco is faster than TurboReg for translation correction, slightly more accurate on synthetic videos with severe translational artifacts, and able to correct severely corrupted images.

  • Takeaways & Limitations

    moco provides an ImageJ-compatible tool for efficient calcium-image motion correction and is designed to remain robust to long translations.

Abstract

from arXiv · show

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.

1 Introduction

Calcium imaging enables observation of neural activity but requires motion correction before analysis. The paper presents moco as a fast, robust translation-correction method designed for calcium imaging and closed-loop experiments.

  • Motivation: Motion correction is the first analysis step because low-quality correction degrades ROI time-activity graphs and reconstructed neural networks.
  • Motivation: Slow motion correction can prevent real-time closed-loop experiments while the mouse is under the microscope.
  • Approach: moco combines downsampling and template-based alignment, avoiding unacceptable roundoff errors from correcting each image against the next.
  • Efficiency: Dynamic programming and two-dimensional FFT-accelerated convolutions make moco faster than TurboReg for translation-based motion correction.
  • Approach: moco compares every possible translation with a template and selects the translation minimizing the normalized L2 difference over the overlapping region.
  • Scope: The method is intended for calcium imaging videos with spurious translations, while Z-direction motion remains difficult to correct.

2 Mathematical Development

The method aligns each image to a template by searching translations that minimize an overlap-normalized L2 difference, then accelerates this search with dynamic programming and FFT-based convolution. Downsampling and cache-aware local upsampling support an overall O(mnT log(mn)) alignment procedure.

  • Translation objective: moco selects the translation (s, t) minimizing the area-normalized L2 difference over the overlapping region D.The allowed search satisfies max(|s|, |t|) < w, where w is user-specified.
  • Upsampling: After choosing the translation, moco upsamples by multiplying shifts by two and evaluating nine nearby offsets with a cache-aware algorithm.The local evaluations use u, v ∈ {0, −1, 1}.
  • Dynamic programming: The first two sums in the expanded objective are computed for all translations using dynamic programming in O(mn) time.This cost is unaffected by a constant amount of downsampling.
  • FFT acceleration: FFT-based convolution computes the remaining correlation terms for all translations in O(mn log(mn)) time.The rotated, zero-padded template is transformed with fft2, and elementwise products are used in the convolution calculation.
  • Overall complexity: The complete video alignment runs in O(mnT log(mn)) time after upsampling, where T is the number of video slides.Images larger than 256 × 256 are downsampled before the search.

3 Results

The evaluation compares moco with TurboReg and Image Stabilizer on real calcium-imaging videos and with TurboReg on synthetic videos with severe translational artifacts. moco is faster than TurboReg, slightly more accurate on the synthetic data, and corrects severely corrupted images.

  • Accuracy: moco is slightly more accurate than TurboReg on synthetic images with severe translational motion artifacts.All reported times are in seconds, and videos larger than 256 × 256 are downsampled once.
  • Speed: moco is faster than TurboReg in translation-mode comparisons using both TurboReg’s fast and accurate settings.The evaluation uses several real calcium-imaging videos and the first video image as the template for both methods.
  • Image correction: moco corrects the severe corruption visible in the first two frames of a real video.The corrected second frame matches the template after shifting it left, except in black regions.
  • Visual comparison: moco and TurboReg show superior performance to the compared alternatives in the mean-image visualization.Figure 2 compares corrected means from moco, TurboReg, Image Stabilizer, and an implementation of approach.
Loading 1506.06039v1…