PatchWarp is an image processing pipeline for neuronal calcium imaging data. It can correct complex image distortions that slowly occur during long imaging sessions. First, the pipeline performs rigid motion corrections by iterative re-estimation of template images. Then, the imaging field is split into user-specified number of subfields. A gradient-based algorithm independently finds the best affine transformation matrix for each frame of each subfield to correct the across-time image distortion of each subfield. The distortion-corrected subfields are stitched together like patchwork to reconstruct the distortion-corrected whole imaging field. PatchWarp can be also used to register images from different imaging sessions for longitudinal activity analyses.
Before (Left) and after (Right) PatchWarp warp correction for within-session image distortions
(Example 2.25 hrs in vivo two-photon calcium imaging with complex image distortions)
Before (Left) and after (Right) PatchWarp across-session image registration
(A later imaging session (cyan) was registered to an earlier imaging session (red))
Download files from this github repository, and add all files to your MATLAB path.
Please check example demo files.
For within-session distortion correction, please check patchwarp_demo.m.
For across-session image registration, please check patchwarp_across_sessions_demo.m.
Example citation format for the preprint:
- Hattori, R. and Komiyama, T. (2021). PatchWarp: Corrections of non-uniform image distortions in two-photon calcium imaging data by patchwork affine transformations. bioRxiv 10.1101/2021.11.10.468164.
Software DOI from Zenodo: