Cohort Quality Dashboard¶
The HistoKit Cohort Quality Dashboard is an interactive Streamlit application for exploring whole-slide image (WSI) quality control results. It supports cohort-level analysis, visual inspection of individual slides, and selection of slides for downstream histopathological image analysis.
The dashboard uses previously computed artifact statistics, slide thumbnails, and artifact masks.
Video tutorial¶
Getting started¶
Input data¶
Prepare the slide-level statistics CSV and, optionally, directories containing slide thumbnails and rendered artifact masks.
outputs/
├── slide_stats.csv
├── thumbnails/
│ ├── slide_001.png
│ └── slide_002.png
└── artifact_masks/
├── slide_001.png
└── slide_002.png
Launching the dashboard¶
From the directory containing the Dashboard/run_app.py script, run:
streamlit run_app.py -- --csv ./outputs/slide_stats.csv --thumbnails ./outputs/thumbnails --masks ./outputs/artifact_masks
Open the local URL printed by Streamlit, typically http://localhost:8501.
| Argument | Type | Description |
|---|---|---|
--csv |
Path | Path to the slide-level statistics CSV. |
--thumbnails |
Path | Directory containing slide thumbnail images. |
--masks |
Path | Directory containing rendered artifact mask images. |
CSV format¶
Each row represents one slide. At least one of filepath or basename must be present. If both are present, filepath takes precedence. The filename stem is used as the slide identifier.
| Column | Description |
|---|---|
filepath |
Original WSI path. |
basename |
Alternative slide identifier. |
artifact_pct |
Total artifact percentage among non-background pixels; required for threshold-based filtering. |
artifact_free_pct |
Artifact-free percentage; calculated as 100 - artifact_pct if absent. |
non_background_pixels |
Number of non-background pixels. |
artifact_pixels |
Number of artifact pixels. |
Tissue_Fold_pct |
Tissue fold percentage. |
Dark_Spot_Foreign_Object_pct |
Dark spot and foreign object percentage. |
Pen_pct |
Pen mark percentage. |
Edge_Air_Bubble_pct |
Edge and air bubble percentage. |
Out_of_Focus_pct |
Out-of-focus percentage. |
Example CSV:
basename,artifact_pct,artifact_free_pct,Tissue_Fold_pct,Dark_Spot_Foreign_Object_pct,Pen_pct,Edge_Air_Bubble_pct,Out_of_Focus_pct
slide_001,8,92,2,1,1,1,3
slide_002,15,85,4,2,1,3,5
Cohort Overview¶
Displays:
- Number of slides.
- Mean artifact-free tissue percentage.
- Mean artifact percentage.
- Box plots of available artifact classes.
- Histogram of total artifact burden.
Artifact Trends¶
Displays interactive line plots of artifact percentages in CSV row order.
Users can:
- Select visible artifact classes.
- Adjust the artifact threshold.
- Inspect retained and excluded slide counts.
- Preview a selected slide with its artifact composition.
Slide Explorer¶
Displays:
- Selected slide thumbnail and artifact mask side by side.
- Artifact-free tissue and total artifact percentages.
- Horizontal bar chart of available artifact classes.
- Expandable metadata table.
Download CSV¶
Allows users to:
- Filter slides by maximum total artifact percentage.
- Search by slide name (case-insensitive).
- Export the filtered table as
histokit_filtered_stats.csv.
Note
The original CSV is not modified.
Quality-based cohort selection¶
| Condition | Selection status |
|---|---|
| Total artifact percentage ≤ threshold | Retained |
| Total artifact percentage > threshold | Excluded |
| Missing total artifact percentage | Not evaluated |
Slides with missing total artifact percentages are neither counted as retained nor excluded in the trends summary and are omitted by the threshold filter in the export tab.
Artifact colors¶
| Color | Artifact class | HEX code |
|---|---|---|
| Tissue Fold | #FF6347 |
|
| Dark Spot / Foreign Object | #00FF00 |
|
| Pen | #FF0000 |
|
| Edge / Air Bubble | #FF00FF |
|
| Out of Focus | #4B0082 |
|
| Total artifacts | #03DBFC |
The individual artifact colors follow the HistoKit GrandQC visualization palette. Cyan is used for the aggregate artifact percentage in dashboard charts, not as an additional segmentation class.
Citation¶
If you use the HistoKit Cohort Quality Dashboard in your research, please cite the following conference contribution:
Merta J, Pietrus M, Gawron I, Marczyk M. 2026. Pre-processing whole-slide histopathology images with HistoKit for endometrial cancer grade classification. In: XXX Gliwice Scientific Meetings, Gliwice, November 19–20, 2026 [Internet]. Gliwice; pp. 117–117.
Conference proceedings (p. 117)
@inproceedings{merta2026preprocessing,
author = {Merta, J. and Pietrus, M. and Gawron, I. and Marczyk, M.},
title = {Pre-processing whole-slide histopathology images with {HistoKit} for endometrial cancer grade classification},
booktitle = {XXX Gliwice Scientific Meetings},
year = {2026},
address = {Gliwice, Poland},
pages = {117},
url = {https://gsn.io.gliwice.pl/materials/GSM_2026.pdf}
}
When the underlying quality control results are generated using GrandQC, follow its separate citation and licensing requirements as well.
