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.1.tar.gz (84.9 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.1-py3-none-any.whl (95.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for microglia_analyzer-2.1.1.tar.gz
Algorithm Hash digest
SHA256 76818af85fb71feb7db9c4281f17f6e0e8ede13615ecebef98a4c9b616952137
MD5 c925db8cdbe7a39463ddf2ef8b617bd6
BLAKE2b-256 032f6952321bc16e297b39e7c84514faef407fbb1206b37024f06b440fcca2fa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for microglia_analyzer-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 48e37618d72077ffac237377d8d50d54e0b99d942e11b83368e189d683bfa304
MD5 28b9e54c12885ee191bef845a8e85816
BLAKE2b-256 1edce663f33d9e518a986ad099df7c6ef03280b834bcd3f9ae6f693bb4199777

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