{"id":15716387,"url":"https://github.com/flatironinstitute/caiman-matlab","last_synced_at":"2026-04-10T10:02:27.568Z","repository":{"id":30856488,"uuid":"34414021","full_name":"flatironinstitute/CaImAn-MATLAB","owner":"flatironinstitute","description":"Complete Matlab pipeline for large scale calcium imaging data analysis","archived":false,"fork":false,"pushed_at":"2023-07-04T01:09:30.000Z","size":43470,"stargazers_count":259,"open_issues_count":10,"forks_count":150,"subscribers_count":55,"default_branch":"master","last_synced_at":"2026-01-02T05:00:44.531Z","etag":null,"topics":["calcium-imaging","matlab","roi-segmentation","source-extraction","spike","spike-deconvolution","spike-inference"],"latest_commit_sha":null,"homepage":"","language":"MATLAB","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flatironinstitute.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-04-22T20:27:11.000Z","updated_at":"2025-12-04T02:32:16.000Z","dependencies_parsed_at":"2022-07-10T04:00:36.221Z","dependency_job_id":"955c8c10-2883-4526-bd41-23a62a42db1f","html_url":"https://github.com/flatironinstitute/CaImAn-MATLAB","commit_stats":null,"previous_names":["epnev/ca_source_extraction"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/flatironinstitute/CaImAn-MATLAB","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flatironinstitute%2FCaImAn-MATLAB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flatironinstitute%2FCaImAn-MATLAB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flatironinstitute%2FCaImAn-MATLAB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flatironinstitute%2FCaImAn-MATLAB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flatironinstitute","download_url":"https://codeload.github.com/flatironinstitute/CaImAn-MATLAB/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flatironinstitute%2FCaImAn-MATLAB/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31637748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T07:40:12.752Z","status":"ssl_error","status_checked_at":"2026-04-10T07:40:11.664Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["calcium-imaging","matlab","roi-segmentation","source-extraction","spike","spike-deconvolution","spike-inference"],"created_at":"2024-10-03T21:45:23.025Z","updated_at":"2026-04-10T10:02:27.550Z","avatar_url":"https://github.com/flatironinstitute.png","language":"MATLAB","funding_links":[],"categories":[],"sub_categories":[],"readme":"CaImAn-MATLAB\n======\nA Computational toolbox for large scale **Ca**lcium **Im**aging data **An**alysis.\nThe code implements the CNMF algorithm [[1]](#neuron) 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.\n\nThis code is no longer maintained and is left available and unsupported, for any purpose users may be able to make of it. For any concerns relating to the code, you may be able to get some extremely limited support from the current maintainers of the python software package. Please do not file issues against this package as they will likely never be addressed (or seen). This package is not looking for a new maintainer; it is most appropriate to leave it as a historical archive.\n\n## Features and methods included\n\n* **Source extraction** \n\n    * Separates different sources based on constrained nonnegative matrix factorization (CNMF) [[1-2]](#neuron)\n    * Deals with heavily overlaping and neuropil contaminated movies     \n    * Selection of inferred sources using a [pre-trained convolutional neural network classifier](https://github.com/flatironinstitute/CaImAn-MATLAB/wiki/Component-classification-with-a-convolutional-neural-network)\n    * [Component registration across different sessions/days](https://github.com/flatironinstitute/CaImAn-MATLAB/wiki/Registering-ROIs-across-different-sessions-%5C--days) \n\n* **Denoising, deconvolution and spike extraction**\n\n    * Constrained foopsi method for inferring neural activity from fluorescence traces [[1]](#neuron)\n    * Near online implementation using the OASIS algorihtm [[3]](#oasis)\n    * MCMC algorithm for Bayesian spike inference [[4]](#mcmc)\n    \n* **Handling of very large datasets**\n\n    * [Memory mapping and parallel processing in patches](https://github.com/flatironinstitute/CaImAn-MATLAB/wiki/Processing-of-large-datasets)\n    \n* **Motion correction**\n\n    * Fast parallelizable non-rigid motion correction using the NoRMCorre algorithm [[5]](#normcorre). Separate standalone package can be found [here](https://github.com/simonsfoundation/NoRMCorre). It will be included in this package in the future.\n    \n2018: Renamed to CaImAn-MATLAB\n======\nWe 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](https://github.com/flatironinstitute/CaImAn) Python package. Everything else is the same. The old link ```https://github.com/epnev/ca_source_extraction``` redirects here.\n\n# Citation\n\nIf you use this code please cite the corresponding papers where original methods appeared (see References below), as well as: \n\n\u003ca name=\"caiman\"\u003e\u003c/a\u003e[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]](https://doi.org/10.1101/339564)\n\n# References\n\nThe following references provide the theoretical background and original code for the included methods. \n\n### Deconvolution and demixing of calcium imaging data\n\n\u003ca name=\"neuron\"\u003e\u003c/a\u003e[1] Pnevmatikakis, E.A., Soudry, D., Gao, Y., Machado, T., Merel, J., ... \u0026 Paninski, L. (2016). Simultaneous denoising, deconvolution, and demixing of calcium imaging data. Neuron 89(2):285-299, [[paper]](http://dx.doi.org/10.1016/j.neuron.2015.11.037). \n\n\u003ca name=\"struct\"\u003e\u003c/a\u003e[2] Pnevmatikakis, E.A., Gao, Y., Soudry, D., Pfau, D., Lacefield, C., ... \u0026 Paninski, L. (2014). A structured matrix factorization framework for large scale calcium imaging data analysis. arXiv preprint arXiv:1409.2903. [[paper]](http://arxiv.org/abs/1409.2903). \n\n\u003ca name=\"oasis\"\u003e\u003c/a\u003e[3] Friedrich J. and Paninski L. Fast active set methods for online spike inference from calcium imaging. NIPS, 29:1984-1992, 2016. [[paper]](https://papers.nips.cc/paper/6505-fast-active-set-methods-for-online-spike-inference-from-calcium-imaging), [[Github repository - Python]](https://github.com/j-friedrich/OASIS), [[Github repository - MATLAB]](https://github.com/zhoupc/OASIS_matlab).\n\n\u003ca name=\"mcmc\"\u003e\u003c/a\u003e[4] Pnevmatikakis, E. A., Merel, J., Pakman, A., \u0026 Paninski, L. Bayesian spike inference from calcium imaging data. In Signals, Systems and Computers, 2013 Asilomar Conference on (pp. 349-353). IEEE, 2013. [[paper]](https://arxiv.org/abs/1311.6864), [[Github repository - MATLAB]](https://github.com/epnev/continuous_time_ca_sampler).\n\n### Motion Correction\n\n\u003ca name=\"normcorre\"\u003e\u003c/a\u003e[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]](https://doi.org/10.1016/j.jneumeth.2017.07.031), [[Github repository - MATLAB]](https://github.com/simonsfoundation/normcorre).\n\nCode description\n=======\n\nThe best way to start is by looking at the various demos.\n- [demo_script.m](https://github.com/epnev/ca_source_extraction/blob/master/demo_script.m): A simple demo with a small dataset included in the repo to display the notation and basic operations\n- [demo_script_class.m](https://github.com/flatironinstitute/CaImAn-MATLAB/blob/master/demo_script_class.m): Replicates the [demo_script.m](https://github.com/epnev/ca_source_extraction/blob/master/demo_script.m) file in a cleaner way using a CNMF object.\n- [demo_patches.m](https://github.com/epnev/ca_source_extraction/blob/master/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.\n- [demo_patches_class.m](https://github.com/epnev/ca_source_extraction/blob/master/demo_patches_class.m): Similar to [demo_patches.m](https://github.com/epnev/ca_source_extraction/blob/master/demo_patches.m) but using the CNMF object.\n- [run_pipeline.m](https://github.com/epnev/ca_source_extraction/blob/master/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](https://github.com/epnev/ca_source_extraction/wiki/Complete-analysis-pipeline).\n- [3D/demo_3D.m](https://github.com/epnev/ca_source_extraction/blob/master/3D/demo_3D.m): Demo for processing of 3D volumetric imaging data.\n\n# Python\n\nA complete analysis Python pipeline including motion correction, source extraction and activity deconvolution is performed through the package [CaImAn](https://github.com/flatironinstitute/caiman). This package also includes methods for online processing of calcium imaging data and elements of behavioral analysis in head fixed mice. \n\nUsage and Documentation\n=======\nCheck the demo scripts and the [wiki](https://github.com/flatironinstitute/CaImAn-MATLAB/wiki) to get started.\n\nDependencies\n========\nThe following matlab toolboxes are needed for the default parameter settings:\n\n- Statistics and Machine Learning Toolbox\n- Image processing toolbox\n\nDepending on the settings the following toolboxes may also be required\n\n- Neural networks toolbox (required for component classifier)\n- Signal processing toolbox (recommended but not required)\n- Parallel computing toolbox (recommended for large datasets but not required)\n- Optimization toolbox (not required)\n\nDepending on the settings the following packages may also be required\n\n- 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**.\n- SPGL1 package from https://github.com/mpf/spgl1 (for solving constrained_foopsi using SPGL1)\n\n# Developers\n\nThis package was mainly developed and maintained by [Eftychios A. Pnevmatikakis](https://github.com/epnev) (Flatiron Institute, Simons Foundation) with help from a lot of [contributors](https://github.com/flatironinstitute/CaImAn-MATLAB/graphs/contributors).\n\n# Acknowledgements\n\nSpecial thanks to the following people for letting us use their datasets for our various demo files:\n\n* Weijian Yang, Darcy Peterka, Rafael Yuste, Columbia University\n* Sue Ann Koay, David Tank, Princeton University\n* Diego Pacheco Pinedo, Mala Murthy, Princeton University\n* Clay Lacefied, Randy Bruno, Columbia University\n\nLicense\n=======\n\nThis program is free software; you can redistribute it and/or\nmodify it under the terms of the GNU General Public License\nas published by the Free Software Foundation; either version 2\nof the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflatironinstitute%2Fcaiman-matlab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflatironinstitute%2Fcaiman-matlab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflatironinstitute%2Fcaiman-matlab/lists"}