How devdeepsarkar/nucleiscope works
NucleiScope is a research tool for segmenting H&E-stained tissue images, separating touching nuclei, and reporting per-nucleus morphometry and tissue density. Its main user workflow loads an image or whole slide, runs tiled prediction and instance separation, measures nuclei, and writes summaries and density visualizations. A separate training and evaluation workflow prepares labeled crops, trains the U-Net, and scores predictions; the classical baseline provides a non-learning comparison. Connections below follow the README and shown source references; unsampled details are not inferred.
Main entry points: infer.py Tiled inference · evaluate.py Evaluation runner · data.py Labeled crops · train.py Model training
Components 15
Training data
- Labeled crops
nucleiscope/data.py - Stain handling
nucleiscope/stain.py - Model training
train.py
Segmentation
- U-Net
nucleiscope/model.py - Tiled inference
nucleiscope/infer.py - Instance watershed
nucleiscope/post.py - Classical baseline
nucleiscope/baseline.py - Whole-slide engine
nucleiscope/wsi.py - Segmentation CLI
segment.py
Measurement
- Nucleus morphometry
nucleiscope/morph.py - Nuclei and density outputs
segment.py
Evaluation
- Evaluation runner
evaluate.py - Threshold tuning
tune.py - Segmentation metrics
nucleiscope/metrics.py
Other components
- User / image
Connections 26
- User / image → Segmentation CLI: provides image
README.md - Segmentation CLI → Whole-slide engine: runs slide
segment.py - Segmentation CLI → Tiled inference: configures predictor
segment.py - Segmentation CLI → Nuclei and density outputs: writes results
segment.py - Whole-slide engine → Tiled inference: predicts blocks
segment.py - Whole-slide engine → Instance watershed: separates nuclei
nucleiscope/wsi.py - Whole-slide engine → Nucleus morphometry: measures instances
nucleiscope/wsi.py - Tiled inference → U-Net: runs model
nucleiscope/infer.py - Tiled inference → Labeled crops: normalizes input
nucleiscope/infer.py - Labeled crops → Stain handling: augments stains
nucleiscope/data.py - Model training → Labeled crops: loads crops
train.py - Model training → U-Net: trains model
train.py - Model training → Tiled inference: validates with
train.py - Model training → Segmentation metrics: scores validation
train.py - Nucleus morphometry → Stain handling: extracts hematoxylin
nucleiscope/morph.py - Evaluation runner → Labeled crops: loads test split
evaluate.py - Evaluation runner → Tiled inference: predicts tiles
evaluate.py - Evaluation runner → Instance watershed: labels predictions
evaluate.py - Evaluation runner → Classical baseline: selects baseline
evaluate.py - Evaluation runner → Segmentation metrics: scores predictions
evaluate.py - Classical baseline → Stain handling: uses stain handling
nucleiscope/baseline.py - Classical baseline → Instance watershed: uses watershed
nucleiscope/baseline.py - Threshold tuning → Labeled crops: loads validation split
tune.py - Threshold tuning → Tiled inference: predicts tiles
tune.py - Threshold tuning → Instance watershed: tests thresholds
tune.py - Threshold tuning → Segmentation metrics: selects by AJI
tune.py