NematodeMorphoAnalyzer

🧬 Nematode morpho analysis tool

NematodeMorphoAnalyzer is an open-source Python project designed to automatically analyze nematode images and extract morphological features such as body length, width, and tail shape. The pipeline applies specific procedures depending on the coiling level (Level 1, Level 2, or Level 3) assigned to each sample.

🎯 Highlights

πŸ” Feature 🧾 Description
🧠 Morphological Analysis Automatically detects morphological features from raw images
πŸŒ€ Coiling Level Handling Applies different analysis routines for each nematode coiling level
πŸ“ Precise Measurements Calculates length, width, area, tail geometry, and more
πŸ–ΌοΈ Image Processing Uses OpenCV, skimage, PIL, and matplotlib for preprocessing and visualization
πŸ“Š Structured Export Saves results as structured tables using pandas

βš™οΈ Workflow Overview

  1. Image Loading: Reads input images and associated metadata (e.g. coiling level).
  2. Preprocessing: Inversion, binarization, skeletonization, and morphological cleanup.
  3. Feature Detection: Measures width, length, area, tail shape, and more.
  4. Conditional Processing: Applies analysis routines based on coiling level.
  5. Output & Export: Generates CSV summaries and optionally annotated images.

πŸ“ Project Structure

nematode_morpho_analyzer/
β”œβ”€β”€ data/                     # Input images and metadata
β”‚   β”œβ”€β”€ level1/
β”‚   β”œβ”€β”€ level2/
β”‚   └── level3/
β”œβ”€β”€ outputs/                  # Results (CSV files, annotated images)
β”œβ”€β”€ src/                      # Main source code
β”‚   └── main.py               # Main entry point
β”œβ”€β”€ assets/                  # Documentation assets (e.g., images)
β”‚   └── img/
β”œβ”€β”€ requirements.txt         # Python dependencies
└── README.md

πŸ–₯️ Sample Output Table

Image ID Coiling Level Length (px) Avg Width (px) Tail Shape Area (pxΒ²)
sample001.png Level 1 435 28.5 tapered 8120
sample002.png Level 3 310 35.2 rounded 8904