Multiscale 3D spatial analysis of the tumor microenvironment using whole‐tissue digital histopathology
Authors: Daniel Shafiee Kermany, Ju Young Ahn, Matthew Vasquez, Weijie Zhang, Lin Wang, Kai Liu, Zhan Xu, Min Soon Cho, Wendolyn Carlos‐Alcalde, Hani Lee, Raksha Raghunathan, Jianting Sheng, Xiaoxin Hao, Hong Zhao, Vahid Afshar‐Kharghan, Xiang Hong‐Fei Zhang, Stephen Tin Chi Wong
Journal: Cancer Communications (2025)

Spatial statistics are crucial for analyzing clustering patterns in various spaces, such as the distribution of trees in a forest or stars in the sky. Advances in spatial biology, such as single-cell spatial transcriptomics, enable researchers to map gene expression patterns within tissues, offering unprecedented insights into cellular functions and disease pathology. Common methods for deriving spatial relationships include density-based methods (quadrat analysis, kernel density estimators) and distance-based methods (nearest-neighbor distance [NND], Ripley's K function). While density-based methods are effective for visualization, they struggle with quantification due to sensitivity to parameters and complex significance tests. In contrast, distance-based methods offer robust frameworks for hypothesis testing, quantifying spatial clustering or dispersion, and facilitating comparisons with models such as uniform random distributions or Poisson processes [1, 2]. Ripley's K function provides a detailed measure of spatial clustering or dispersion across multiple scales by considering all pairs of points within specified distances. This is in contrast to NND, which may overlook structures that vary across scales. Ripley's K function can detect complex spatial patterns over a range of distances, making it suitable for datasets with non-uniform arrangements that exhibit different behaviors at different scales. However, its broader adoption has been hindered by computational complexity and challenges in interpretation, especially for three-dimensional data, which are common in spatial biomedical research [3-6]. To address these limitations, we introduce MDSpacer (Multi-Dimensional Spatial Pattern Analysis with Comparable and Extendable Ripley's K), a modeling tool that implements Ripley's K function for both 2D and 3D data, facilitating detailed analyses within and between groups (Figure 1A, B, Supplementary Figure S1). MDSpacer uses a novel normalization scheme (described in Supplementary Materials and Methods) that dramatically reduces computational overhead while delivering results in an easily interpretable and comparable format (Figure 1C–F). We validated this tool in two cancer research studies: one on metastatic bone cancer and another on ovarian cancer. In the metastatic bone cancer study, we used the Vessel3D analysis toolkit to extract spatial point information from 3D confocal images of murine femurs with early-stage spontaneous metastasis (Figure 1G–K, Supplementary Figures S2, S3, Supplementary Videos S1, S2). MDSpacer identified both expected clustering at short distances and unexpected dispersion patterns at larger scales between early-stage disseminated tumor cells (DTCs) and neural/glial antigen 2-positive (NG2+) mesenchymal cells in relation to other microenvironmental factors [7-9]. Interestingly, no spatial relationships were observed between DTCs and vessel bifurcations, which have been reported in other studies [8]. In the ovarian cancer study, we applied MDSpacer along with a deep learning model developed to pinpoint platelet locations in whole-slide confocal images and identified stromal cell–derived factor 1 (SDF-1)/C-X-C chemokine receptor 4 (CXCR4)-driven platelet clustering at the primary ovarian tumor site (Supplementary Figure S4). Our findings confirmed expected interactions and revealed new significant relationships with additional microenvironmental factors, deepening our understanding of tumor-microenvironment interactions and demonstrate the effectiveness of the MDSpacer spatial statistics tool. In the metastatic bone cancer study, we developed a murine model of spontaneous metastasis (Supplementary Figure S5A) and verified the presence of DTCs within the bone through fluorescent confocal imaging (Supplementary Figure S5B, C). Figure 1A and Supplementary Figure S6 show how point sets were isolated from the 3D confocal channels. The locations of every DTC seed cell in the femur were manually recorded, totaling 824 cancer cells across all samples. The locations of NG2+ perivascular mesenchymal stem cells (MSCs) were determined through segmentation of the fluorescent marker layer (Supplementary Figure S7). This method converts complex visual structures into simplified point sets, allowing for analysis of inherent spatial relationships using Ripley's K function (Figure 1B, Supplementary Video S3). In univariate analyses, which examine clustering within a single point event type independently of others, tumor cells and NG2+ cells consistently exhibited significant clustering across samples, particularly at specific scales (Supplementary Figure S8A, B). The branch points displayed extremely significant clustering across all scales (Supplementary Figure S8C). However, tortuous vessels did not substantially deviate from a random distribution until distances of about 80 µm (Supplementary Figure S8D). The consistent trajectories of K values across different radii underscore the uniformity of spatial distributions between samples, demonstrating that MDSpacer offers quantitative insights into biologically relevant features while maintaining internal consistency (Supplementary Figure S9). In bivariate analysis, which examine relationships between two distinct point event types, Monte Carlo simulation provides percentile intervals by randomizing point labels and repeating the process 100 times for each image (Supplementary Figure S10). Bivariate K function plots between DTCs and NG2+ cells (Supplementary Figure S11A) show that most samples exhibit significant NG2+ cell clustering near DTCs at distances under 20 µm. However, no clustering is observed at larger distances; instead, significant dispersion between NG2+ cells and DTCs is noted at larger radii. No clustering is observed at any scale between tumor cells and vessel branch points or between tumor cells and the most tortuous vessel segments (Supplementary Figure S11B, C). The K function plots examine relationships between NG2+ cells and vascular features, such as vessel branch points and the most tortuous vessel segments (Supplementary Figure S12). Results show no spatial relationship between NG2+ cells and vessel branch points across all scales. In contrast, NG2+ cells consistently cluster near the most tortuous blood vessel segments at distances shorter than 20 µm across all samples, suggesting potential biological interactions. Additional details regarding data processing and MDSpacer procedures can be found in the Supplementary Materials and Methods. In the ovarian cancer study, we hypothesized that SDF-1 secreted by ovarian cancer cells interacts with CXCR4 receptors on platelets, functioning as a chemotactic factor [10]. We developed a deep learning model for localizing platelets, achieving high accuracy (area under receiver operating characteristic [AUROC]: 0.99) in validation tests (Supplementary Figures S13, S14, Supplementary Table S1). Using Plerixafor, a CXCR4 inhibitor, we observed a significant reduction in tumor weight in Plerixafor-treated mice compared to controls (P = 0.008, Supplementary Figure S15A). Blocking SDF-1 using clustered regularly interspaced short palindromic repeats (CRISPR) targeting the SDF-1 genes led to a significant reduction in tumor weight compared to control (P < 0.001, Supplementary Figure S15B). Blocking CXCR4 reduced the number of platelets extravasated into the tumor parenchyma. Supplementary Figure S15C shows a significant reduction (P = 0.047) in platelet density in Plerixafor-treated tumor tissues compared to controls. We validated the effect using univariate MDSpacer. Platelets exhibited significant clustering within ovarian cancer tissues in both control and Plerixafor-treated mice (Supplementary Figure S16A). However, Plerixafor-treated samples showed significantly reduced platelet clustering compared to control regions across radii from 7 to 249 µm (P < 0.05), with a more pronounced difference observed across radii from 12 to 57 µm (P < 0.01). Supplementary Figure S16B, C depict the K functions for control and Plerixafor-treated mice, respectively. We overlaid vessel segmentation using anti-CD31 for endothelial cells onto platelet segmentation, enabling measurement of each platelet's proximity to its nearest vessel. We observed that within 1 µm of the vessel, the number of platelets was significantly higher in control tumor tissues compared to Plerixafor-treated tissues (Supplementary Figure S17). Additional details regarding the ovarian cancer experiments and data analysis can be found in the Supplementary Materials and Methods. In conclusion, we present a versatile point-pattern analysis platform designed for characterizing point locations and spatial relationships within large tissue samples. By extending Ripley's K function to the biomedical domain and optimizing it for multi-dimensional data, our platform enables researchers to detect spatial relationships across a range of distances. The novel MDSpacer normalization approach significantly reduces computational cost while facilitating meaningful comparisons between samples. By making Ripley's K function both user-friendly and accessible through a comprehensive software toolkit, MDSpacer offers significant potential for application across a wide array of research domains. Conceptualization: Daniel Shafiee Kermany, Ju Young Ahn, Jianting Sheng, and Stephen Tin Chi Wong. Methodology: Daniel Shafiee Kermany, Ju Young Ahn, Stephen Tin Chi Wong, Jianting Shen, Raksha Raghunathan, Matthew Vasquez, Kai Liu, Zhan Xu, Xiaoxin Hao, Min Soon Cho, Wendolyn Carlos-Alcalde, Hani Lee, Vahid Afshar-Kharghan, Hong Zhao, Weijie Zhang, and Xiang Hong-Fei Zhang. Investigation, formal analysis, and validation: Daniel Shafiee Kermany, Ju Young Ahn, Stephen Tin Chi Wong, Raksha Raghunathan, Jianting Sheng, Weijie Zhang, Lin Wang, Matthew Vasquez, Kai Liu, Zhan Xu, Min Soon Cho, Vahid Afshar-Kharghan, Xiaoxin Hao, and Xiang Hong-Fei Zhang. Resources: Hong Zhao, Stephen Tin Chi Wong, Weijie Zhang, Vahid Afshar-Kharghan, and Xiang Hong-Fei Zhang. Software, data curation, and visualization: Daniel Shafiee Kermany, Ju Young Ahn, Lin Wang, Stephen Tin Chi Wong, and Weijie Zhang. Writing - original draft: Daniel Shafiee Kermany and Stephen Tin Chi Wong. Writing - review & editing: Daniel Shafiee Kermany, Ju Young Ahn, Stephen Tin Chi Wong, Jianting Sheng, Weijie Zhang, Lin Wang, and Xiang Hong-Fei Zhang. Supervision: Stephen Tin Chi Wong, Xiang Hong-Fei Zhang, and Vahid Afshar-Kharghan. Project administration: Daniel Shafiee Kermany, Raksha Raghunathan, and Stephen Tin Chi Wong. Funding acquisition: Stephen Tin Chi Wong, Xiang Hong-Fei Zhang, and Vahid Afshar-Kharghan. We extend our gratitude to Jiasong Li from the Translational Biophotonics Laboratory at the Houston Methodist for his invaluable guidance on image acquisition, to Andrea Olvera from Kervera, LLC for her assistance with editing of the manuscript text, and to Gefei Song for her assistance with image collection and processing. Our thanks also go to the Advanced Cellular and Tissue Microscopy Core of the Houston Methodist Neal Cancer Center and Houston Methodist Research Institute for their innovative approaches in acquiring comprehensive thigh bone confocal imaging. We appreciate the support of the GPU supercomputer facility at the Laboratory for Artificial Intelligence in Medicine and Innovation, located at the Systems Medicine and Bioengineering Department, Houston Methodist. Additionally, we acknowledge the contributions of the Pathology Core at the Lester and Sue Smith Breast Center, Baylor College of Medicine, for their support in our research endeavors. The authors declare no competing interests. Daniel Shafiee Kermany, Ju Young Ahn, Matthew Vasquez, Lin Wang, Kai Liu, Raksha Raghunathan, Jianting Sheng, Hong Zhao, and Stephen Tin Chi Wong are supported by NCI U01CA252553, NCI R01CA238727, NCI R01CA177909, NCI R01CA244413, John S. Dunn Research Foundation, and Ting Tsung and Wei Fong Chao Foundation. Xiang Hong-Fei Zhang, Zhan Xu, Xiaoxin Hao, Weijie Zhang are supported by US Department of Defense DAMD W81XWH-16-1-0073 (Era of Hope Scholarship), NCI R01CA183878, NCI R01CA251950, NCI U01CA252553, DAMD W81XWH-20-1-0375, Breast Cancer Research Foundation, and McNair Medical Institute. Vahid Afshar-Kharghan, Min Soon Cho, Wendolyn Carlos-Alcalde, and Hani Lee are supported by NCI R01CA177909, NCI R01CA016672, NCI R01CA275762, and NCI P50CA217685. All animal procedures were conducted in accordance with institutional guidelines and approved by the Institutional Animal Care and Use Committee (IACUC) at Baylor College of Medicine, protocol number [AN-5734]. The datasets generated and/or analyzed during the current study are available from the corresponding author by request. The code used for the analysis is publicly available at https://github.com/Translational-Biophotonics-Laboratory/mdspacer. Please note: The publisher is not responsible for the content or functionality of any supporting information supplied by the authors. Any queries (other than missing content) should be directed to the corresponding author for the article.