Skip to content

DeMONLab-BioFINDER/pathology-semantic-segmentation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Object-Level Quantification from Segmentation Maps

Post-processing pipeline for converting RGB semantic segmentation outputs into object-level counts of pathological structures. The script extracts class-specific regions from a single color-coded segmentation image, applies morphological operations to merge fragmented structures, and performs connected component analysis to count individual objects.


Overview

The pipeline operates on segmentation outputs where each class is encoded using a fixed RGB color:

  • Red [0, 0, 255] → Dystrophic neurites
  • Green [0, 255, 0] → Tangle-bearing cell bodies
  • Blue [255, 0, 0] → Neuritic plaques

For each image:

  1. Class-specific regions are extracted via exact RGB thresholding
  2. Morphological closing is applied to merge fragmented regions
  3. External contours are detected
  4. Each valid contour is counted as one object
  5. Results are saved as annotated images and in a CSV file

Method Details

Class Extraction

Binary masks are generated by selecting pixels that exactly match the RGB values of each class.

Morphological Processing

Morphological closing (dilation followed by erosion) is applied using class-specific kernel sizes:

Class Kernel Size Purpose
Neurites 1 × 1 Minimal processing
Cell bodies 80 × 80 Merge fragmented regions
Plaques 250 × 250 Merge large fragmented structures

These kernel sizes act as hyperparameters controlling how nearby regions are merged. They were manually tuned based on visual inspection.

Object Detection

  • Contours are extracted and each one is treated as one object
  • Small/noisy detections are filtered:
    • Cell bodies & plaques: ≥ 5 points

About

Post-processing pipeline for object-level quantification from RGB segmentation maps

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors