Skip to main content

Random-forest automated bud annotation

Project description

napari-buds

License BSD-3 PyPI Python Version tests codecov napari hub

Random-forest automated bud annotation


This napari plugin was generated with Cookiecutter using @napari's cookiecutter-napari-plugin template.

Installation

make sure you already have installed napari.

Next, You can install napari-buds via pip:

pip install napari-buds

To install latest development version :

pip install git+https://github.com/SanderSMFISH/napari-buds.git

Contributing

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.

Documentation

Napari-Buds is a random forest based mother-bud annotation plugin for Napari devevoped by the TutucciLab (https://www.tutuccilab.com/) of the systems biology group at the Vrije Universiteit van Amsterdam. Mother-bud annotation requires single or multichannel 2D images of budding yeast and some kind of marker that localizes to the bud. In the example dataset provided smFISH DNA-probes were used as localized bud marker.The GUI layout for random forest based classification was inspired by ImageJ 'plugin Weka Segmentation' [1].

Please follow the workflow described underneath to perform mother-bud annotation:

  1. Open images in napari and create empty label layer. For multichannel images each channel should be provided seperately to napari. An example (jupyter) notebook for loading test data in napari is provided in the notebooks folder (named:Open Test Images Napari.ipynb ).

  2. If multichannel images are unaligned the translate widget under Plugins>napari-buds>Translate can be used. Select which layer should be translated to align to the layers in widget menu. Then use the aswd keys to translate (move) the selected layer. To register changes and update coordinates of the translated image in napari press t.

Random forest classification

  1. To open the mother-bud annotation plugin go to Plugins>napari-buds>bud annotation.

  2. To train a random forest classifier, in the created label layer draw examples of cells, buds and background (see tutorial gif below). In the Define Label segment of the widget you define which label value (class #label_value) corresponds to cells, buds and background. Currently, cells and backgrounds and buds have to be defined in the Define Label segment if you want to be able to segment the classification aswell. In the segment Layers to extract Features from we can select which layers will be used in training the random forest classifier. Next press Train classifier. After training is completed a result layer is added to layer list. Inspect the results carefully to asses classifier performance. The trained classifier can be saved using the save classifier button. Previously trained classifier can be loaded by pressing Load classifier. Loaded classifer can applied to new images by pressing Classify, resulting again in a results layer. It is possible to change the random forest parameters with the Set random forest parameters button and changing the values in the pop up menu. Press Run to register changed settings. For an example of the parameters used see: https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestClassifier.html and https://scikit-image.org/docs/stable/auto_examples/segmentation/plot_trainable_segmentation.html.

  3. Next, we want to perfom watershed segmentation using the result layer. However, for watershed segmentation seeds (also called markers) are required (for an explanation of watershed segmenation see: https://en.wikipedia.org/wiki/Watershed_(image_processing)). To define the seeds we can either simply threshold on one of the supplied image layers or we can use distance tranform (https://scikit-image.org/docs/stable/auto_examples/segmentation/plot_watershed.html#sphx-glr-auto examples-segmentation-plot-watershed-py) if thresholding is not suitable.The resulting seeds layer can be adjusted manually by editing in napari. A good seeds layers correspond to each cell having a single seed (buds are not single cells). To perform watershed segmentation press the Segment button.

  4. Carefully inspect the resulting cell mask and bud layer. Correct the mistakes in both layers. Bud label values should correspond to the label value of the cell mask of mother cell. To verify mother bud relations were drawn correctly press Draw Mother-Bud relations. If Mother-Bud relations are correct, you can save both label layers. For an example of standardized saving and extracting the mother-bud relations from the saved layers see the 'napari-bud_example.ipynb' file in the notebooks folder.

See video for clarification:

Watch the video

Similar Napari plugins

1-napari-accelerated-pixel-and-object-classification (APOC) by Robert Haasse.

2-napari-feature-classifier.

License

Distributed under the terms of the BSD-3 license, "napari-buds" is free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.

References

  1. Arganda-Carreras, I., Kaynig, V., Rueden, C., Eliceiri, K. W., Schindelin, J., Cardona, A., & Sebastian Seung, H. (2017). Trainable Weka Segmentation: a machine learning tool for microscopy pixel classification. Bioinformatics, 33(15), 2424–2426. doi:10.1093/bioinformatics/btx180

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

napari-buds-0.0.4.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

napari_buds-0.0.4-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

Details for the file napari-buds-0.0.4.tar.gz.

File metadata

  • Download URL: napari-buds-0.0.4.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for napari-buds-0.0.4.tar.gz
Algorithm Hash digest
SHA256 840adc65a8a65b69f16419a2dd18b03737966dffe1261a587591cfbd952b3681
MD5 4141f74ef7c54b917a7dac9378b0deca
BLAKE2b-256 8e99a8b4173004fb31ce149a6d0749d783b8a30e41f55d66514ab60c109cfb07

See more details on using hashes here.

File details

Details for the file napari_buds-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: napari_buds-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 21.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for napari_buds-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 aaa4496f2b0665e92c475f82abd5ce327c1f0c61d315b84c3089cd167b25f3b2
MD5 b0f040859bc6f505ba0bba2f0fa9e1fa
BLAKE2b-256 84870055e0e885b7472c396f0df9a7d159667b287384ccb1bb09c3c7ef49ca05

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page