Manual curation in napari: quickly pick the best cell/nuclei masks from segmentation outputs (Cellpose/Baysor/parameter sweeps), with new IDs, undo, overlap pruning, compact save, and fast logging.
Project description
A napari dock widget for manual curation of segmentation masks. It is designed for workflows where you generate multiple candidate masks (e.g., Cellpose/Baysor/parameter sweeps), and then quickly pick the best instance per cell/nucleus inside napari with full traceability.
Key features
- Follow → Work: create a working copy
*.mask__workfrom your selected mask layer, so the original stays untouched. - Collect (Always NEW ID): click an object in
__workto copy it intomanual_bestwith a new unique label ID. - Undo (U / Alt-U): revert the last collect and restore the exact pre-click state.
- Overlap prune (P / Alt-P): remove candidate objects in
__workthat overlap too much withmanual_best(avoid duplicates). - Compact save (S / Alt-S): before saving, relabel
manual_bestto consecutive IDs (1..N). - Fast logging: JSONL + TSV logs of every action (for methods papers / traceability).
- Blink: toggle selected layer visibility at 0.5s to compare masks quickly.
Compatibility
- Python: 3.10–3.13 (tested on 3.11)
- napari: 0.6.x (tested on 0.6.6)
What input masks should look like
- Input mask should be a Labels layer.
- The layer name is expected to contain
.mask(example:d290_cp0_fl0.2.mask).- This is how the plugin identifies which layers are “candidate masks”.
Tip: if your mask is a LZW-compressed TIFF and napari fails to open it, install
imagecodecs:
conda install -c conda-forge imagecodecs
Typical workflow
- Open napari
- Load:
- A background image (optional), e.g. DAPI
- A candidate mask Labels layer, e.g.
d290_cp0_fl0.2.mask
- Open the panel: Plugins → Mask Curator → Mask Curation
- Select your
*.masklayer and click Follow → Work + Prune- Creates
*.mask__work - Creates/uses
manual_best
- Creates
- Click Collect: OFF (A) to switch it to Collect: ON
- Left-click objects in
__workto collect intomanual_best - If you mis-click, press Undo (or U / Alt-U)
- Press Prune Now (or P / Alt-P) to prune overlaps
- Press Save manual_best (or S / Alt-S) to export final curated masks with compact IDs.
Hotkeys
- Alt-A: Toggle Collect ON/OFF
- Alt-U: Undo last collect
- Alt-P: Prune Now
- Alt-R: Reset Work
- Alt-S: Save manual_best
(Buttons are also provided for all actions.)
Parameters (panel)
- Overlap prune thr: candidates are removed if overlap ratio ≥ thr
- ROI pad(px): padding around object bbox used for fast local updates
Outputs
When saving, the plugin writes:
manual_best_ID_uint32.tif— curated Labels with compact consecutive IDs (1..N)manual_best_black_uint8.tif— binary mask (0/255)manual_best_id_map_old_to_new.tsv— mapping from pre-save IDs to compact IDs
Logs (traceability):
curation_logs/curation_<timestamp>.jsonlcuration_logs/curation_<timestamp>.tsv
Installation
From PyPI
pip install napari-mask-curator
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file napari_mask_curator-0.1.1.tar.gz.
File metadata
- Download URL: napari_mask_curator-0.1.1.tar.gz
- Upload date:
- Size: 23.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
838f0a54346429a3afc94c7cf22ce4bf6bda7cc9bff0044a74b70f30a227ef70
|
|
| MD5 |
3df3b2568b0d649b62943db6610bf6c9
|
|
| BLAKE2b-256 |
25d90a4ede0fffddf1a532fd9911ebc137a12c3316492ea28db32ad3d6f0b5bb
|
File details
Details for the file napari_mask_curator-0.1.1-py3-none-any.whl.
File metadata
- Download URL: napari_mask_curator-0.1.1-py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04c7276411a753d7e3cc84d5b2a7056f14ce248f9c4dc404ffe4ac2c2ffdfc3c
|
|
| MD5 |
5b863a7e50e6d316eae832c7eaa73b5a
|
|
| BLAKE2b-256 |
d83ecb3c7e44b32f53141afa545053688a3d5ed6fbbd09368545e6349370d8fa
|