Skip to main content

napari-macrophage

PyPI Python Version License napari hub Documentation Status

A napari plugin for interactive 3D macrophage image analysis — mask editing, Otsu/Watershed segmentation, YOLO bounding box export, and morphology analysis.

Demo 3D rendered macrophage
3D segmentation of macrophages overlaid with the volume 3D rendering of a single macrophage

Features

  • Load multi-channel TIFF/Zarr images (CD206, DAPI, Collagen, F480) and 3D instance masks
  • Click-to-select objects; delete per-slice or globally; rename, renumber IDs
  • Draw ROI → Otsu preview (adjustable threshold) → optional Watershed → save 3D mask
  • ONNX-based automatic macrophage detection (CD206 + DAPI)
  • Annotate and export/import bounding boxes in YOLO .txt format
  • Per-object morphology analysis: volume, surface area, sphericity → CSV export
  • Isotropic resampling of image and mask
  • 3D rendering of individual macrophages (smoothed surface mesh, adjustable shading, black/white background, PNG screenshot, mesh export to STL/OBJ/PLY)

Installation

With uv (recommended)

uv sync                       # core deps
uv sync --extra detection     # + onnxruntime for ONNX detection
uv run napari

With pip

pip install napari-macrophage
napari

Development

pip install -e .
napari

Usage

Start napari with the two main plugin docks already open:

napari-macrophage

(The regular napari command still works — use it if you want a clean viewer without the plugin's docks pre-mounted.)

  1. Load data — Plugins → napari-macrophage → Load Image & Mask (or use the Load Image & Mask dock opened by napari-macrophage)
  2. Edit masks — Plugins → napari-macrophage → Annotate & Correct Masks/Boxes
  3. Segment — Draw ROI bbox → Otsu preview → Save or Run Watershed
  4. Detect — Run ONNX detection on CD206 + DAPI slices
  5. Render 3D — In the 3D Visualization panel, enter an Object ID and click Generate 3D to open the macrophage in a new window; save a PNG or export the mesh (STL/OBJ/PLY) from that window
  6. Export — YOLO .txt bounding boxes or morphology .csv

Input shape: (Z, Y, X) for grayscale, (C, Z, Y, X) for multi-channel (C ∈ {2, 5}).

Documentation

Full user guide and API reference: macrophage-napari.readthedocs.io

Build the docs locally:

pip install -e ".[docs]"
sphinx-build docs docs/_build/html

Companion pipeline

For fully automated end-to-end segmentation (YOLO + SAM2 + Cellpose), see: macrophage-image-processor

Metadata

Release files for napari-macrophage 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for napari-macrophage 0.1.0
File Size Uploaded
napari_macrophage-0.1.0.tar.gz 10.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for napari-macrophage 0.1.0
File Interpreter ABI Platform
napari_macrophage-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.2 MB

Release files / napari_macrophage-0.1.0.tar.gz

Download URL napari_macrophage-0.1.0.tar.gz
Size 10.6 MB
Tags Source
SHA-256 checksum
How to use checksums
b1a15d35baf37db2dae0f7a303bb99f889c596ac6553ffb5ee8d9246e8d7633e
BLAKE2b-256 checksum
How to use checksums
d86dde3fdd117a5bddd9ab34aa12d0ec55a3fad4e5bd3d48d9633755bc4d80b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.11

Release files / napari_macrophage-0.1.0-py3-none-any.whl

Download URL napari_macrophage-0.1.0-py3-none-any.whl
Size 10.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
7ae624c768b3ba665af4c3a0fe61541ce06c807b04eaf4bfb5e1b1863351bffb
BLAKE2b-256 checksum
How to use checksums
a0f64579f75bf3877cd2c9832abca4244231845c70264183a189fe4701ab53c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.11

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page