Skip to main content

Colocalisation analysis of multi-channel images

Project description

napari-colocalisation logo

napari-colocalisation

License MIT PyPI Python Version tests codecov napari hub npe2

⚠️ Under construction — pre-alpha. APIs, UI, and outputs may change without notice. Not recommended for production analysis yet; use at your own risk and please report rough edges via the issue tracker.

Interactive intensity-colocalisation analysis for napari. Pick two channels (or one multi-channel image), optionally restrict the analysis to a region drawn as shapes or labels, choose your metric, and get a results table plus an intensity-vs-intensity scatter plot — all without leaving napari.

napari-colocalisation widget

Features

  • Three correlation metrics: Pearson (PCC), Spearman rank (SRCC), and Manders' coefficients M1/M2 (MCC).
  • Pairwise or all-to-all mode: analyse two grayscale layers, or every channel pair within a single multi-channel layer.
  • 2D and 3D support natively (no time-series for now).
  • Region-restricted analysis via a Shapes or Labels layer — each non-zero region is reported on its own row.
  • Manders thresholds: choose Costes auto (iterative regression-based) or Manual.
  • Interactive results: in-widget table, scatter plot of the selected row, multi-row selection that highlights all matching shapes/labels in the viewer.
  • CSV export of the current table.

Installation

pip install napari-colocalisation

If napari isn't already installed, install both at once:

pip install "napari-colocalisation[all]"

For the latest development version:

pip install git+https://github.com/DBI-INFRA/napari-colocalisation.git

Quick start

  1. Launch napari.

  2. Load sample data: File → Open Sample → napari-colocalisation → Colocalisation sample (2D) (a 3D sample is also provided).

    Open Sample menu

  3. Open the widget: Plugins → Colocalisation Analysis. Two image layers channel_a and channel_b are auto-selected for pairwise mode.

  4. Click Run. The results table populates with a single row (the whole image), and the scatter plot below shows the intensity pairs with the metric values overlaid.

    Run result

napari-colocalisation widget

  1. (Optional) Add a Shapes layer, draw a few rectangles or polygons, set Region to Shapes and pick the layer. Re-run — the table now has one row per shape, and clicking a row highlights the matching shape in the viewer.

napari-colocalisation widget

See docs/usage.md for the full walkthrough.

Documentation

  • Usage guide — every control in the widget, in order.
  • Metrics — what PCC, SRCC and MCC mean, when to use which, and how the Costes auto-threshold works.
  • Python API — calling the pure-compute layer (pearson, spearman, manders, costes_threshold, analyse_pairwise, analyse_all_to_all) from scripts or notebooks.

Related projects

Contributing

Contributions are welcome. Run the test suite with:

pip install -e . --group dev
python -m pytest tests/ -v

Pre-commit hooks (ruff lint + format, napari-plugin-checks) ship with the repo:

pre-commit install
pre-commit run --all-files

Please keep test coverage at or above the current level when submitting a PR.

License

Distributed under the terms of the MIT licence; napari-colocalisation is free and open-source software.

Issues

Found a bug or have a feature request? Please open an issue.

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

napari_colocalisation-0.1.1.tar.gz (3.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

napari_colocalisation-0.1.1-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file napari_colocalisation-0.1.1.tar.gz.

File metadata

  • Download URL: napari_colocalisation-0.1.1.tar.gz
  • Upload date:
  • Size: 3.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for napari_colocalisation-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e301e5cb8c22e8e7151ed68bea82041302b96791e79b62911ec0dd141f450377
MD5 eed1d2f205bc273b6f26ef0f9c66c1ae
BLAKE2b-256 671c7f9e32e703f939703b39d3d8f82fcc771929e2a43da4e1a3dbf6d4cdd3bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for napari_colocalisation-0.1.1.tar.gz:

Publisher: test_and_deploy.yml on DBI-INFRA/napari-colocalisation

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file napari_colocalisation-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for napari_colocalisation-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f8f730b56afc8eebf1d8d10a3cdb3a8dd7ff14766457dc06c770c3528df6028f
MD5 16176965f28a75653ad4a81bdf2939e7
BLAKE2b-256 1c90abdde0f38c7041baa1f30105bda48c3d777a4d7d6b44107ca393aee89a4c

See more details on using hashes here.

Provenance

The following attestation bundles were made for napari_colocalisation-0.1.1-py3-none-any.whl:

Publisher: test_and_deploy.yml on DBI-INFRA/napari-colocalisation

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page