Skip to main content

A Napari plugin allowing to detect and segment microglia on fluorescent images.

Project description

Microglia Analyzer

GitHub License Python Version Unit tests

What is it?

A Napari plugin that allows for the segmentation and classification of microglia on 2D fluorescent images. Z-stacks and time series are not handled.

  • Segments the microglia with a UNet2D model.
  • Creates classified bounding-boxes with a YOLOv5.
  • Attributes a class to each cell.
  • Extracts graph information about the cells.

We end up with a ".csv" (separated with tabulations instead of commas) file containing all these metrics.

01. How to install/upgrade it?

Install

Action Command
Install pip install git+https://github.com/MontpellierRessourcesImagerie/microglia-analyzer.git napari[all]
Upgrade pip install --upgrade git+https://github.com/MontpellierRessourcesImagerie/microglia-analyzer.git

02. How to use it?

For more details, check the detailed documentation.

A. Open the widget

  • First of all, you need all your images to be converted to TIFF, and placed in the same folder.
  • Once Napari is opened, you can visit your plugins list. It should contain a Microglia Analyzer entry.
    • Tiles Creator allows you to create patches to annotate if you ever want to retrain the UNet or the YOLOv5.
    • Annotations Helper allows you to define and create classified bounding-boxes exported under the YOLOv5 format as well as masks. This widget is meant to help you create some ground-truth data.
    • Microglia Analyzer contains the whole analysis workflow.

B. Load your images

  • Click the 📁 Sources folder button and navigate to the folder containing your TIFF images before pressing OK.
  • In the drop-down menu below, you can choose the image on which you want to run the analysis.
  • In the "Calibration" field, you just have to provide the size of your pixels in physical unit and confirm. Your image may look small after this step, so you may want to press the button with a little picture of home in the lower-left corner of Napari's window.

C. Segment your microglia

  • Press the 🔍 Segment button and wait for the labeled microglia to show up.
  • The first time, this step may take a little longer as the plugin must download the deep-learning model from MRI's server.
  • You can adjust the area of the smallest tolerated object either before or after the segmentation, both ways work.
  • At this point, each individual microglia should be represented by its own color.
  • We focused the segmentation on the "graph" produced by microglia, so the soma won't look thicker than any other part of the microglia.

D. Classify your microglia

  • Click the Classify button.
  • Once again, a model has to be downloaded from MRI's server.
  • By the end of this step, you should have a colored bounding-box around each tolerated microglia.
  • The color indicates which class it belongs to (amoeboid, intermediate ou homeostatic).
  • The color code should show up in the array below the classification button.
  • If you wish, you can adjust the prediction threshold ("how sure the model is about what it sees")

E. Measure your microglia

  • If you click on the 📊 Measure button, the skeleton of each microglia should appear.
  • The measures are generated and stored in a .tsv file located in the controls sub-folder (auto-generated in your images' folder)

F. Analyze the whole folder

  • Once you got to that point, each parameter is correctly set (as you just used them for an image), so you click the ▶ Run batch to apply them to the whole folder.
  • The button should now indicate ■ Kill batch (i/N). You can click it to interrupt the execution. i is the rank of the current image, and N is the number of images detected in the folder.
  • By the end of the run, the button should be normal again, and a results.tsv file should be located in the controls folder.

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

microglia_analyzer-2.1.0.tar.gz (86.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

microglia_analyzer-2.1.0-py3-none-any.whl (96.7 kB view details)

Uploaded Python 3

File details

Details for the file microglia_analyzer-2.1.0.tar.gz.

File metadata

  • Download URL: microglia_analyzer-2.1.0.tar.gz
  • Upload date:
  • Size: 86.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for microglia_analyzer-2.1.0.tar.gz
Algorithm Hash digest
SHA256 19caee0656ebca9ab6b93a7d39834d936cb83eccb5f93366f46daf251d371599
MD5 0297428d79f6b5284d21fc3661de275c
BLAKE2b-256 1f8fea7ac3268ded5791d1e4e63a308199df573a176ba568585d5741d7d7e956

See more details on using hashes here.

File details

Details for the file microglia_analyzer-2.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for microglia_analyzer-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5d3bb293b19ff06ded94c58a7ffb6e7a55052eef427d8048645731d9dbeff151
MD5 8a24590ec95d69281366c469c2e64e81
BLAKE2b-256 55253f94bd28195403b6fe33b382dac6595e3d873a3f73d5d9ab7c81bed82fb6

See more details on using hashes here.

Supported by

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