A plugin to quickly generate ground truth with sparse labels
This napari plugin was generated with Cookiecutter using @napari's cookiecutter-napari-plugin template.
You can install napari-bootstrapper
in a conda environment by following these commands:
conda create -n napari python=3.10
conda activate napari
conda install pytorch pytorch-cuda=11.8 "numpy<=1.23.5" boost -c pytorch -c nvidia
pip install cython zarr matplotlib mahotas
pip install git+https://github.com/funkelab/funlib.geometry.git
pip install git+https://github.com/funkelab/funlib.persistence.git
pip install git+https://github.com/funkelab/daisy.git
pip install git+https://github.com/funkey/gunpowder.git
pip install git+https://github.com/funkelab/funlib.math.git
pip install git+https://github.com/funkelab/funlib.evaluate.git
pip install git+https://github.com/funkelab/funlib.learn.torch.git
pip install git+https://github.com/htem/waterz@hms
pip install git+https://github.com/funkelab/funlib.segment.git
pip install git+https://github.com/funkelab/lsd.git
pip install neuroglancer
pip install git+https://github.com/funkelab/funlib.show.neuroglancer.git
pip install tensorboard tensorboardx
pip install jsmin
pip install magic-class
pip install git+https://github.com/yajivunev/autoseg
pip install "napari[all]"
pip install git+https://github.com/salkmanorlab/napari-bootstrapper
- Open napari with
napari
and load in your data. - Create a new Labels Layer napari.
- Paint some labels on a single section (or a few) using napari's brush and fill tools.
- Focus on critical areas of the image (ambiguous and obvious examples of boundaries and not boundaries).
- Save Your Data as a zarr.
- Open
Plugins
->napari-bootstrapper
. OpenBootstrapper
. - Click on
Save Data
. - Set the filepath of the zarr to be create.
- Set the voxel size (or resolution) in world units (nanometers/pixel)
- Open
- Train model 1
- Make sure voxel size is same as what you saved. If your saved data has voxel size
50, 8, 8
, then set it here as8, 8
Run
.
- Make sure voxel size is same as what you saved. If your saved data has voxel size
- Train model 2
- Make sure voxel size is same as what you saved. If your saved data has voxel size
50,8,8
, then set it here as50, 8, 8
Run
.
- Make sure voxel size is same as what you saved. If your saved data has voxel size
- Get a coffee.
Run Inference
.- Make sure all the dataset names, model checkpoint paths, and voxel size are all correct.
Run
Watershed
Segment
- Update resulting segmentation using other widgets in i
Plugins
->napari-bootstrapper
. You can create a Points layer in napari and place points in 3D to:- Keep selected labels
- Delete selected labels
- Merge selected labels
- Split selected label between two point
- Morph selected labels
- Dilation, Erosion
- Morphological opening, closing
- Remove small objects
- Save Your Data. Use it to train again!
- Refine, Rinse, Repeat
- Make many 3D segmentations to feed to the same or a full 3D model.
- You are now bootstrapping 3D ground truth segmentation.
Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.
Distributed under the terms of the BSD-3 license, "napari-bootstrapper" is free and open source software
If you encounter any problems, please [file an issue] along with a detailed description.