Lab book · Parallax Metrology · built from results/ by scripts/04_labbook.py
Same tissue, two scanners: TRIDENT tissue segmentation on paired PLISM scans
13 PLISM tissue-array sections, each scanned on Aperio AT2 and Aperio GT450, were run through TRIDENT's three tissue segmenters at their defaults. The tissue is fixed; only the scanner changes. This records how much each segmenter's tissue region changes, using the same 156 registered fields and admission rule as the earlier HistoQC study.
1. Status and record
- Plan written and frozen before any TRIDENT segmentation of these scans:
PLAN.md, SHA-256d861f65b5ac0193539c10ab791e0ca05375d3fa795c8e61fe7548d647b3c259b. - Addendum 1 (
2ca3e8ed7d72…): at 10x TRIDENT reads level 0 of the GT450 files, so complete GT450 files were downloaded from figshare and MD5-checked; AT2 runs use the existing range-acquired copies, which are only ever read at reduced levels. - Addendum 2 (
3cfb9bd7de58…): data-loader workers set to 0 after a macOS fork crash; weights pinned locally with SHA-256. - Addendum 3 (
13a14c093b63…): the artifact-removal step ignores the requested device (see section 7); for that secondary arm only, the device default is patched at run time. TRIDENT source is not edited. - Secondary arm
hest_artifacts: complete; numbers in the summary table and switched-field list. - Posted 19 November 2026: the study as mahmoodlab/TRIDENT#250 (
ISSUE_DRAFT.md) and a comment on #237 (ISSUE_DRAFT_DEVICE.md).
2. Material and software
- 26 scans: 13 H&E sections from the PLISM dataset (Ochi et al., CC BY 4.0), each on AT2 (0.2532 µm/px) and GT450 (0.2621 µm/px). 156 registered 128 µm fields, 12 per section, with native level-0 polygons for both scanners, reused unchanged from the HistoQC study.
- TRIDENT at commit
c07bf25b9ad937bc6c8af8ea4ef16eb9979bbe8a, torch 2.15.0, OpenSlide 4.0.1, Python 3.11.17. Segmenters at the defaultsrun_batch_of_slides.py --task seguses: HEST (DeepLabV3, 10x), GrandQC (UNet++, 1x), Otsu (1.25x); confidence 0.5; holes counted as tissue; batch 64. HEST and GrandQC ran on Apple MPS, Otsu on CPU; one device per segmenter for all 26 scans. - Tissue region = union of polygons in TRIDENT's
contours_geojson. A field is admitted on a scanner when at least half its area lies inside the region (exact polygon intersection). This rule is ours, not TRIDENT's.
3. Technical gate
Every run's pyramid level, as chosen by TRIDENT's own rule (get_best_level_and_custom_downsample, tolerance 0.1), was recorded before segmenting. The runner stops if a range-acquired AT2 copy would be read at level 0; no run stopped.
Source integrity (second pass, scripts/05_checks.py): in all 13 AT2 copies, every tile of every reduced-resolution page (124877 tiles) lies inside the byte ranges actually fetched (0 outside), and all 1145 fetched ranges match the SHA-256 in their receipts (0 mismatches). No pixel TRIDENT read from these copies can be missing data. This replaces the planned all-zero pixel check with a stronger byte-level one.
| run | segmenter | device | scans | scanner | seconds | level read | artifact-model level |
|---|---|---|---|---|---|---|---|
| grandqc | grandqc | mps | 13 | AT2 | 44 | AT2: level 3, extra downsample 1.234 | |
| grandqc | grandqc | mps | 13 | GT450 | 280 | GT450: level 2, extra downsample 2.384; GT450: level 2, extra downsample 2.385 | |
| hest | hest | mps | 13 | AT2 | 10752 | AT2: level 1, extra downsample 1.0 | |
| hest | hest | mps | 13 | GT450 | 7414 | GT450: level 0, extra downsample 3.815 | |
| hest_artifacts | hest | mps | 13 | AT2 | 6278 | AT2: level 1, extra downsample 1.0 | AT2: level 1 |
| hest_artifacts | hest | mps | 13 | GT450 | 10453 | GT450: level 0, extra downsample 3.815 | GT450: level 0 |
| hest_artifacts_repeat | hest | mps | 4 | AT2+GT450 | 1923 | AT2: level 1, extra downsample 1.0; GT450: level 0, extra downsample 3.815 | AT2: level 1; GT450: level 0 |
| hest_repeat | hest | mps | 2 | AT2+GT450 | 709 | AT2: level 1, extra downsample 1.0; GT450: level 0, extra downsample 3.815 | |
| otsu | otsu | cpu | 13 | AT2 | 60 | AT2: level 2, extra downsample 1.974; AT2: level 2, extra downsample 1.975 | |
| otsu | otsu | cpu | 13 | GT450 | 64 | GT450: level 2, extra downsample 1.907; GT450: level 2, extra downsample 1.908 |
Repeatability: KR_AT2 and KR_GT450 segmented a second time with HEST give regions with zero symmetric difference from the first run (criterion: areas within 0.1%). Pass.
Level path: for HEST at 10x, AT2 (level downsamples 1, 4, 16, 32) is read from level 1 directly. GT450 (1, 4, 16, 64) has its level 1 at a downsample of 4.0, outside the 0.1 tolerance of the wanted 3.815, so TRIDENT reads level 0 and downsamples by 3.815. GrandQC reads AT2 at level 3 and GT450 at level 2. The two scanners therefore reach the same model through different reading paths.
4. Readings 1 to 3: summary
| tool | fields switched | AT2-only / GT450-only | mean section switch fraction | median GT450/AT2 area | range | GT450 smaller | region below 10% of its pair |
|---|---|---|---|---|---|---|---|
| HEST (default) | 6 of 156 | 3 / 3 | 0.038 | 0.978 | 0.941 to 1.144 | 11 of 13 | none |
| GrandQC | 1 of 156 | 0 / 1 | 0.006 | 0.992 | 0.975 to 1.048 | 11 of 13 | none |
| Otsu | 28 of 156 | 18 / 10 | 0.179 | 0.933 | 0.596 to 8.405 | 12 of 13 | none |
| HEST + remove_artifacts | 26 of 156 | 10 / 16 | 0.167 | 0.998 | 0.802 to 1.990 | 7 of 13 | none |
| HistoQC default (context, different rule) | 52 of 156 | 47 / 5 | n/a | 0.065 (usable tissue) | n/a | n/a | n/a |
5. Which fields switch
For HEST, GrandQC and the artifact arm every switched field is listed. A fraction near 0 on one scan and near 1 on the other means a whole tissue core (or the part holding that field) is in one region and absent from the other; this is the case for 3 of HEST's 6 and 1 of GrandQC's 1, and 12 of the 26 with artifact removal (section 7). Otsu's 28 switched fields are in results/fields.csv; 19 of them are of the whole-core kind, and 10 are in section HR.
| tool | section | field | fraction inside, AT2 | fraction inside, GT450 | admitted on |
|---|---|---|---|---|---|
| HEST (default) | HR | 1 | 0.0 | 1.0 | GT450 only |
| HEST (default) | HR | 4 | 0.0 | 1.0 | GT450 only |
| HEST (default) | HR | 9 | 0.424901 | 1.0 | GT450 only |
| HEST (default) | HRH | 6 | 1.0 | 0.046522 | AT2 only |
| HEST (default) | KR | 5 | 0.729451 | 0.179376 | AT2 only |
| HEST (default) | KRH | 7 | 0.808543 | 0.0 | AT2 only |
| GrandQC | HR | 1 | 0.0 | 1.0 | GT450 only |
| HEST + remove_artifacts | GIV | 0 | 0.413241 | 0.865835 | GT450 only |
| HEST + remove_artifacts | GIV | 8 | 0.219455 | 1.0 | GT450 only |
| HEST + remove_artifacts | GIVH | 5 | 0.784986 | 0.0 | AT2 only |
| HEST + remove_artifacts | GM | 0 | 1.0 | 0.0 | AT2 only |
| HEST + remove_artifacts | GM | 11 | 1.0 | 0.498913 | AT2 only |
| HEST + remove_artifacts | GV | 6 | 0.290711 | 1.0 | GT450 only |
| HEST + remove_artifacts | GV | 9 | 0.0 | 1.0 | GT450 only |
| HEST + remove_artifacts | GVH | 7 | 0.3083 | 0.819335 | GT450 only |
| HEST + remove_artifacts | GVH | 9 | 0.993942 | 0.450224 | AT2 only |
| HEST + remove_artifacts | HR | 1 | 0.0 | 0.913255 | GT450 only |
| HEST + remove_artifacts | HR | 8 | 0.0 | 1.0 | GT450 only |
| HEST + remove_artifacts | HR | 10 | 0.0 | 0.98267 | GT450 only |
| HEST + remove_artifacts | HR | 11 | 1.0 | 0.0 | AT2 only |
| HEST + remove_artifacts | HRH | 0 | 0.332213 | 1.0 | GT450 only |
| HEST + remove_artifacts | KR | 3 | 0.0 | 1.0 | GT450 only |
| HEST + remove_artifacts | KR | 4 | 0.085178 | 1.0 | GT450 only |
| HEST + remove_artifacts | KRH | 5 | 1.0 | 0.0 | AT2 only |
| HEST + remove_artifacts | KRH | 7 | 1.0 | 0.0 | AT2 only |
| HEST + remove_artifacts | LM | 5 | 0.0 | 1.0 | GT450 only |
| HEST + remove_artifacts | LM | 7 | 1.0 | 0.0 | AT2 only |
| HEST + remove_artifacts | LM | 8 | 0.652372 | 0.0 | AT2 only |
| HEST + remove_artifacts | LM | 11 | 0.0 | 1.0 | GT450 only |
| HEST + remove_artifacts | LMH | 0 | 0.166008 | 0.885354 | GT450 only |
| HEST + remove_artifacts | MY | 6 | 1.0 | 0.285743 | AT2 only |
| HEST + remove_artifacts | MY | 8 | 0.0 | 1.0 | GT450 only |
| HEST + remove_artifacts | MY | 11 | 0.249012 | 1.0 | GT450 only |
6. What the regions look like
Section HR is the darkest-stained section on both scanners, and AT2 renders every section darker than GT450. Median tissue brightness (luma 0 to 255, 2000-pixel thumbnail, results/brightness.csv): HR 47.4 on AT2 and 112.1 on GT450; the other 12 sections 145.0 to 191.8 on AT2 and 196.3 to 215.2 on GT450. HEST's AT2 region for HR is 146.8906 mm² against 168.0541 mm² on GT450; Otsu's is 19.7537 against 166.0226; GrandQC's is 184.4729 against 193.3326. On the HEST contour overlay, the dark AT2 scan has straight-edged gaps cut into many cores; the GT450 scan of the same section has few.
A tiling cause was checked: long axis-aligned contour edges on HEST HR_AT2 (116 edges) were compared with the 512-pixel model input grid (2048 level-0 pixels, starting at the slide origin). One lies within 16 pixels of a grid line, and their positions modulo 2048 are spread across the range. The straight edges are not explained by the model tiles. They may come from the contour step, which resizes the mask to 2000 rows; this was not tested.
7. Secondary readings
Minimum piece size. mask_to_gdf resizes the mask to 2000 rows and drops pieces below min_contour_area=1000 scaled by mpp². In physical terms the threshold is 1000 × (slide height in µm / 2000)² and so depends on the slide's height, not only its resolution. Median across the 13 sections: 0.0939 mm² on AT2, 0.1194 mm² on GT450 (range 0.0838 to 0.1050 and 0.1144 to 0.1235). The smallest piece kept differs between the two scans of the same glass.
Artifact-removal device. Processor.run_segmentation_job passes device and batch_size to the tissue segmenter but not to the artifact model, whose segment_tissue call then uses the defaults device='cuda:0', batch_size=16. On this machine the first run stopped with "Torch not compiled with CUDA enabled". On a multi-GPU machine, the same line would send the artifact model to cuda:0 whatever --gpu was given (inferred from the code, not run). An open pull request, mahmoodlab/TRIDENT#237 (7 September 2026, another contributor), already passes device to this call, together with MPS routing and macOS data loading; it does not pass batch_size.
HEST with remove_artifacts (secondary arm; HEST at defaults, then TRIDENT's GrandQC artifact model at 10x, which removes regions it classes as artifact): complete; numbers in the summary table and switched-field list.
With artifact removal, 26 fields switch (10 AT2-only, 16 GT450-only), in 12 of 13 sections, against 6 for HEST alone; 12 are of the whole-core kind. The independent point-sampling rescore reproduces all 26 (0 decision mismatches). The table gives the share of HEST's own region that remains after artifact removal, per scan, and the switched fields before and after (AT2-only + GT450-only). In HR the step keeps 20.6 mm² on AT2 and 40.9 mm² on GT450, of HEST's 146.9 and 168.1; 7 of HR's 12 fields are outside the region on both scans. On the overlays the removed areas have straight, stepped edges in all four sections drawn, and their outline differs between the two scans of the same glass. Two GT450 scans (GMH, KRH) end slightly larger than HEST alone (ratio above 1); this was not investigated. Repeatability: HR and MY were run through the artifact arm a second time on both scanners (scripts/07_artifact_repeat.py, results/artifact_repeat.json); HR_AT2 0.0 mm², HR_GT450 0.0 mm², MY_AT2 0.0 mm², MY_GT450 0.0 mm² symmetric difference from the first run, and 0 field decisions change. The differences between scanners are not run-to-run variation on these scans. A maintainer has described this model as removing even slightly out-of-focus regions (mahmoodlab/TRIDENT#202); no focus measurement was made here.
| section | kept after artifact removal, AT2 | kept, GT450 | switched: HEST → with artifact removal |
|---|---|---|---|
| GIV | 0.913 | 0.951 | 0+0 → 0+2 |
| GIVH | 0.956 | 0.983 | 0+0 → 1+0 |
| GM | 0.880 | 0.827 | 0+0 → 2+0 |
| GMH | 0.975 | 1.006 | 0+0 → 0+0 |
| GV | 0.905 | 0.986 | 0+0 → 0+2 |
| GVH | 0.969 | 0.999 | 0+0 → 1+1 |
| HR | 0.140 | 0.243 | 0+3 → 1+3 |
| HRH | 0.950 | 0.988 | 1+0 → 0+1 |
| KR | 0.845 | 0.991 | 1+0 → 0+2 |
| KRH | 0.966 | 1.002 | 1+0 → 2+0 |
| LM | 0.791 | 0.773 | 0+0 → 2+2 |
| LMH | 0.948 | 0.998 | 0+0 → 0+1 |
| MY | 0.890 | 0.720 | 0+0 → 1+2 |
scripts/06_artifact_fig.py from TRIDENT's contours_geojson.8. Deviations and incidents
- Device: MPS instead of CUDA for HEST and GrandQC (Plan, as written).
- Data-loader workers 0 (Addendum 2). Artifact-step device patched at run time (Addendum 3); the partial output of the failed first attempt was deleted before the rerun.
- The planned all-zero pixel check was replaced by a byte-level check of fetched ranges and receipt hashes (section 3), done in the second pass.
- Second pass, 19 November (
scripts/05_checks.py,results/checks.json): an independent re-scoring by 40 × 40 point sampling in each field reproduces every field decision (hest 6, grandqc 1, otsu 28, hest_artifacts 26 switched; 0 decision mismatches; no fraction differs by more than 0.03). Field polygons measure 128.12 and 128.24 µm a side on AT2 and GT450, confirming the scanner order in the field maps. The HistoQC context figure recounts from that study's own field table as 52 (47 AT2-only, 5 GT450-only). The first draft called HR's AT2 scan "unusually dark"; measured brightness shows HR is the darkest section on both scanners, and the wording was corrected. - A background wait loop meant to start HEST GT450 after HEST AT2 matched its own command line and never released; it was stopped and the runs started directly. No data effect.
- After the artifact arm finished, a repeat of it on HR and MY (both scanners) was added before posting, to check run-to-run stability. This check was not in the plan; result in section 7.
- A tile-grid explanation for the straight-edged gaps was checked after seeing the overlays and is not supported (section 6). This check was not in the plan.
9. Scope
One tissue array, two scanners from one vendor, 13 serial and differently stained sections from shared tissue. Descriptive only, with no inference to other patients, scanners or vendors. Neither scanner nor any segmenter is taken as correct: a change between scanners says which tool is sensitive here, not which region is right. The field rule is ours; TRIDENT's own patching uses min_tissue_proportion, default 0. No private Parallax measurements are used.
10. Files
PLAN.md, ADDENDUM_1-3.md with hashes; scripts/01_download_gt450.py, 02_segment.py, 03_score.py, 04_labbook.py, 05_checks.py, 06_artifact_fig.py, 07_artifact_repeat.py; out/<arm>/ TRIDENT job folders with run_meta_*.json; results/fields.csv, sections.csv, scans.csv, summary.json; logs/; figs/.
Per-section table, all segmenters
| tool | section | fields | both in | AT2 only | GT450 only | both out | AT2 mm² | GT450 mm² | GT450/AT2 |
|---|---|---|---|---|---|---|---|---|---|
| HEST (default) | GIV | 12 | 12 | 0 | 0 | 0 | 165.5162 | 165.3084 | 0.9987 |
| HEST (default) | GIVH | 12 | 12 | 0 | 0 | 0 | 170.3493 | 163.7437 | 0.9612 |
| HEST (default) | GM | 12 | 12 | 0 | 0 | 0 | 164.7909 | 165.9091 | 1.0068 |
| HEST (default) | GMH | 12 | 12 | 0 | 0 | 0 | 171.0313 | 160.9579 | 0.9411 |
| HEST (default) | GV | 12 | 12 | 0 | 0 | 0 | 168.9472 | 165.1498 | 0.9775 |
| HEST (default) | GVH | 12 | 12 | 0 | 0 | 0 | 172.0887 | 166.5813 | 0.968 |
| HEST (default) | HR | 12 | 8 | 0 | 3 | 1 | 146.8906 | 168.0541 | 1.1441 |
| HEST (default) | HRH | 12 | 11 | 1 | 0 | 0 | 172.6834 | 166.6464 | 0.965 |
| HEST (default) | KR | 12 | 11 | 1 | 0 | 0 | 165.0013 | 161.2973 | 0.9776 |
| HEST (default) | KRH | 12 | 11 | 1 | 0 | 0 | 167.3476 | 160.3509 | 0.9582 |
| HEST (default) | LM | 12 | 12 | 0 | 0 | 0 | 169.9148 | 166.9438 | 0.9825 |
| HEST (default) | LMH | 12 | 12 | 0 | 0 | 0 | 173.3442 | 169.045 | 0.9752 |
| HEST (default) | MY | 12 | 12 | 0 | 0 | 0 | 167.5582 | 166.1075 | 0.9913 |
| GrandQC | GIV | 12 | 12 | 0 | 0 | 0 | 191.8691 | 187.954 | 0.9796 |
| GrandQC | GIVH | 12 | 12 | 0 | 0 | 0 | 192.5337 | 187.7254 | 0.975 |
| GrandQC | GM | 12 | 12 | 0 | 0 | 0 | 188.0509 | 188.9569 | 1.0048 |
| GrandQC | GMH | 12 | 12 | 0 | 0 | 0 | 194.1426 | 189.3417 | 0.9753 |
| GrandQC | GV | 12 | 12 | 0 | 0 | 0 | 195.2028 | 190.436 | 0.9756 |
| GrandQC | GVH | 12 | 12 | 0 | 0 | 0 | 194.8494 | 193.2787 | 0.9919 |
| GrandQC | HR | 12 | 11 | 0 | 1 | 0 | 184.4729 | 193.3326 | 1.048 |
| GrandQC | HRH | 12 | 12 | 0 | 0 | 0 | 194.6583 | 190.9841 | 0.9811 |
| GrandQC | KR | 12 | 12 | 0 | 0 | 0 | 191.8156 | 191.0651 | 0.9961 |
| GrandQC | KRH | 12 | 12 | 0 | 0 | 0 | 191.6839 | 190.4477 | 0.9936 |
| GrandQC | LM | 12 | 12 | 0 | 0 | 0 | 189.843 | 188.7178 | 0.9941 |
| GrandQC | LMH | 12 | 12 | 0 | 0 | 0 | 195.2844 | 190.9587 | 0.9778 |
| GrandQC | MY | 12 | 12 | 0 | 0 | 0 | 190.6377 | 189.7528 | 0.9954 |
| Otsu | GIV | 12 | 11 | 1 | 0 | 0 | 161.9701 | 151.0884 | 0.9328 |
| Otsu | GIVH | 12 | 12 | 0 | 0 | 0 | 165.6137 | 151.6921 | 0.9159 |
| Otsu | GM | 12 | 8 | 4 | 0 | 0 | 155.2782 | 92.5611 | 0.5961 |
| Otsu | GMH | 12 | 11 | 0 | 1 | 0 | 162.5595 | 154.424 | 0.95 |
| Otsu | GV | 12 | 10 | 1 | 0 | 1 | 166.9655 | 158.7308 | 0.9507 |
| Otsu | GVH | 12 | 12 | 0 | 0 | 0 | 167.6989 | 164.7138 | 0.9822 |
| Otsu | HR | 12 | 1 | 1 | 9 | 1 | 19.7537 | 166.0226 | 8.4047 |
| Otsu | HRH | 12 | 11 | 0 | 0 | 1 | 167.1934 | 164.2787 | 0.9826 |
| Otsu | KR | 12 | 7 | 4 | 0 | 1 | 148.5782 | 88.6843 | 0.5969 |
| Otsu | KRH | 12 | 11 | 1 | 0 | 0 | 149.6383 | 113.1351 | 0.7561 |
| Otsu | LM | 12 | 10 | 2 | 0 | 0 | 166.2836 | 146.5676 | 0.8814 |
| Otsu | LMH | 12 | 12 | 0 | 0 | 0 | 167.6217 | 164.8063 | 0.9832 |
| Otsu | MY | 12 | 8 | 4 | 0 | 0 | 147.9418 | 88.4867 | 0.5981 |
| HEST + remove_artifacts | GIV | 12 | 10 | 0 | 2 | 0 | 151.0869 | 157.2419 | 1.0407 |
| HEST + remove_artifacts | GIVH | 12 | 11 | 1 | 0 | 0 | 162.8466 | 160.9816 | 0.9885 |
| HEST + remove_artifacts | GM | 12 | 8 | 2 | 0 | 2 | 145.0566 | 137.2617 | 0.9463 |
| HEST + remove_artifacts | GMH | 12 | 12 | 0 | 0 | 0 | 166.7331 | 161.9631 | 0.9714 |
| HEST + remove_artifacts | GV | 12 | 10 | 0 | 2 | 0 | 152.8361 | 162.8581 | 1.0656 |
| HEST + remove_artifacts | GVH | 12 | 10 | 1 | 1 | 0 | 166.674 | 166.3673 | 0.9982 |
| HEST + remove_artifacts | HR | 12 | 1 | 1 | 3 | 7 | 20.5616 | 40.9136 | 1.9898 |
| HEST + remove_artifacts | HRH | 12 | 11 | 0 | 1 | 0 | 164.1222 | 164.6946 | 1.0035 |
| HEST + remove_artifacts | KR | 12 | 10 | 0 | 2 | 0 | 139.4607 | 159.9046 | 1.1466 |
| HEST + remove_artifacts | KRH | 12 | 10 | 2 | 0 | 0 | 161.6809 | 160.681 | 0.9938 |
| HEST + remove_artifacts | LM | 12 | 7 | 2 | 2 | 1 | 134.4529 | 129.093 | 0.9601 |
| HEST + remove_artifacts | LMH | 12 | 11 | 0 | 1 | 0 | 164.3696 | 168.7756 | 1.0268 |
| HEST + remove_artifacts | MY | 12 | 9 | 1 | 2 | 0 | 149.1725 | 119.6525 | 0.8021 |