Skip to content

napari-mAIcrobe

mAIcrobe: a napari plugin for microbial image analysis. Automated cell segmentation, deep learning classification, and comprehensive morphometry. Check out our preprint on bioRxiv!

License BSD-3 PyPI Python Version tests napari hub

πŸš€ Installation

Recommended (conda):

conda create -n mAIcrobe python=3.11
conda activate mAIcrobe
conda install -c conda-forge napari pyqt
pip install napari-mAIcrobe

Development installation:

conda create -n mAIcrobe python=3.11
conda activate mAIcrobe
conda install -c conda-forge napari pyqt
git clone https://github.com/HenriquesLab/mAIcrobe.git
cd mAIcrobe
pip install -e .

Installation Guide β†’ Complete Tutorial β†’

✨ Why napari-mAIcrobe?

  • Automated Segmentation: StarDist2D, Cellpose, and custom U-Net models
  • AI Classification: 6 pre-trained CNN models for S. aureus cell cycle determination
  • Morphological Analysis: Comprehensive measurements using scikit-image
  • Interactive Interface: Intuitive napari-based GUI for all analysis steps
  • Colocalization Analysis: Multi-channel fluorescence quantification
  • Automated Reports: HTML reports with visualizations and statistics
  • Data Export: CSV export for downstream statistical analysis
  • Batch Processing: Analyze multiple images with consistent parameters
  • Reproducible Workflows: Consistent analysis parameters across users
  • Custom Models: Support for user-trained segmentation and classification models
  • Open Source: Full transparency and community contributions
  • Cross-Platform: Works on Windows, macOS, and Linux

🎯 Key Features

🎨 Cell Segmentation

Choose from multiple state-of-the-art segmentation approaches:

  • StarDist2D: Optimized for bacterial cell morphology
  • Cellpose: Versatile deep learning segmentation
  • Custom U-Net: Train your own models for specific bacterial species

🧠 Single-Cell Classification

Pre-trained deep learning models for S. aureus: - DNA + Membrane models: Epi/SIM microscopy - DNA-only models: DAPI or similar staining - Membrane-only models: Phase contrast or membrane stains - Custom model support: Integrate your own classification models

πŸ“ Comprehensive Morphometry

Comprehensive cell measurements: - Size metrics: Area, perimeter, equivalent diameter - Shape descriptors: Eccentricity, solidity, aspect ratio - Intensity measurements: Mean, median, standard deviation per channel - Spatial relationships: Distance to neighbors, clustering analysis

πŸ” Interactive Filtering

Real-time cell selection based on: - Size constraints: Filter by area or diameter ranges - Shape criteria: Select specific morphologies - Intensity thresholds: Focus on cells with specific staining patterns - Classification confidence: Keep only high-confidence predictions

πŸ” Analysis Workflow

πŸ“„ Single Image Analysis

  1. Load Images: Phase contrast and/or fluorescence
  2. Segment Cells: Choose segmentation algorithm and parameters
  3. Analyze Cells: Extract morphological and intensity features and choose classification model
  4. Filter Results: Interactive filtering of cell populations
  5. Generate Report: Create comprehensive analysis report

πŸ“– Documentation

πŸ“š Explore the Docs

  • User Guide


    Concepts and how‑to guides: segmentation, analysis, and classification User Guide

  • Tutorials


    Step‑by‑step workflows, from basics to training data export Tutorials

  • Troubleshooting


    Fix common installation and runtime issues Troubleshooting

  • API Reference


    Programmatic usage and module overview API Docs

πŸ§ͺ Sample Data

Access via napari: File β†’ Open Sample β†’ mAIcrobe (Phase, Membrane, DNA examples)

🀝 Community

πŸ““ Available Jupyter Notebooks

Explore advanced functionality with included notebooks:

πŸ—οΈ Contributing

We welcome contributions! Whether it's:

  • Bug reports and fixes
  • New segmentation algorithms
  • Documentation improvements
  • Additional test datasets
  • New AI models for classification

Quick contributor setup:

git clone https://github.com/HenriquesLab/mAIcrobe.git
cd mAIcrobe
pip install -e .[testing]
pre-commit install

Testing:

pytest -v
pytest --cov=napari_mAIcrobe
tox

Full guide: https://github.com/HenriquesLab/mAIcrobe/blob/main/CONTRIBUTING.md

πŸ“œ License

Distributed under the terms of the BSD-3 license β€” free and open source software.

πŸ™ Acknowledgments

napari-mAIcrobe is developed in the Henriques and Pinho Labs with contributions from the napari and scientific Python communities.

Built with:


Ready to analyze your microbial images? Get started now β†’