The HNCcorr algorithm identifies cell bodies in two-photon calcium imaging movies. We provide a Python 3 implementation as well as a legacy Matlab implementation. The software is freely available for non-commercial use. See license for details.
The HNCcorr algorithm is described in our eNeuro paper:
Q Spaen, R Asín-Achá, SN Chettih, M Minderer, C Harvey, and DS Hochbaum (2019). HNCcorr: A novel combinatorial approach for cell identification in calcium-imaging movies. eNeuro, 6(2).
An older version of the manuscript appeared on Arxiv:
Q Spaen, R Asín-Achá, and DS Hochbaum (2017). HNCcorr: A novel combinatorial approach for cell identification in calcium-imaging movies. arXiv:1703.01999.
from hnccorr import HNCcorr, Movie from hnccorr.example import load_example_data movie = Movie( "Example movie", load_example_data() # downloads sample Neurofinder dataset ) H = HNCcorr.from_config() # Initialize HNCcorr with default configuration H.segment(movie) H.segmentations # List of identified cells H.segmentations_to_list() # Export list of cells (for Neurofinder)
See the quickstart guide for more details.
The latest version of this software is available on GitHub. The source code is also available in ZIP format here.
You can install HNCcorr directly from the Python Package Index with pip:
pip install hnccorr
On Windows you may need to install a C-compiler for Python.
The Matlab implementation was used to generate the results in the eNeuro manuscript and is now superseded by the Python implementation. The Matlab implementation is available in the matlab
folder. See the README file in the matlab
folder for instructions.
The documentation is hosted at ReadTheDocs.
The tests for HNCcorr use the pytest
package. You can execute them with the pytest
command in the main directory.
The source code is subject to the following academic license. Note that this is not an open source license.
Copyright © 2017. Regents of the University of California (Regents). All Rights Reserved.
Permission to use, copy, modify, and distribute this software and its documentation for educational, research, and not-for-profit purposes, without fee and without a signed licensing agreement, is hereby granted, provided that the above copyright notice, this paragraph and the following two paragraphs appear in all copies, modifications, and distributions. Contact The Office of Technology Licensing, UC Berkeley, 2150 Shattuck Avenue, Suite 510, Berkeley, CA 94720-1620, (510) 643-7201, for commercial licensing opportunities. Created by Quico Spaen, Roberto Asín-Achá, and Dorit S. Hochbaum, Department of Industrial Engineering and Operations Research, University of California, Berkeley.
IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED “AS IS”. REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.