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criptomics
|
| 10 |
+
- roi-selection
|
| 11 |
+
- tumor-microenvironment
|
| 12 |
+
- computational-pathology
|
| 13 |
+
- tme-segmentation
|
| 14 |
+
- foundation-model
|
| 15 |
+
pipeline_tag: object-detection
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
# ROI-ST: Automated ROI Selection for Spatial Transcriptomics Whole-Slide Images
|
| 19 |
+
|
| 20 |
+
## Model Summary
|
| 21 |
+
|
| 22 |
+
**ROI-ST** is a multi-scenario framework for automated Region of Interest (ROI) selection in whole-slide images (WSIs) intended for downstream spatial transcriptomics (ST) analysis. It combines a trained tile-level classifier, TME segmentation masks, and generalist/specialist foundation model embeddings to identify spatially informative ROIs and benchmark them against manual pathologist annotations.
|
| 23 |
+
|
| 24 |
+
The framework comprises three independent scenarios of increasing complexity, each targeting a different combination of inputs and use cases. It is released to support reproducibility of the results reported in *[paper title]*.
|
| 25 |
+
|
| 26 |
+
---
|
| 27 |
+
|
| 28 |
+
## Scenarios Overview
|
| 29 |
+
|
| 30 |
+
| Scenario | Approach | Key Input | Key Output |
|
| 31 |
+
|----------|----------|-----------|------------|
|
| 32 |
+
| **Scenario 1 — GFM** | Tile-level classifier on foundation model embeddings | HDF5 embeddings + WSI | Probability heatmap, predicted ROI window |
|
| 33 |
+
|
| 34 |
+
---
|
| 35 |
+
|
| 36 |
+
## Intended Use
|
| 37 |
+
|
| 38 |
+
### Primary Use
|
| 39 |
+
This framework is intended for **research use** in computational pathology and spatial transcriptomics, specifically:
|
| 40 |
+
- Automated ROI candidate identification from WSIs prior to ST placement
|
| 41 |
+
- Benchmarking AI-driven ROI selection against manual pathologist annotations
|
| 42 |
+
- Reproducibility of results reported in *[paper title]*
|
| 43 |
+
|
| 44 |
+
### Out-of-Scope Use
|
| 45 |
+
- Clinical diagnostic decision-making
|
| 46 |
+
- Use without appropriate pre-computed embeddings or segmentation masks
|
| 47 |
+
- Deployment outside the H&E / SVS / OME-TIFF formats described below
|
| 48 |
+
|
| 49 |
+
---
|
| 50 |
+
|
| 51 |
+
## System Requirements
|
| 52 |
+
|
| 53 |
+
| Component | Version |
|
| 54 |
+
|-----------|---------|
|
| 55 |
+
| **Python** | 3.11.0 |
|
| 56 |
+
| **PyTorch** | 2.1.2 + CUDA 12.1 |
|
| 57 |
+
| **TorchVision** | 0.16.2 |
|
| 58 |
+
| **pathologyfoundation (PLIP)** | 0.1.14 |
|
| 59 |
+
| **trident (UNI-V2)** | 0.2.0 |
|
| 60 |
+
| **tmesegformer** | 0.1.0 |
|
| 61 |
+
| **OpenSlide-Python** | 1.3.1 |
|
| 62 |
+
| **NumPy / Pandas / Matplotlib / SciPy / scikit-learn** | see `requirements.txt` |
|
| 63 |
+
|
| 64 |
+
**GPU requirements:** ≥ 24 GB VRAM recommended for WSI-scale inference.
|
| 65 |
+
|
| 66 |
+
| Hardware | CUDA | Status |
|
| 67 |
+
|----------|------|--------|
|
| 68 |
+
| NVIDIA H100 | 12.x | ✅ Validated |
|
| 69 |
+
| NVIDIA A100 | 12.x | ✅ Validated |
|
| 70 |
+
| NVIDIA RTX 4090 | 12.x | ✅ Validated |
|
| 71 |
+
|
| 72 |
+
### Installation
|
| 73 |
+
|
| 74 |
+
```bash
|
| 75 |
+
python3.11 -m venv roi_env
|
| 76 |
+
source roi_env/bin/activate
|
| 77 |
+
pip install --upgrade pip
|
| 78 |
+
pip install -r requirements.txt
|
| 79 |
+
python -m pip check
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
---
|
| 83 |
+
|
| 84 |
+
## Scenario 1 — GFM: Classifier on Foundation Model Embeddings
|
| 85 |
+
|
| 86 |
+
Uses a trained classifier (`tile_classifier.pkl`) applied to tile-level embeddings (HDF5) to compute per-tile probabilities and identify the highest-probability ROI window.
|
| 87 |
+
|
| 88 |
+
### Inputs
|
| 89 |
+
|
| 90 |
+
| Argument | Description |
|
| 91 |
+
|----------|-------------|
|
| 92 |
+
| `--model_dir` | Directory containing `classifier.pkl` |
|
| 93 |
+
| `--test_h5` | HDF5 file with `coords`, `features`, `patch_size_level0` |
|
| 94 |
+
| `--test_tif` | Whole-slide `.tif` image |
|
| 95 |
+
| `--roi_json` | JSON file with manual ROI coordinates `{x0, y0, x1, y1}` |
|
| 96 |
+
| `--out_dir` | Output directory |
|
| 97 |
+
| `--thumb_width` | Thumbnail width in pixels (default: 1000) |
|
| 98 |
+
|
| 99 |
+
### Outputs
|
| 100 |
+
|
| 101 |
+
| File | Description |
|
| 102 |
+
|------|-------------|
|
| 103 |
+
| `probability_heatmap.png` | Tile probability heatmap with predicted ROI overlay |
|
| 104 |
+
| `probability_histogram.png` | Distribution of tile-level probabilities |
|
| 105 |
+
| `thumbnail_overlay.png` | Thumbnail with manual vs predicted ROI rectangles |
|
| 106 |
+
|
| 107 |
+
### Usage
|
| 108 |
+
|
| 109 |
+
```bash
|
| 110 |
+
python3 scenario_1.py \
|
| 111 |
+
--model_dir "./model" \
|
| 112 |
+
--test_h5 "./uni_embeddings/gbm_xxx.h5" \
|
| 113 |
+
--test_tif "./raw_tif/gbm_xxx.tif" \
|
| 114 |
+
--roi_json "./roi_json/gbm_xxx_roi.json" \
|
| 115 |
+
--out_dir "./output"
|
| 116 |
+
```
|
| 117 |
+
|
| 118 |
+
---
|
| 119 |
+
|
| 120 |
+
## Citation
|
| 121 |
+
|
| 122 |
+
If you use this framework, please cite:
|
| 123 |
+
|
| 124 |
+
```bibtex
|
| 125 |
+
@article{[citation_key],
|
| 126 |
+
title = {[Paper title]},
|
| 127 |
+
author = {[Authors]},
|
| 128 |
+
journal = {[Journal]},
|
| 129 |
+
year = {[Year]},
|
| 130 |
+
doi = {[DOI]}
|
| 131 |
+
}
|
| 132 |
+
```
|
| 133 |
+
|
| 134 |
+
---
|
| 135 |
+
|
| 136 |
+
## License
|
| 137 |
+
|
| 138 |
+
This model is released under the **MIT License**. See `LICENSE` for details.
|