Cancer-killing immune cells remain scarcer inside lung tumors at comparable measured distances from blood vessels
Why it matters
In lung cancer samples, cancer-cell regions contained fewer CD8 immune cells than nearby supporting tissue, even at similar distances from measured blood-vessel cells. Other immune groups were also scarcer, and which group looked most depleted depended on how cells were identified. A low CD8 count alone therefore does not show that these cancer-killing cells are specifically being kept out.
Cancer-killing immune cells often collect around cancer-cell nests but are scarce inside them. Researchers want to know whether this pattern reflects barriers to entry or simply differences in access to blood vessels. CD8 T cells, named for the cluster of differentiation (CD) 8 protein they carry, are one such cancer-killing group. In public images from 978 patients with non-small-cell lung cancer, their density inside tumor regions was 0.298 times that in stroma, the surrounding supporting tissue. After matching locations for measured distance from blood vessels, local position and depth from the tumor boundary, this ratio was 0.341 (95% interval 0.304–0.383). Other immune groups were also less dense inside tumor regions. Which group appeared most depleted depended on how cells carrying both immune signals and epithelial signals used to identify cancer-cell regions were counted. Measured vascular remoteness accounts for little of the CD8 density contrast; low CD8 density alone is insufficient evidence that these cells are selectively kept out.
Background
A low density of immune cells within cancer-cell nests is often called immune exclusion. Blood vessels provide one possible spatial explanation: tumor regions may be farther from vascular cells, and immune cells may accumulate near them. Another consideration is the tissue's composition. An area densely occupied by cancer cells can contain fewer cells of many other types, so the comparison needs both absolute densities and consistent rules for identifying immune cells.
Previous lung-cancer studies describe where CD8 cells lie relative to blood vessels and to the boundary between epithelial cancer-cell regions and stroma. These observations motivate comparing the two tissue compartments at similar distances from vessels, alongside other cell groups. Yang et al., 2023; Leo et al., 2026.
We used the public Cords cohort, an imaging mass cytometry study of non-small-cell lung cancer. Imaging mass cytometry measures multiple proteins in tissue sections so cells can be classified and located. The original study examined types of fibroblasts, cells that build and maintain supporting tissue. It released cell annotations (assigned cell types) and maps marking tumor and stromal regions. These maps, also called masks, assign each image pixel to a compartment. Our comparison counts cells per tissue area, including areas with zero immune cells. Cords et al., 2024; public dataset.
Results
CD8 depletion accompanies a broader difference in cell composition
After excluding reference controls, the input contained 1,949 small tissue samples, called cores, arranged in arrays for imaging (tissue microarrays), from 1,068 patients. Sufficient annotations of tumor cells, fibroblasts and blood-vessel cells were present in 1,653 cores. Local matching retained 1,641 cores from 978 patients, without requiring any CD8 cells.
We compared tissue locations in bands, or rings, 10–50 µm inside and outside the released tumor boundaries. We divided images into 100 × 100 µm tiles and compared locations within each tile in the same 10 µm bands of vascular distance and boundary depth. Boundary depth is distance from the tumor–stroma boundary, on either side. Vascular distance was distance to the nearest cell annotated as blood endothelium, the lining of blood vessels, or high endothelial venule, a specialized blood-vessel category. Lymphatic cells were excluded from vascular targets. Matched sets of locations, called strata, received weights based on the smaller tissue area available on either side. Identical weights applied to both compartments and every cell group; core densities were averaged within patients and then patients received equal weight. A tumor:stroma density ratio below one means fewer cells per unit area inside the tumor.
We also counted CD4 T cells, which help coordinate immune responses; B cells, which can make antibodies; myeloid immune cells; and neutrophils, another immune-cell category. Structural categories included fibroblasts, cells of lymphatic vessels that drain tissue fluid, and blood-vessel cells.
Table 1. Patient-mean matched densities in cells/mm². Ratios divide mean tumor by mean stromal density; intervals are 95% confidence intervals (CI) from resampling patients while keeping each patient’s tumor and stromal measurements paired (a paired patient bootstrap). “Other” is the source's residual cell category. Non-tumor totals include vascular cells. Vascular cells define the matching distance. Their density is confined to the nearest distance band, so their matched ratio is mechanical rather than independent evidence of balance.
| Cell group | Tumor | Stroma | Ratio (95% CI) |
|---|---|---|---|
| CD8 T cells | 187.9 | 550.8 | 0.341 (0.304–0.383) |
| CD4 T cells | 25.5 | 305.5 | 0.084 (0.065–0.103) |
| B cells | 58.2 | 324.2 | 0.180 (0.142–0.222) |
| Myeloid | 149.5 | 995.3 | 0.150 (0.133–0.169) |
| Neutrophil | 79.6 | 300.7 | 0.265 (0.215–0.320) |
| Fibroblast | 355.6 | 2991.1 | 0.119 (0.097–0.143) |
| Other | 370.2 | 1180.7 | 0.314 (0.274–0.357) |
| Lymphatic | 7.8 | 115.9 | 0.068 (0.048–0.091) |
| Vascular | 32.8 | 34.0 | 0.967 (0.684–1.318) |
| All non-tumor cells | 1267.3 | 6798.2 | 0.186 (0.170–0.204) |
| All cells | 8666.8 | 6981.3 | 1.241 (1.209–1.276) |
Tumor-labelled cells accounted for 85.4% of matched cells inside tumor regions; non-tumor cells accounted for 97.4% in stroma. Total cell density was 24% higher in tumor regions. The annotation-based CD8 share among non-tumor cells was 14.8% versus 8.1%, but this comparison is sensitive to how cell types were labelled.
Vascular matching changes the CD8 contrast modestly
On the same 1,641 cores, the unmatched CD8 ratio was 0.298 (0.271–0.326), with densities of 163.4 versus 548.2 cells/mm². Vascular-only matching with the same minimum stratum area gave 0.329 (0.300–0.360); adding local tile and boundary-depth matching gave 0.341 (0.304–0.383).
Before matching, patient-mean vascular distance was 66.3 µm in tumor regions versus 47.1 µm in stroma; tumor locations were farther in 90.0% of patients. After matching, mean absolute differences between compartments within strata were 1.28 µm for vascular distance and 1.45 µm for boundary depth.
Patient-weighted CD8 density decreased with vascular distance in both compartments (Figure 1). At 10–20 µm it was 225.8 versus 759.1 cells/mm²; at 140–150 µm it was 74.1 versus 232.6. Stromal point estimates exceeded tumor estimates in every band. This association shows that the measured distance carries spatial information.

Figure 1. CD8 density in eligible tumor and stromal rings by distance to the nearest annotated vascular-cell center. Each band uses cores with at least 100 µm² in both compartments, averages their densities within patients, then averages patients equally. The contributing patient subset changes across bands. These profiles do not additionally match local tile or boundary depth.
The matched estimate mainly describes tissue close to the tumor boundary and at intermediate distances from vascular cells. With patients weighted equally, 89.6% of the matched weight lay at boundary depths of 10–20 µm and 9.4% at 20–30 µm; 55.9% lay 20–60 µm from a vascular center. Only 8.1% lay within 20 µm and 0.8% within 10 µm. Before matching, 4.2% of eligible tumor-ring area and 23.7% of stromal-ring area lay within 20 µm of a vascular center. Matched areas covered 14.0% of eligible tumor-ring area and 16.0% of stromal-ring area.
Full matching restricted to vascular distances of 10–30, 30–60 and 60–150 µm gave CD8 ratios of 0.295, 0.355 and 0.362. Within 10 µm, the ratio was 0.828 (0.395–1.634; 239 cores from 209 patients). For this band immediately around vascular cells, the uncertainty range allows both lower and higher tumor-side density, leaving the local contrast unresolved. Restricting boundary depth to 10–20, 20–30 or 30–50 µm gave ratios of 0.345, 0.313 and 0.345, respectively.
Boundary construction changes the magnitude
Using the outlined vascular-cell area to measure distance (object distance), instead of the cell center, gave a CD8 density ratio of 0.332 (0.297–0.370; 1,538 cores from 910 patients). The object-distance analysis excluded 104 spatially eligible cores whose cell identifiers in the masks did not pass a check against their recorded coordinates. On 1,519 cores shared by both vascular definitions and five versions of the protein-marker-based compartment maps, CD8 ratios ranged from 0.333 to 0.403. These variants fill enclosed holes, close narrow gaps, or both; they change a median 0.2–2.9% of pixels per core for the altered maps.
Changing the way the tumor boundary was drawn had a larger effect. On 1,580 shared cores, the ratio using the released protein-marker map was 0.333 (0.296–0.372), compared with 0.685 (0.642–0.730) for a boundary drawn by spatially averaging annotated tumor-cell and fibroblast counts at a 20 µm scale. Across available cores, annotation-boundary CD8 ratios ranged from 0.532 at 10 µm smoothing to 0.773 at 30 µm. The released marker maps were the primary boundary definition because spatially averaging cell annotations merges nests and blurs interfaces, as seen in the image checks. The direction persists across these constructions; the magnitude is substantially boundary-dependent.
Immune-cell rankings depend on how cells with epithelial signals are counted
Cytokeratin is an epithelial protein used to identify cancer-cell regions. Immune-labelled cells can also carry its signal in densely packed tissue. To examine how cell types were assigned, we compared labels with measured protein signals. CD3 marks T cells, CD8 and CD4 distinguish the T-cell groups, and CD68 is a marker used here for myeloid cells. A cell was marker-positive if its signal exceeded a threshold based on the slide’s median intensity among cells labelled with the relevant type. Within the 10–50 µm tumor ring, we examined cells positive for both CD3 and CD8 at the median threshold and with cytokeratin above 30 intensity units. Of these cells, 5.4% were labelled Tumor. Corresponding frequencies were 81.0% for cells positive for both CD3 and CD4 but negative for CD8 and 93.4% for CD68-positive cells. These pooled cell counts show that cells with both immune and epithelial signals were assigned to the tumor category at very different rates across immune groups.
We therefore counted each cell lineage, or type, directly from markers under a common rule, irrespective of its annotation. For B cells, we used the protein marker CD20. At the slide-median threshold, the CD8 tumor:stroma ratio was 0.398 and the CD4 ratio 0.230 (Table 2). Dividing the CD8 density ratio by the CD4 density ratio gave 1.73, compared with 4.08 from labels. This “ratio of ratios” measures how strongly the tumor–stroma contrast differs between the cell types. CD68-positive cells had a higher tumor:stroma ratio than CD8-positive cells, reversing the annotation-based ranking.
We also retained only cells with low cytokeratin signals, defined as below the slide’s tumor-labelled-cell 25th percentile. Excluding cells at or above this cutoff reduced labelled CD8 density in tumor regions from 187.9 to 90.9 cells/mm²; stromal density changed from 550.8 to 549.4. The CD8 density ratio fell from 0.341 to 0.165. Dividing the CD8 share of equally filtered non-tumor cells in tumor regions by that in stroma then gave 1.16 (0.98–1.37). Thus the apparent CD8 enrichment among non-tumor cells is uncertain under this filter.
Table 2. Matched tumor:stroma density ratios under four counting rules, with 95% patient-bootstrap intervals. The final two rows divide the CD8 density ratio by the comparator's ratio. Marker thresholds are slide medians among the corresponding labelled cells; T-cell identification rules also require CD3. Cytokeratin-low uses the slide's tumor-label 25th percentile. Tissue areas and strata are identical in all columns.
| Group or comparison | Labels | Labels, cytokeratin-low | Markers | Markers, cytokeratin-low |
|---|---|---|---|---|
| CD8 | 0.341 (0.304–0.383) | 0.165 (0.137–0.198) | 0.398 (0.334–0.476) | 0.175 (0.136–0.224) |
| CD4 | 0.084 (0.065–0.103) | 0.079 (0.061–0.098) | 0.230 (0.195–0.270) | 0.133 (0.108–0.160) |
| B cell / CD20 | 0.180 (0.142–0.222) | 0.139 (0.106–0.178) | 0.228 (0.173–0.296) | 0.169 (0.118–0.235) |
| Myeloid / CD68 | 0.150 (0.133–0.169) | 0.141 (0.124–0.159) | 0.487 (0.436–0.542) | 0.301 (0.265–0.341) |
| CD8 relative to CD4 | 4.080 (3.305–5.196) | 2.093 (1.656–2.710) | 1.733 (1.398–2.157) | 1.323 (1.005–1.757) |
| CD8 relative to myeloid / CD68 | 2.271 (1.973–2.618) | 1.173 (0.969–1.413) | 0.818 (0.676–0.992) | 0.582 (0.448–0.748) |
Changing marker thresholds to the 25th and 75th percentiles preserved lower tumor-side density for all four marker-defined groups. Under the released boundary, CD8 ratios ranged from 0.398 to 0.449 without the cytokeratin filter and from 0.175 to 0.195 with it. CD8/CD4 ratios of ratios ranged from 1.72 to 2.09 without filtering and from 1.32 to 1.55 after filtering. These are sensitivity ranges, not confidence intervals.
Across all eight boundary definitions (the five marker-map versions and three annotation-based smoothing scales), three thresholds and both cytokeratin rules, every marker-defined group's tumor:stroma point estimate remained below one. Some CD20 intervals included one at the broader annotation boundaries. Relative CD8/CD4 estimates approached one with broader smoothing: at 30 µm, filtered estimates ranged from 1.04 to 1.14, with some intervals including one. On the same 1,470 cores from 935 patients shared by all eight boundaries, this range was 1.03–1.14. The lineage ranking therefore provides weaker evidence than the common direction of the density contrasts.
CD8 shares depend on which cells enter the denominator
Fibroblasts help define annotation-derived boundaries and comprise much of the cell count used to calculate the CD8 share of non-tumor cells. Excluding them reduced the annotation-boundary CD8 share ratios to 1.04–1.08. Restricting the denominator to five immune groups gave 1.04–1.15 (Table 3). The broadest smoothing was compatible with no share difference under either denominator. These label-based shares also remain subject to the assignment asymmetry above.
Table 3. Relative CD8 share after removing fibroblasts from the denominator. Values divide tumor-side share by stromal share and use all eligible cores for each boundary. Intervals are paired patient-bootstrap 95% intervals. The immune denominator comprises CD8, CD4, B cells, myeloid cells and neutrophils.
| Boundary | CD8 / non-tumor excluding fibroblasts | CD8 / five immune groups |
|---|---|---|
| Released mask | 1.424 (1.278–1.579) | 1.687 (1.546–1.834) |
| Annotation, 10 µm | 1.081 (1.012–1.149) | 1.154 (1.090–1.219) |
| Annotation, 20 µm | 1.062 (1.004–1.122) | 1.097 (1.039–1.158) |
| Annotation, 30 µm | 1.037 (0.982–1.093) | 1.037 (0.985–1.090) |
Interpretation
In this lung cohort, lower CD8 area density inside tumor regions accompanies lower densities of other immune groups. Matching measured vascular distance changes the CD8 contrast modestly. The magnitude depends more strongly on boundary construction and on retaining cells with both CD8 and epithelial signal. Relative lineage rankings are less stable than the shared reduction in area density.
The evidence comes from boundary neighborhoods with enough tissue for matching in one cohort of two-dimensional tissue-microarray images. Annotated vascular cells incompletely represent vessels, branches outside the section and blood flow; the distance profiles cannot bound the effect of missing or misclassified vessels. Checks of vascular markers covered only three lung cores. In one, whole-cell von Willebrand factor, a protein used to identify vascular cells, separated vascular annotations poorly (area under the discrimination curve 0.40, a measure of how well the signal distinguishes cell categories). Marker-based counts and epithelial-signal filters test sensitivity to counting rules. They cannot resolve whether mixed signals reflect neighboring-cell spillover, errors in outlining individual cells, cancer cells expressing immune-associated markers, or true immune cells acquiring epithelial signal. Compartment maps share this marker-dependent uncertainty. These measurements describe where cells accumulate, not their movement or treatment response.
Methods
Public data and eligibility
We used the Spora collection, which harmonizes public spatial-imaging datasets. We combined it with original coordinate tables produced by CellProfiler, software for measuring cells in images, and with tumor–stroma maps and cell-instance masks from Zenodo record 7961844. Cell-instance masks identify the pixels belonging to each individual cell. Cells were linked by original slide, acquisition and object identifiers; tissue identifiers linked them to patients. Reference controls were removed using original patient identity rather than cell labels. Tumor and fibroblast categories supplied structural tissue support, the CD8 category supplied outcome counts, and the Blood and high endothelial venule (HEV) categories supplied vascular targets. We imposed no minimum CD8 count.
The original compartment maps used pan-cytokeratin, a combined epithelial-protein signal, and smooth-muscle actin, a protein used as a stromal marker. We retained their tumor assignment and treated the complement as stroma only where our structural-support rules were satisfied. Masks were linked by slide and acquisition identifier and checked against image dimensions and label values. Five all-zero masks were invalid; all five also failed the requirement of at least 50 tumor cells, 20 fibroblasts and five vascular cells per core. Cords et al., 2024.
For object-distance analyses, every annotated cell identifier had to exist in the instance mask and its mask-derived centroid (cell center) had to agree with the original coordinate within 0.00001 µm. All passing cores had zero reported discrepancy. A duplicated slide dataset in the original archive affected eligible cores from the slide identified as 178_B. Harmonized masks also failed the identity test for these 104 cores, which were retained for centroid analyses but excluded from object analyses.
Spatial measurement and matching
Images had 1 µm pixels. We overlaid a 5 × 5 µm lattice and counted cell centroids separately for each lineage in each square without smoothing. Density denominators were square areas, not total cell counts. A square center was eligible if it lay 10–50 µm from the compartment boundary, within 40 µm of an annotated tumor cell or fibroblast, more than 50 µm from the acquisition edge, and less than 150 µm from the nearest vascular target. Vascular distance also had to be shorter than distance to the acquisition edge, reducing censoring by unseen vascular targets outside the image.
Centroid distances were straight-line (Euclidean) distances to the nearest vascular-cell center. Object distances were Euclidean distances to the nearest pixel belonging to any annotated vascular instance. Boundary depth was distance to the opposite compartment in the full-resolution mask. Pixel-based distances and compartment labels were sampled by rounding each lattice-center coordinate down to the nearest integer pixel coordinate.
Within a core, matching strata crossed 100 µm square tiles anchored at the image origin, 10 µm vascular-distance bins and 10 µm absolute boundary-depth bins. Each stratum required at least four lattice squares, or 100 µm², in each compartment. Its weight was the smaller compartment area, normalized across retained strata. We calculated each compartment's density within each stratum and averaged using these same weights. Nearby matched locations need not share a vessel or a single boundary segment.
We averaged core densities within patients, then averaged patients equally. The final statistic was mean tumor density divided by mean stromal density. We obtained percentile 95% intervals from 10,000 patient bootstrap samples with random seed 20261102, retaining each patient's paired densities. Distance imbalance was the weighted absolute difference in stratum-mean distances, averaged across cores within patients and then across patients. Area retention was pooled retained area divided by pooled eligible ring area in contributing cores.
Compartment sensitivity analyses
We crossed the two vascular-distance definitions with five compartment maps: unchanged regions; filling enclosed holes up to 400 µm²; Euclidean closing, an image operation that bridges narrow gaps, at radius 5 µm followed by filling holes up to 400 µm²; closing at radius 10 µm followed by filling holes up to 1,600 µm²; and filling all enclosed holes without closing. Holes were connected components of the non-tumor region using four-neighbor connectivity (pixels sharing an edge) that did not touch the image border. Closing used padding to avoid erosion at acquisition edges. We recalculated boundary depths, eligible areas and matching for every version. We reported both available-core estimates and estimates restricted to the intersection of cores contributing to all ten versions. Computation used the Python programming language and its NumPy, pandas and SciPy libraries for numerical calculations, data handling and scientific computing.
Lineage comparisons and distance profiles
All cell groups used identical areas and weights within each compartment-map analysis. Non-tumor cells included every cell outside the Tumor annotation category, including vascular cells; “Other” retained the source's residual category. Ratios of ratios compared the CD8 tumor:stroma density ratio with the corresponding lineage ratio. CD8 shares divided the patient-mean CD8 density by the patient-mean comparator density. Bootstrap samples kept all outcomes paired within patients. Intervals are descriptive and are not adjusted for multiple lineage comparisons. These aggregate shares differ from averaging individual patient shares.
Before-matching estimates used all eligible ring locations in the 1,641 primary cores. Vascular-only matching used 10 µm vascular bins with the same 100 µm² minimum area per side, without local tiles or boundary-depth bins. Distance profiles used each 10 µm vascular band separately, requiring 100 µm² per compartment in a core, then averaged cores within patients and patients equally. Profiles therefore use a different supported patient subset in each band. Restricted-band matched contrasts retained the full local matching strata and renormalized their weights within the band.
Common marker rules and denominator sensitivity
We joined original per-cell marker intensities by validated cell identifiers and restored acquisition intensity scaling. Within each slide, we defined positivity at the 25th, 50th or 75th percentile of the relevant marker among cells labelled with that lineage. CD8 required positivity for both CD8a, the measured CD8 protein subunit, and CD3; CD4 required CD4 and CD3 positivity and CD8a negativity. The CD3 threshold came from labelled CD8 and CD4 cells together. B-cell and myeloid sensitivities used CD20 and CD68 respectively. These marker-defined groups can overlap and are not exact replacements for the annotation categories. Each threshold was applied to all cells regardless of their original label. A separate filter retained cells below the slide's 25th percentile of pan-cytokeratin intensity among tumor-labelled cells. We applied that filter to both label-defined and marker-defined counts, leaving the tissue areas and matching unchanged.
We crossed all three marker thresholds and both epithelial-signal rules with all eight centroid-based boundary definitions. Available-core and shared-core analyses used the same patient weighting and paired bootstrap as the primary analysis. For a descriptive label audit, we counted marker-positive cells in the source-mask tumor ring of the 1,651 cores contributing to any boundary analysis, at their actual centroid positions and tabulated their tumor-label frequency by cytokeratin level; these pooled cell percentages do not use matched-area weights. Share sensitivities used either non-tumor cells excluding fibroblasts or the five annotated immune groups (CD8, CD4, B cells, myeloid cells and neutrophils), avoiding fibroblasts in the denominator.
For an independent boundary construction, we smoothed tumor and fibroblast cell counts on the 5 µm lattice with a Gaussian kernel. This averages nearby counts with weights that decrease with distance. We assigned tumor where tumor density exceeded fibroblast density. We tested smoothing scales of 10, 20 and 30 µm and rebuilt boundary depths and matching. This construction uses different inputs from the released compartment classifier, but shares its underlying tissue images and cell annotations. Because fibroblast labels help define this boundary, its fibroblast contrast partly follows from construction.
References
Cords L, et al. Cancer-associated fibroblast phenotypes are associated with patient outcome in non-small cell lung cancer. Cancer Cell. 2024;42:396–412.e5. Article. Associated public imaging, annotation and segmentation data, version 1.0. Zenodo.
Yang G, et al. Functional status and spatial architecture of tumor-infiltrating CD8+ T cells are associated with lymph node metastases in non-small cell lung cancer. Journal of Translational Medicine. 2023;21:320. Article.
Leo P, et al. Automated measurement of CD8+ T-cell distribution at the tumor epithelial-stromal interface is associated with NSCLC immunotherapy benefit and transcriptomic pathways. Journal of Pathology Informatics. 2026;22:100688. Article.