Skip to content
Complete Matlab pipeline for large scale calcium imaging data analysis
MATLAB C++
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
3D
@CNMF
Sources2D
deconvolution fixed bugs related to thresholded_oasis #90 Jan 28, 2019
docs/notes
endoscope
tests
use_cases
utilities
.gitignore
CNMFSetParms.m
ISSUE_TEMPLATE.md
Initialization.fig
Initialization.m working on an init GUI to have the entire pipeline as a GUI. Aug 3, 2017
README.md Update README.md Jun 15, 2018
TODO.txt Modifying the demos to remove the old implementation of the GUI and a… Aug 13, 2017
constrained_foopsi.m fix deconvolution bug Feb 2, 2017
demoMovie.tif added demo file Jul 28, 2015
demo_GUI.m testing Nov 3, 2017
demo_patches.m change acceptance tests during run patches Nov 13, 2017
demo_patches_class.m change acceptance tests during run patches Nov 13, 2017
demo_script.m Update demo_script.m Apr 9, 2018
demo_script_class.m
documentation.pdf updated documentation Apr 11, 2016
estimate_percentile_level.m
initialize_components.m Update initialize_components.m Oct 13, 2016
license.txt
loadtiff.m
merge_components.m break if A and C are empty Jun 18, 2017
postProcessCNMF.m
preprocess_data.m
read_file.m
register_ROIs.m
run_CNMF_patches.m using different quality assessment threshold within patch processing Jul 23, 2018
run_pipeline.m better handling of data directories May 15, 2018
update_spatial_components.m allow seeding with binary masks and arbitrary background comps Jan 14, 2019
update_temporal_components.m
update_temporal_components_fast.m

README.md

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

CaImAn-MATLAB

A Computational toolbox for large scale Calcium Imaging data Analysis. The code implements the CNMF algorithm [1] for simultaneous source extraction and spike inference from large scale calcium imaging movies. Many more features are included (see below). The code is suitable for the analysis of somatic imaging data. Improved implementation for the analysis of dendritic/axonal imaging data will be added in the future.

Features and methods included

New: Renaming to CaImAn-MATLAB

We moved the code into the Flatiron Institute github account and renamed the repository to CaImAn-MATLAB to bring it more in touch with the CaImAn Python package. Everything else is the same. The old link https://github.com/epnev/ca_source_extraction redirects here.

Citation

If you use this code please cite the corresponding papers where original methods appeared (see References below), as well as:

[1] Giovannucci A., Friedrich J., Gunn P., Kalfon J., Koay S.A., Taxidis J., Najafi F., Gauthier J.L., Zhou P., Tank D.W., Chklovskii D.B., Pnevmatikakis E.A. (2018). CaImAn: An open source tool for scalable Calcium Imaging data Analysis. bioarXiv preprint. [paper]

References

The following references provide the theoretical background and original code for the included methods.

Deconvolution and demixing of calcium imaging data

[1] Pnevmatikakis, E.A., Soudry, D., Gao, Y., Machado, T., Merel, J., ... & Paninski, L. (2016). Simultaneous denoising, deconvolution, and demixing of calcium imaging data. Neuron 89(2):285-299, [paper].

[2] Pnevmatikakis, E.A., Gao, Y., Soudry, D., Pfau, D., Lacefield, C., ... & Paninski, L. (2014). A structured matrix factorization framework for large scale calcium imaging data analysis. arXiv preprint arXiv:1409.2903. [paper].

[3] Friedrich J. and Paninski L. Fast active set methods for online spike inference from calcium imaging. NIPS, 29:1984-1992, 2016. [paper], [Github repository - Python], [Github repository - MATLAB].

[4] Pnevmatikakis, E. A., Merel, J., Pakman, A., & Paninski, L. Bayesian spike inference from calcium imaging data. In Signals, Systems and Computers, 2013 Asilomar Conference on (pp. 349-353). IEEE, 2013. [paper], [Github repository - MATLAB].

Motion Correction

[5] Pnevmatikakis, E.A., and Giovannucci A. (2017). NoRMCorre: An online algorithm for piecewise rigid motion correction of calcium imaging data. Journal of Neuroscience Methods, 291:83-92 [paper], [Github repository - MATLAB].

Code description

The best way to start is by looking at the various demos.

  • demo_script.m: A simple demo with a small dataset included in the repo to display the notation and basic operations
  • demo_script_class.m: Replicates the demo_script.m file in a cleaner way using a CNMF object.
  • demo_patches.m: A larger demo displaying the process of memory mapping and spliting the field of view in patches to be processed in parallel and then combined.
  • demo_patches_class.m: Similar to demo_patches.m but using the CNMF object.
  • run_pipeline.m: Demo for the complete pipeline of motion correction, source separation and spike extraction for large datasets. More details about the pipeline can be found here.
  • 3D/demo_3D.m: Demo for processing of 3D volumetric imaging data.

Python

A complete analysis Python pipeline including motion correction, source extraction and activity deconvolution is performed through the package CaImAn. This package also includes method for online processing of calcium imaging data and elements of behavioral analysis in head fixed mice.

Usage and Documentation

Check the demo scripts and the wiki to get started.

Dependencies

The following matlab toolboxes are needed for the default parameter settings:

  • Statistics and Machine Learning Toolbox
  • Image processing toolbox

Depending on the settings the following toolboxes may also be required

  • Neural networks toolbox (required for component classifier)
  • Signal processing toolbox (recommended but not required)
  • Parallel computing toolbox (recommended for large datasets but not required)
  • Optimization toolbox (not required)

Depending on the settings the following packages may also be required

  • The CVX library which can be downloaded from http://cvxr.com/cvx/download/ (after unpacking CVX open Matlab and run cvx_setup from inside the CVX directory to properly install and add CVX to the Matlab path). CVX is no longer required.
  • SPGL1 package from https://github.com/mpf/spgl1 (for solving constrained_foopsi using SPGL1)

Developers

This package is mainly developed and maintained by Eftychios A. Pnevmatikakis (Flatiron Institute, Simons Foundation) with help from a lot of contributors.

Acknowledgements

Special thanks to the following people for letting us use their datasets for our various demo files:

  • Weijian Yang, Darcy Peterka, Rafael Yuste, Columbia University
  • Sue Ann Koay, David Tank, Princeton University
  • Diego Pacheco Pinedo, Mala Murthy, Princeton University
  • Clay Lacefied, Randy Bruno, Columbia University

Questions, comments, issues

Please use the gitter chat room (use the button above) for questions and comments and create an issue for any bugs you might encounter.

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

You can’t perform that action at this time.