Skip to main content

HNCcorr algorithm for cell detection in calcium-imaging.

Project description


Current version Documentation Travis-CI status

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 file for details.

The HNCcorr algorithm is described in our ArXiv paper:

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.

Example (Python)

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.segmentations  # List of identified cells
H.segmentations_to_list()  # Export list of cells (for Neurofinder)

See the quickstart guide for more details.

Installation Instructions for Python 3

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.

Installation Instructions for Matlab

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.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hnccorr-2020.5.1.tar.gz (33.7 kB view hashes)

Uploaded source

Built Distribution

hnccorr-2020.5.1-py3-none-any.whl (31.3 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page