Myelinated Axon Quantification with Label Tracking
Project description
napari-myelin-quantifier
Overview
napari-myelin-quantifier is a napari plugin for quantitative analysis of 2D cross-sectional myelinated axons from binary segmentation masks.
The plugin identifies individual myelin rings, assigns a unique ring_id to each structure, and exports morphometric measurements for downstream analysis.
It enables reproducible extraction of:
- Axon diameter
- Fiber diameter
- Myelin thickness
- g-ratio
Installation
Install via pip:
pip install napari-myelin-quantifier
If napari is not installed:
pip install "napari-myelin-quantifier[all]"
Development version:
pip install git+https://github.com/wulinteousa2-hash/napari-myelin-quantifier.git
Input Requirements
The plugin requires a binary mask layer:
- Myelin = foreground (1 / True)
- Background = 0 / False
- Recommended: clean segmentation without holes or broken rings
Example Binary Mask
Ring Detection and Labeling
Each connected myelin ring is:
-
Assigned a unique
ring_id -
Spatially localized using centroid coordinates
-
Evaluated for ring topology using Euler characteristic
Example Labeled Output
Topological Validation (Euler Characteristic)
The Euler number ensures valid ring topology:
-
Euler = 0 → valid ring (one hole)
-
Euler ≠ 0 → solid object or fragmented structure
This prevents non-myelinated artifacts from being included in analysis.
Topology Illustration
Quantitative Output (CSV)
For each ring, the plugin exports:
ring_id
centroid_x, centroid_y
bbox_x0, bbox_y0, bbox_x1, bbox_y1
ring_area_px
lumen_area_px
filled_area_px
euler
touches_border
Example:
ring_id,centroid_x,centroid_y,bbox_x0,bbox_y0,bbox_x1,bbox_y1,ring_area_px,lumen_area_px,filled_area_px,euler,touches_border
1,873.8658,34.4421,857,18,890,52,380,556,936,0,False
Derived Morphometric Parameters
Assuming approximately circular cross-sections:
Axon diameter:
d_axon = 2 × sqrt(lumen_area / π)
Fiber diameter:
d_fiber = 2 × sqrt(filled_area / π)
Myelin thickness:
t = (d_fiber − d_axon) / 2
g-ratio:
g = d_axon / d_fiber
Note: These are geometric approximations. For highly irregular axons, area-based statistics may be preferable.
Typical Workflow
-
Load binary mask into napari.
-
Open:
- Plugins → Myelin Quantifier
- Adjust filtering parameters:
-
Minimum ring area
-
Minimum lumen area
-
Exclude border objects (recommended)
-
Run quantification.
-
Export CSV.
-
Perform statistical analysis in Python, R, or Excel.
Interface
Contributing
Contributions are welcome. Please ensure tests pass before submitting pull requests.
License
MIT License.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file napari_myelin_quantifier-1.0.0.tar.gz.
File metadata
- Download URL: napari_myelin_quantifier-1.0.0.tar.gz
- Upload date:
- Size: 964.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62099308b59fa8f06b8616fb54d537549580d4e7f1d8f44fbaa2159483622cd5
|
|
| MD5 |
f4fc0f2b4d8306df0bd5e84be6a278f7
|
|
| BLAKE2b-256 |
d63d340e9d0f71502626c96bb793c4b491385fa1adbc2a2301c0dc282edb920d
|
File details
Details for the file napari_myelin_quantifier-1.0.0-py3-none-any.whl.
File metadata
- Download URL: napari_myelin_quantifier-1.0.0-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2df89d681b4f28fc01ff2c0b828a3ca886895050f9b229facf566163a57c5a39
|
|
| MD5 |
67cfe27cc154e520a5047bc363c98c07
|
|
| BLAKE2b-256 |
1641df27f3d3b19f73b09033a5dec10a26dbf1d4c8daaaec65a36dcb5697372e
|