napari-macrophage
A napari plugin for interactive 3D macrophage image analysis — mask editing, Otsu/Watershed segmentation, YOLO bounding box export, and morphology analysis.
| 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
.txtformat - 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
- Load data — Plugins → napari-macrophage → Load Image + Mask
- Edit masks — Plugins → napari-macrophage → Edit CD206 + DAPI + Masks
- Segment — Draw ROI bbox → Otsu preview → Save or Run Watershed
- Detect — Run ONNX detection on CD206 + DAPI slices
- 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
- Export — YOLO
.txtbounding boxes or morphology.csv
Input shape: (Z, Y, X) for grayscale, (C, Z, Y, X) for multi-channel (C ∈ {2, 5}).
Companion pipeline
For fully automated end-to-end segmentation (YOLO + SAM2 + Cellpose), see: macrophage-image-processor
Release files for napari-macrophage 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| napari_macrophage-0.0.4.tar.gz | 10.6 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| napari_macrophage-0.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.2 MB
Release files / napari_macrophage-0.0.4.tar.gz
| Download URL | napari_macrophage-0.0.4.tar.gz |
|---|---|
| Size | 10.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0624b2bd1ce6541f9e0a45df13656a66e0b5c07d4cc9f16dc0de12a25194b47a
|
|
BLAKE2b-256 checksum How to use checksums |
dee5eca8421a1b4c3215d78c049b60d1cda7a8585463da8066207774d28d329c
|
| 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.0.4-py3-none-any.whl
| Download URL | napari_macrophage-0.0.4-py3-none-any.whl |
|---|---|
| Size | 10.6 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b91f968c0b593252f8f09cfe4182bf8b195b0974c3ceede89f8cdd90ef3260c4
|
|
BLAKE2b-256 checksum How to use checksums |
af91377cb1602b49555d8c20f042d5b80740b8672e0d8be926070c2a4ee67617
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.11
|