Simple napari widget for annotating classes for each slice of an nd-image
This napari plugin was generated with Cookiecutter using with @napari's cookiecutter-napari-plugin template.
You can install napari-manual-classifier via pip:
pip install napari-manual-classifier
Import using:
from napari_manual_classifier import build_widget
Start the widget by running:
build_widget(viewer)
viewer is a napari viewer instance. build_widget also takes optional arguments:
| argument | description |
|---|---|
| metadata_levels | list of names for the leading dimensions of the image, used for formatting dataframe output |
| initial_classes | list of class names to initialize as options |
If no layers are open when initializing the widget, a dialog box will open to select a desired image.
Label the displayed image slice by either clicking the desired class button or pressing the corresponding number on the keyboard. This will automatically advance to display the next slice; however, you can always go back and re-classify a slice (warning will be displayed).
Additional class options can be added by typing the class label in the text box in the "classes" box, and then clicking Add class.
Once finished, click the Save... button in the widget; this opens a dialog box to save a table with the resulting classifications.
Contributions are very welcome.
Distributed under the terms of the MIT license, "napari-manual-classifier" is free and open source software
If you encounter any problems, please file an issue along with a detailed description.