All Projects → flatironinstitute → Normcorre

flatironinstitute / Normcorre

Licence: gpl-2.0
Matlab routines for online non-rigid motion correction of calcium imaging data

Programming Languages

matlab
3953 projects

Projects that are alternatives of or similar to Normcorre

Boj Autocommit
When you solve the problem of Baekjoon Online Judge, it automatically commits and pushes to the remote repository.
Stars: ✭ 60 (-20%)
Mutual labels:  algorithm
Mabalgs
👤 Multi-Armed Bandit Algorithms Library (MAB) 👮
Stars: ✭ 67 (-10.67%)
Mutual labels:  algorithm
Sobel
Sobel Filter algorithm in JavaScript.
Stars: ✭ 69 (-8%)
Mutual labels:  algorithm
Dijkstra Cartography
Using Dijkstra's algorithm ("finding the shortest paths between nodes in a graph") to draw maps 🌍.
Stars: ✭ 1,112 (+1382.67%)
Mutual labels:  algorithm
Advancedeast
AdvancedEAST is an algorithm used for Scene image text detect, which is primarily based on EAST, and the significant improvement was also made, which make long text predictions more accurate.https://github.com/huoyijie/raspberrypi-car
Stars: ✭ 1,139 (+1418.67%)
Mutual labels:  algorithm
Books
Awesome Books
Stars: ✭ 66 (-12%)
Mutual labels:  algorithm
Lgenerics
Generic algorithms and data structures for Lazarus/Free Pascal
Stars: ✭ 59 (-21.33%)
Mutual labels:  algorithm
Leetcode Solutions
LeetCode Solutions in Objective - C or Swift. At least one question every day
Stars: ✭ 70 (-6.67%)
Mutual labels:  algorithm
Halfrost Field
✍🏻 这里是写博客的地方 —— Halfrost-Field 冰霜之地
Stars: ✭ 10,414 (+13785.33%)
Mutual labels:  algorithm
Codeigniter4 Auth
A simple authentication library for CodeIgniter 4.
Stars: ✭ 70 (-6.67%)
Mutual labels:  registration
Algorithms Cheatsheet Resources
🤓All the geeky stuffs you need to know at one place!
Stars: ✭ 60 (-20%)
Mutual labels:  algorithm
Leetcode
👏🏻 leetcode solutions for Humans™
Stars: ✭ 1,129 (+1405.33%)
Mutual labels:  algorithm
Usaco
General Resources for Competitive Programming
Stars: ✭ 1,152 (+1436%)
Mutual labels:  algorithm
Kactl
KTH Algorithm Competition Template Library (... eller KTHs AC-tillverkande lapp)
Stars: ✭ 1,106 (+1374.67%)
Mutual labels:  algorithm
Smqtk
Python toolkit for pluggable algorithms and data structures for multimedia-based machine learning.
Stars: ✭ 69 (-8%)
Mutual labels:  algorithm
Bitp0wn
Algorithms to re-compute a private key, to fake signatures and some other funny things with Bitcoin.
Stars: ✭ 59 (-21.33%)
Mutual labels:  algorithm
Mono React
Create React from zero series
Stars: ✭ 67 (-10.67%)
Mutual labels:  algorithm
Algorithm Playground
An (old) and unstructured (messy tbh) collection of programming exercises.
Stars: ✭ 75 (+0%)
Mutual labels:  algorithm
Algorithm
📌 Notes and Codes for studying data structures and algorithm
Stars: ✭ 71 (-5.33%)
Mutual labels:  algorithm
Hackerrank
This is the Repository where you can find all the solution of the Problems which you solve on competitive platforms mainly HackerRank and HackerEarth
Stars: ✭ 68 (-9.33%)
Mutual labels:  algorithm

Join the chat at https://gitter.im/epnev/ca_source_extraction

NoRMCorre: Non-Rigid Motion Correction

This package provides a Matlab implementation of the NoRMCorre algorithm [1], and can be used for online piecewise rigid motion correction of 2d (planar) or 3d (volumetric) calcium imaging data.

Citation

If you find this package useful please cite the companion paper [1]:

@article{pnevmatikakis2017normcorre,
  title={NoRMCorre: An online algorithm for piecewise rigid motion correction of calcium imaging data},
  author={Pnevmatikakis, Eftychios A and Giovannucci, Andrea},
  journal={Journal of neuroscience methods},
  volume={291},
  pages={83--94},
  year={2017},
  publisher={Elsevier}
}

Synopsis

The algorithm operates by splitting the field of view into a set of overlapping patches. For each patch and each frame a rigid translation is estimated by aligning the patch against a template using an efficient, FFT based, algorithm for subpixel registration [2]. The estimated set of translations is further upsampled to a finer resolution to create a smooth motion field that is applied to a set of smaller overlapping patches. Extra care is taken to avoid smearing caused by interpolating overlapping patches with drastically different motion vectors. The registered frame is used to update the template in an online fashion by calculating a running/mean of past registered frames. The pipeline is summarized in the figure below.

Alt text

Code details

See the function demo.m for an example of the code. The algorithm is implemented in the function normcorre.m. If you have access to the parallel computing toolbox, then the function normcorre_batch.m can offer speed gains by enabling within mini-batch parallel processing. The user gives a dataset (either as 3D or 4D tensor loaded in RAM or memory mapped, or a pointer to a .tiff stack or .hdf5 file), and a parameters struct options. Optionally, an initial template can also be given. The algorithm can also be used for motion correction of 1p micro-endoscopic data, by estimating the shifts on high pass spatially filtered version of the data. See the script demo_1p.m for an example.

The algorithm can also be ran using the MotionCorrection object. See demo_mc_class.m for an example on how to use the object for 2p and 1p data.

The options struct can be set either manually or by using the function NoRMCorreSetParms.m. Some parameters of the options struct are the following:

Parameter name Description
d1,d2,d3 dimensions of field of view
grid_size size of non-overlapping portion of each patch the grid in each direction (x-y-z)
overlap_pre size of overlapping region in each direction before upsampling
mot_uf upsampling factor for smoothing and refinement of motion field
overlap_post size of overlapping region in each direction after upsampling
max_shift maximum allowed shift for rigid translation
max_dev maximum deviation of each patch from estimated rigid translation
upd_template update the template online after registering some frames
bin_width length of bin over which the registered frames are averaged to update the template
init_batch number of frames to be taken for computing initial template
iter number of times to go over the dataset
output_type type of output registered file
phase_flag flag for using phase correlation
correct_bidir check for offset due to bidirectional scanning (default: true)

The performance of registration can be evaluated using the function motion_metrics.m. The function simply computes the correlation coefficient of each (registered) frame, with the mean (registered) frame across time, the mean registered frame, and its crispness.

Developers

Eftychios A. Pnevmatikakis, Flatiron Institure, Simons Foundation

External packages

This package includes functions from the following packages

Integrations

This package will be integrated with the Matlab code for source extraction and deconvolution using CNMF.

A python version of this algorithm developed from Andrea A. Giovannuci is included as part of the CaImAn package that provides a complete pipeline for calcium imaging data pre-processing.

Although the two implementations give almost identical results for the same input file, there are some slight differences in the way they are called and their capabilities. These differences are highlighted here.

More details, contact information, and citing NoRMCorre

Check the wiki for more details and some frequently asked questions.

Please use the gitter chat room for questions and comments, and create an issue for any bugs you might encounter.

If you find this package useful please cite the following paper:

Eftychios A. Pnevmatikakis and Andrea Giovannucci, NoRMCorre: An online algorithm for piecewise rigid motion correction of calcium imaging data, Journal of Neuroscience Methods, vol. 291, pp 83-94, 2017; doi: https://doi.org/10.1016/j.jneumeth.2017.07.031

Acknowledgements

The 2p example dataset is kindly provided from Andrea Giovannucci, taken at Wang lab (Princeton University). The 1p example dataset is kindly provided by Daniel Aharoni and Peyman Golshani (UCLA, Miniscope project).

References

[1] Eftychios A. Pnevmatikakis and Andrea Giovannucci, NoRMCorre: An online algorithm for piecewise rigid motion correction of calcium imaging data, Journal of Neuroscience Methods, vol. 291, pp 83-94, 2017; doi: https://doi.org/10.1016/j.jneumeth.2017.07.031

[2] Guizar-Sicairos, M., Thurman, S. T., & Fienup, J. R. (2008). Efficient subpixel image registration algorithms. Optics letters, 33(2), 156-158. Matlab implementation available here.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].