The function evaluates the likelihood of any tumor cell in the sample having at least one neighboring immune cell of the specified type within an r μm radius. A. Example multiplex immunofluorescence image for detection of GZMB, NCAM1, KRT, CD3, FCGR3A, PTPRC, and DAPI (nuclear stain). Scale bar: 100 μm. B. Corresponding cell map. C. Corresponding GTumor:Immune cell(r) function curves for each immune cell type. D. Univariable (black) and multivariable (red) Cox proportional hazards regression models of cancer-specific survival according to ordinal categories (C1–C4, from low to high) of GTumor:Immune cell(20 μm) in 907 patients. The forest plots show hazard ratios (HRs) along with their 95% confidence intervals (95%CI) as whiskers. The multivariable Cox regression models initially included sex, age, year of diagnosis, family history of colorectal cancer, tumor location, tumor differentiation, disease stage, microsatellite instability, CpG island methylator phenotype, KRAS, BRAF, and PIK3CA mutations, and long-interspersed nucleotide element-1 methylation level. A backward elimination with a threshold P of 0.05 was used to select variables for the final models.