Gradient Biotech
U

Menu

Annotated compartments

Quantify cell density and spatial metrics within pathologist-defined regions — tumor, stroma, necrosis, or lymphoid compartments imported from GeoJSON or QuPath exports.

Research question

What are the cell counts, densities, and spatial statistics within each labeled tissue compartment rather than across the whole slide?

Who this is for

  • Pathology research groups working with manually annotated tumor/stroma regions
  • Translational teams who define ROIs in QuPath and need reproducible quantification
  • Studies comparing metrics across annotated compartments (tumor core vs. invasive margin)

Data requirements

DataRequiredPurpose
Uploaded and tiled slideYesBase image for overlay and quantification
Completed segmentationYesCell objects for compartment assignment
Region annotationsYesGeoJSON FeatureCollection or QuPath export

Import annotations via POST /pathology/slides/{id}/annotations/import.

Workflow

Upload slide → Tiles → Tissue detect → Import GeoJSON annotations → Segment cells → Spatial quantification

Step 1 — Prepare slide and annotations

Upload the slide and generate tiles. Export region polygons from QuPath as GeoJSON, or prepare a standard GeoJSON FeatureCollection with polygon geometries. Each feature should include a label or classification property for region naming.

Example GeoJSON structure:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": { "label": "tumor" },
      "geometry": { "type": "Polygon", "coordinates": [[...]] }
    },
    {
      "type": "Feature",
      "properties": { "label": "stroma" },
      "geometry": { "type": "Polygon", "coordinates": [[...]] }
    }
  ]
}

Step 2 — Import annotations

Import region labels from the slide detail page or API. Annotations appear as overlays in the slide viewer.

Step 3 — Segment and quantify

Run Segment cells, then Spatial quantification. Region-level metrics aggregate detected cells within each annotated compartment.

Step 4 — Review region metrics

Inspect the Region metrics table on the slide detail page:

  • Cell count and density per compartment
  • Mean cell area and confidence within regions
  • Compartment-specific nearest-neighbor statistics

Export region_metrics.json for downstream statistical comparison across slides or sample groups.

Expected outputs

  • Annotation overlays in the slide viewer
  • Per-compartment cell counts and density
  • Region-level spatial statistics in JSON export
  • Comparison-ready tables when multiple slides share the same compartment schema

Typical analyses

AnalysisRegionsQuestion
Tumor vs. stromatumor, stromaIs cell density higher in stroma than tumor core?
Invasive marginmargin, coreHow does infiltration change at the leading edge?
Necrotic zonesviable, necrosisAre detected cells excluded from necrotic areas?
Lymphoid aggregateslymphoid, tumorAre immune-rich regions spatially separated from tumor?

Related guides