Bootstrapper

A plugin to quickly generate dense ground truth with sparse labels

  • Vijay Venu Thiyagarajan

License BSD-3 PyPI Python Version tests napari hub

A napari plugin to generate dense 3D segmentations from sparse 2D labels. The plugin uses the 2D-to-3D method in Sparse Annotation is Sufficient for Bootstrapping Dense Segmentation.

For larger volumes, dedicated 3D models, and block-wise processing, see the Bootstrapper CLI.

cremi30

Dataset Data type Video
CREMI C 3D volumetric stack CREMI C
Fluo-C2DL-Huh7 2D + time series Fluo-C2DL-Huh7

Install

Use Python 3.12 or later and scikit-image 0.26 or later. The plugin requires Zarr format 2 (zarr<3). Create a separate environment:

conda create -n napari-bootstrapper python=3.12
conda activate napari-bootstrapper
python -m pip install "napari-bootstrapper==1.0.0" pyqt5

To install the development version instead:

python -m pip install "napari-bootstrapper @ git+https://github.com/ucsdmanorlab/napari-bootstrapper.git" pyqt5

Launch

conda activate napari-bootstrapper
napari -w napari-bootstrapper Bootstrapper

You can also open the Bootstrapper widget from napari's Plugins menu. The File > Open Sample menu includes CREMI C (cremi_c) and Fluo-C2DL-Huh7 (fluo_c2dl_huh7) data, which ship with the plugin and need no download.

Segmentation

1. Data

Load a 3D image, or a 4D image with one channel dimension, and select its image layer. Label objects on one or more sections, then click Make mask to select the labelled voxels for training. You can make labels with napari's drawing tools or micro-sam.

2. 2D model

Choose a task and click Train, or load a checkpoint from an earlier run.

Task Output
2d_affs Affinities
2d_lsd Local shape descriptors (LSDs)
2d_mtlsd Both LSDs and affinities

The Device control selects CPU, CUDA, or MPS when available. For CPU training without data-loader processes, set Num Workers to 0 in Advanced Config.

3. 3D model

Click Download to get the pretrained 3D model for the selected 2D task. The 3D model converts 2D predictions into 3D affinities. Downloads and training checkpoints go into ~/.napari_bootstrapper.

4. Segmentation

Choose mutex watershed or connected components, then click Start to predict and segment the volume. The widget adds the predictions and segmentation as napari layers.

Proofreading

Open the Proofreading widget from the Plugins menu, or run:

napari -w napari-bootstrapper Proofreading

Select objects with points or label IDs, then apply an operation to one section or the full volume. The widget can merge, split, delete, dilate, erode, open, close, and fill holes. Filters remove objects by size, section count, or distance from the object-size distribution. The widget uses fastmorph, fastremap, and cc3d.

Changes in 1.0

  • lsd-lite replaces the old lsds package. The 2D targets match Bootstrapper 1.0, including background masking and odd-sized crops.
  • The default LSD sigma stays at 10 pixels. New training excludes background from the LSD loss and rejects empty supervised batches.
  • The three pretrained 3D checkpoints match Bootstrapper 1.0. They remain the files published in its v0.3.2 release.
  • Downloads verify SHA-256 hashes before extraction. The widget also verifies cached checkpoints and replaces damaged files.
  • CPU training accepts zero data-loader workers. Synthetic-label generation supports slices smaller than its dilation footprints.
  • Connected components reads affinities at the trained negative offsets. Mutex watershed applies the fragment filter, so segmentations can change.
  • Snapshots still use Zarr format 2. Zarr format 3 is not supported.

Tests

From a source checkout, install the test dependencies and run the headless suite:

python -m pip install ".[testing]"
QT_QPA_PLATFORM=offscreen CUDA_VISIBLE_DEVICES="" python -m pytest

The tests build the widget, load bundled samples, train small CPU models, and run both segmentation methods. They also download, verify, and run all three published checkpoints. OpenGL capability queries are stubbed; the tests do not check rendered pixels. To run without checkpoint downloads, use python -m pytest -m "not network".

Citation

Please cite the preprint when you use the plugin in research:

@article {Thiyagarajan2024.06.14.599135,
	author = {Thiyagarajan, Vijay Venu and Sheridan, Arlo and Harris, Kristen M. and Manor, Uri},
	title = {Sparse Annotation is Sufficient for Bootstrapping Dense Segmentation},
	year = {2024},
	doi = {10.1101/2024.06.14.599135},
	URL = {https://www.biorxiv.org/content/10.1101/2024.06.14.599135v2},
}

Issues

File an issue with the error message, plugin version, and steps to reproduce the problem.

Acknowledgements

Funding

Chan-Zuckerberg Imaging Scientist Award: https://doi.org/10.37921/694870itnyzk. The award comes from the Chan Zuckerberg Initiative DAF, an advised fund of Silicon Valley Community Foundation. Funder DOI: 10.13039/100014989.

NSF NeuroNex Technology Hub Award (1707356), NSF NeuroNex2 Award (2014862).

image

Version:

  • 1.0.0

Last updated:

  • 2026-10-22

First released:

  • 2025-05-23

License:

  • Copyright (c) 2025, Vijay Venu...

Supported data:

  • Information not submitted

Plugin type:

Open extension:

Save extension:

Python versions supported:

    Operating system:

    • Information not submitted

    Requirements:

    • numpy
    • scipy
    • scikit-image>=0.26
    • torch
    • zarr<3
    • numba
    • gunpowder<1.5
    • magicgui
    • qtpy
    • pyqtgraph
    • matplotlib
    • napari
    • tqdm
    • lsd-lite>=1.0.1
    • requests
    • tifffile
    • mwatershed
    • fastmorph[spherical]
    • connected-components-3d
    • fastremap
    • tox; extra == "testing"
    • pytest; extra == "testing"
    • pytest-cov; extra == "testing"
    • pytest-qt; extra == "testing"
    • napari; extra == "testing"
    • pyqt5; extra == "testing"
    Website by the napari team, original design by CZI.