napari Label Propagation
Label propagation through deep registration
3D semi-automatic segmentation using deep registration-based 2D label propagation¶
See "Semi-automatic muscle segmentation in MR images using deep registration-based label propagation" paper :
To install this project :
pip install napari['all'] pip install git+https://github.com/nathandecaux/napari-labelprop.git
Download pretrained weights.
Open napari from terminal and start using functions from 'napari-labelprop' plugin (Under Plugins scrolling menu).
Available functions are :
- Inference : Propagate labels from trained weights (Pytorch checkpoint required)
- Training : Start training from scratch or from the pretrained weights.
PS : "Unsupervised pretraining" is not yet implemented. See CLI option at LabelProp repository.
Every operation is done in the main thread. So, napari is not responsive during training or inference, but you can still follow the progress in the terminal.
To train a model, reach the plugin in the menu bar :
Plugins > napari-labelprop > Training
Fill the fields with the following information :
Image: Select a loaded napari.layers.Image layer to segment
Labels: Select a loaded napari.layers.Labels layer with the initial labels
hints: Select a loaded napari.layers.Labels layer with scribbled pseudo labels
Pretrained checkpoint: Select a pretrained checkpoint from the server-side checkpoint directory
Slices shape: Slices are resample to this shape for training and inference, then resampled to original shape. So far, slices must be squares.
Propagation axis: Set the axis to use for the propagation dimension
Max epochs: Set the maximum number of epochs to train the model
Checkpoint output directory
Weighting criteria: Defines the criteria used to weight each direction of propagation
ncc = normalized cross correlation (slow but smooth), distance = distance to the nearest label (fast but less accurate)
Reduction: When using ncc, defines the reduction to apply to the ncc map
mean / local_mean / none. Default is
Use GPU: Set if whether to use the GPU or not. Default is
True(GPU). GPU:0 is used by default. To use another GPU, set the
CUDA_VISIBLE_DEVICESenvironment variable before launching napari.
To run inference on a model, reach the plugin in the menu bar :
Plugins > napari-labelprop-remote > Inference
Fill the fields like in the training section. Then, click on the
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-labelprop" is free and open source software
If you encounter any problems, please [file an issue] along with a detailed description.
- 21 June 2023
- 19 June 2023
- Stars: 0
- Forks: 0
- Issues + PRs: 0