Skip to main content

Mitoclass is a napari plugin for classifying mitochondrial morphology from microscopy images: it allows preprocessing data, training or using a model, predicting classes (connected, fragmented, intermediate), visualizing overlays and 3D summaries, and managing a prediction history.

Project description

MitoClass logo Mitoclass

License: GPL v3 PyPI Python ≥ 3.10 napari‑hub

IMHORPHEN LARIS Université d'Angers

A napari plugin for the qualitative assessment of mitochondrial network morphology.


1. Overview

Mitoclass provides an end‑to‑end workflow to classify mitochondrial morphology—connected, fragmented, or intermediate—directly inside the napari viewer. Beyond inference, the plugin offers tools for :

  • data annotation;
  • model training and improvement;
  • interactive result visualisation.

All functionality is accessible through a graphical user interface.


2. Key features

Module Functionality
Prediction Pixel‑wise classification of 3‑D stacks (automatic maximum‑intensity projection). Batch processing, class overlays, per‑image statistics, CSV summary.
Annotation Fast image labelling to standardise classes for model training.
Pre‑processing Generation of normalised patches with stratified train/val/test split.
Training Train a CNN or fine‑tune existing models.
Visualisation Interactive heatmaps and 3‑D scatter plots (Plotly) of class proportions.

3. Requirements

  • Python ≥ 3.10
  • Operating systems: Linux, macOS, or Windows
  • Hardware: CPU supported; GPU (CUDA 11+) recommended for large‑scale inference and training

4. Installation

4.1. Stable release (PyPI)

pip install mitoclass

Installs the plugin and its dependencies (napari, Qt, etc.).

4.2. Reproducible conda environment

conda create -n mitoclass python=3.10
conda activate mitoclass

# (Optional) TensorFlow GPU (e.g. Linux CUDA 11.8)
conda install -c conda-forge cudnn=8.9 cuda11.8 tensorflow

pip install mitoclass

💡 Apple Silicon: use tensorflow-macos instead.

4.3. Download the pre‑trained model

https://github.com/Jmlr2/MitoClassif/releases


5. Usage

5.1. Graphical interface

napari
  1. Open the Mitoclass widget from the Plugins menu.
  2. Select the desired tab.

5.2. Annotation

Item Description
Goal Create an image → class mapping to bootstrap or expand a training dataset.
Input Folder of unlabelled images (*.tif, *.tiff, *.stk).
Output Images copied or moved to annot_output/<ClassName>/, sorted into one folder per class.

5.3. Pre‑processing

Goal: convert 3‑D stacks into normalised 2‑D patches for CNN training.

Input structure:

raw_input/
├── Connected/
├── Fragmented/
└── Intermediate/

Steps:

  1. Maximum‑intensity projection (MIP)
  2. Intensity normalisation (8‑bit or 16‑bit)
  3. Otsu segmentation
  4. Patch extraction (configurable size/overlap)
  5. Patch labelling (class vs. background)
  6. Stratified train/val/test split

Output structure:

pp_output/
├── train/
│   ├── Connected/
│   ├── Fragmented/
│   ├── Intermediate/
│   └── background/
├── val/
├── test/
└── manifest.csv

CSV columns: split, original, x, y, label, patch_path


5.4. Training

Item Description
Goal Train a CNN (or fine‑tune an existing model) on the patches.
Input Patch folders (train/, val/, test/).
Parameters Patch size, batch size, epochs, learning rate, patience, bit depth, pre‑trained model (.h5).
Outputs In the output directory: best_model.h5, best_model_history.csv, best_model_test_metrics.csv, best_model_classification_report.txt.

5.5. Prediction / Inference

Item Description
Goal Classify new images/stacks and compute class proportions.
Inputs - Folder of images (.tif, .tiff, .stk, .png) ;
- Active layer in napari
Parameters Patch size, overlap, batch size, bit‑depth conversion, model path (.h5).
Outputs - predictions.csv (image, % connected, % fragmented, % intermediate, global_class) ;
- Folder of heatmaps (*_map.tif) ;
- Optional global summary CSV
Interactive Overlay in napari and interactive 3‑D scatter plot (graph3d.html).

6. Licence

This software is released under the GNU GPL v3 licence. Refer to the LICENSE file for details.

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

mitoclass-0.1.1.dev5.tar.gz (56.8 kB view details)

Uploaded Source

Built Distribution

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

mitoclass-0.1.1.dev5-py3-none-any.whl (44.1 kB view details)

Uploaded Python 3

File details

Details for the file mitoclass-0.1.1.dev5.tar.gz.

File metadata

  • Download URL: mitoclass-0.1.1.dev5.tar.gz
  • Upload date:
  • Size: 56.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for mitoclass-0.1.1.dev5.tar.gz
Algorithm Hash digest
SHA256 3b89069b4732f68fb460bfe3edd312ed4c3edd8b78ca597854c80b0d8387a34d
MD5 012d731382e59866fb80199aac5bc50b
BLAKE2b-256 880f28d501e03aa0cade8c75e74fb44e288aa510b860fd59bda98de4d85958f2

See more details on using hashes here.

File details

Details for the file mitoclass-0.1.1.dev5-py3-none-any.whl.

File metadata

  • Download URL: mitoclass-0.1.1.dev5-py3-none-any.whl
  • Upload date:
  • Size: 44.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for mitoclass-0.1.1.dev5-py3-none-any.whl
Algorithm Hash digest
SHA256 47fedf8b532e4a326c4c0fd90d1c299d7960e94b718c34636c3900b7abbd19f9
MD5 c92a372a6bb93d3ea33ec73f39f239fc
BLAKE2b-256 f3154309be0ae93ef41523a5d787f648831ae58413e23a210c9270036a97eb37

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