Introduction

3-dimensional spheroid models of cancer have been widely used to investigate mechanisms of invasion and metastasis1,2,3,4 and the impact of drugs on metastatic potential5,6,7. Spheroid cultures help to bridge the gap between simplistic 2-dimensional in vitro cultures and complex in vivo mouse models, and have been used to study complex biological processes that are strongly coupled to tissue microenvironments. Cell-cell and cell-matrix interactions in spheroid cultures are more similar to animal models and human disease than 2-dimensional in vitro models, yet spheroids can be grown rapidly, are relatively inexpensive and are easier to image than in vivo models. The relative ease in imaging spheroid models makes them especially amenable to investigating temporal processes where dynamic behaviors and interactions can be captured. Metastatic and invasive processes are fundamentally dynamic, and temporal imaging of spheroids can provide important insights into how cancer cells divide8, invade, and metastasize1,5,9,10. For example, measuring growth kinetics of tumor spheroids has been used for anti-cancer drug screening5,7. Co-culturing of multiple cell types in 3-dimensional spheroids has also been used to investigate cell-cell interactions in microenvironments11,12.

Software for spheroid image analysis has largely focused on static images generated by high throughput screening4,5,6,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27. Existing software programs for analyzing spheroid imaging are described in Table 1. Software for measuring spheroid dynamics has received relatively less attention4,16,23,24,25,26,27,28,29. An interactive system for segmenting and measuring spheroid volume and dimensions was developed in26. Software for analyzing of collective cell migration has been developed in smaller models for developmental biology, using cell tracking to extract quantitative features describing migration patterns30. The primary challenges in measuring spheroid dynamics are in accurate delineation of the spheroid boundaries, and the extraction of spatiotemporal features that describe spheroid growth, shape, and motion. Cultures derived from neoplastic cells often exhibit irregular shapes, chaining and branching behaviors, and can be highly dynamic, making automatic delineation difficult5,22,25, and leading investigators to perform manual segmentations that are not objective or repeatable31,32. Similarly, variations in dynamic behavior complicate the extraction of descriptive features. Most spheroid analysis software only measures basic size and shape features, which is insufficient to discriminate different patterns of invasion33. Finally, there is a gap between mathematical modeling of behavior following feature extraction, with both capabilities often not available in the same tool34,35.

Table 1 Summary of software available for spheroid image analysis.

Leader and follower cells were defined in the collective migration process, in which leader cells were migrating at the leading edge of the collective sheet or spheroid, whereas follower cells followed or attached to the leader cells. Leader and follower cells showed distinctive morphology and migration behaviors. For example, leader cells had larger size29 and were more mesenchymal-like36. They formed large lamellipodium and migrated with persistent protrusion37. Follower cells were smaller29 and more epithelial-like36. Although leader and follower cell migration behavior were widely studied, most were conducted in 2-dimensional models and there were no standard features selected to quantify the morphology differences between them. Furthermore, many researchers still used manual selection to quantify the morphology features of these cells, which limited the number of cells studied and was time-consuming and subjective.

In this paper, we describe TASI, an open-sourced software framework for end-to-end Temporal Analysis of Spheroid Imaging (http://github.com/cooperlab/TASI). This framework allows investigators to automatically segment spheroid images, extract features describing their shape, growth, and invasiveness, and to perform mathematical modeling and statistical analyses of these features to compare treatment and control populations of spheroids. This approach improves the efficiency and objectivity of investigations utilizing spheroid models, and is open-source and extensible by the research community. We demonstrate the utility of this framework with an analysis of lung cancer spheroids and show TASI can discriminate different invasive phenotypes.

Materials and Methods

An overview of the TASI framework is presented in Fig. 1 (see Supplement Fig. S1 for details). Spheroids are first imaged under variable experimental conditions to produce 4D volumes (x, y, z, time). Images are then processed using a segmentation algorithm to delineate spheroid boundaries and features are extracted to describe their spatiotemporal characteristics. The temporal evolution of features is described using mathematical models, and statistical tests are performed to compare parameters across conditions, and visualizations are generated. These steps are described in greater detail below.

Figure 1
figure 1

Overview of TASI framework. Step1 shows 4-dimensional (x, y, z, t) spheroid dynamic experiment and imaging. Step 2 shows the segmentation and morphology features extracted from the individual spheroid. Solid yellow line is the spheroid boundary. Dashed yellow lines are single cell boundaries. Red circle and red arrow represent the invasive radius. Green circle and green arrow represent the core radius. White dots are branch points and cyan square is centroid of the spheroid. Step 3 show the visualization, modeling and statistical analysis for grouped spheroid dynamics under different treatments.

Spheroid culture and imaging

Data for validating the TASI framework was generated using the SpAtiotemporal Genomic and cellular Analysis (SaGA) technique to create spheroid cultures that represent the different invasive and metastatic phenotypes observed in lung cancer38. First, parental H1299 non-small cell lung cancer spheroids were embedded in a 3-dimensional matrix and visualized using a Leica SP8 confocal microscope. These spheroids contain cells that exhibit a variety of invasive tendencies, forming chain-like growths containing multiple cells that project from the main spheroid body (see example Fig. 2a). The cells at the tips of these chains were isolated using SaGA and cultured to form “leader” cell spheroids (see example Fig. 2a). The cells following the leaders within the chain-like projections were similarly isolated to produce “follower” spheroids (see example Fig. 2a). Each spheroid was imaged at x, y, z planes every 10 minutes for a minimum 14 hours. The 10-minute interval was selected to minimize differences between image frames, making image segmentation smooth across time, while not inducing photo bleaching or toxicity in the 14-hour duration. A total of 6 parental spheroids, 3 leader spheroids and 3 follower spheroids were imaged for the purposes of generating data to validate the ability of our software to quantify cancer invasion and metastasis. The leader/follower/parental spheroids were chosen for study to ensure that TASI can analyze the full spectrum of morphologies and dynamics presented by cancer spheroid models. Where leader spheroids are highly dynamic and morphologically complex, follower spheroids are indolent and nearly spherical. Most cancer spheroids, like our parental spheroids, have intermediate dynamics and morphologic qualities. Detailed experimental methods for cell culture and imaging are provided in supplementary methods.

Figure 2
figure 2

Distinct patterns of dynamic features. (a) 3-dimensional graphcuts segmentation results. The white outlines are segmented boundaries for leader, follower and parental spheroids at different time points (Hour: Minute). Scale bars are 100 μm. (b) Feature extraction results. The red circles are invasive radius; green circles are core radius; blue squares are centroids and cyan dots are branch points for leader, follower and parental spheroids at each time points (Hour: Minute). Scale bars are 100 μm.

Preprocessing and image segmentation

Preprocessing methods are employed to enhance the contrast and salience of structures to improve image segmentation quality (see Fig. 3). Four-dimensional volumes are first projected to 3-dimensional (x, y, t) using the standard deviation filter developed in39. At a given time t0, the volumetric image I(x, y, z i , t0) contains multiple focal planes z i (see Fig. 3a). Uneven illumination of the focal plane in semi-solid gels can weaken the appearance of structures (see Fig. 3a, Z = 5, t0) making segmentation difficult. To correct this a standard deviation filter is applied at each time point to integrate focal planes and to define the 2-dimensional image sequence I p (x, y, t) = σ z [I(x, y, z, t)]. These time-domain volumes are then Gaussian smoothed in both space (x, y) and time (t) to further mitigate noise. To delineate the spheroid boundaries, we leverage both spatial and temporal structure simultaneously by using an energy-minimizing graph cut segmentation40,41,42. The max-flow graph cut provides a smooth segmentation in both space and time using the similarities of spatial-temporal pixel neighbors. Treating these pixels as a spatial-temporal graph, where edge weight corresponds to inverse similarity, the algorithm finds an energy-minimizing cutting path through the volume to partition foreground and background regions. Example segmentations are provided in Fig. 2. The time interval used for imaging has important implications for image segmentation. A long time interval could result in significant differences between frames, leading to discontinuities in the image segmentation across time. While short time intervals are desirable for segmentation, photo bleaching and toxicity issues can arise. If necessary, users can select 2-dimensional graph cut segmentation in the software settings to perform segmentation independently for each frame for longer imaging intervals.

Figure 3
figure 3

Contrast enhancement and smoothing. (a) 3-dimensional projection algorithm converting z stacks at each time point to projection image, and then using projection images at each time point for preprocess. (b) Segmentation effects comparison between without and with 3-dimensional Gaussian filter. 3-dimensional Gaussian filter smooth the segmentation in both spatial and temporal.

Feature extraction

Given spheroid segmentation masks, TASI extracts a number of features to characterize static spheroid morphology at each time-point in the volume (see complete list, Table 2). Basic morphology features including area, perimeter, eccentricity, and intensity statistics are calculated. Complexity of the spheroid boundary is also measured as

$$complexity=\frac{Perimete{r}^{2}}{4\pi \ast Area}$$
(1)
Table 2 Statistical analysis of modeling parameters for spheroid types.

More irregular shapes will have larger perimeters for a corresponding area, translating to higher complexity measures (a circle has complexity 1).

Spheroids often exhibit interesting branching behavior, forming thin branches of invasive cells that protrude from the main spheroid mass. To quantify this phenomenon, we defined a “core radius” that captures the size of the main spheroid mass and an “invasive radius” that captures the extent of the projections (see Fig. 1). The core radius was defined as the radius of the largest circle that can be inscribed within the spheroid mask, centered at the mask centroid. The invasive radius was defined from the minimum circle that can encompass the entire spheroid, including any invasive branches. These radii roughly capture growth due to proliferation and growth due to invasion. The number of the branches was further quantified using a skeletonization procedure. Morphological operations were applied to thin the mask to a skeletal structure, and the terminal endpoints were counted. This process robustly captures the tips of branching structures, even with complex shapes (see Figs 1 and 2b).

The presence of any isolated “cells” not connected from the main spheroid mass was also measured. These leaders are biologically extremely significant and may be represent a distinct cell phenotype with strong metastatic potential (see example Fig. 1). These objects were detected by labeling the segmentation mask and looking for disconnected islands of foreground with a small area.

Modeling and statistical analysis

The temporal evolution of measured features contains important information about spheroid dynamics and invasion. To measure dynamics, we provide mathematical modeling capabilities to fit models to temporal feature sequences. Three models are available for fitting: linear, quadratic, and exponential.

$$\begin{array}{c}y=a\ast t+b\\ y=a\ast {t}^{2}+b\ast t+c\\ y=a\ast {e}^{(b\ast t)}.\end{array}$$
(2)

Modeling can be applied to individual spheroids, or to the average feature values of replicates for a single experimental condition. An adjusted R2 value is reported for each model as a measure of model fitness.

Statistical testing can be performed to on the model parameters to determine if there are measurable differences in spheroid dynamics across experimental conditions. Comparisons between pairs of treatments are made using the student’s t-test. Comparisons across two or more experimental conditions use the ANOVA test.

Visualization and reporting

TASI automatically generates visualizations and reports for image analysis, model fitting, and statistical analysis results. For each experimental condition, time plots of the features are generated along with confidence intervals to illustrate variance within the condition replicates (see Fig. 4). Feature plots and modeling can also be generated individually for each replicate in all experimental conditions (see Fig. S2).

Figure 4
figure 4

Visualization of average dynamic features under different treatments. Average values for (a) branch number, (b) invasive radius, (c) core radius, (d) area, (e) perimeter and (f) complexity as a function of time for different cell lines. Red solid lines with x symbols represent mean values for leader spheroids. Shaded areas represent 95% confidence intervals for feature values over the replicates.

Results

TASI software

TASI is published as open-source software under an Apache 2.0 license (https://github.com/cooperlab/TASI). Full documentation on using TASI and the formatting of inputs and outputs is described in the Github repository. As an open-source framework, TASI can be readily and easily modified and extended to meet the needs of individual researchers.

As shown in Fig. S1, TASI enables users to analyze individual spheroids, or spheroids grouped by experimental conditions. TASI uses a simple folder structure to organize and group experimental conditions, and performs end-to-end analysis once the input and output folders have been identified. Currently TASI supports most common image formats (jpg, png, tiff and others). The outputs generated for each spheroid include segmentation masks, feature extraction images, and spreadsheet CSV files containing feature extraction data and image analysis parameters for reproducibility. Additional CSV files describing modeling parameters and optionally statistical tests are also generated in the base output folder.

The spatio-temporal segmentation approach produces smooth segmentations of various spheroid morphologies (see Fig. 2a). By performing graph cuts simultaneously across both space (x, y) and time (t), the segmentation algorithm suppresses noise and produces segmentations that are smooth in both space and time. Dim branches and edges that are characteristic of invasive spheroid phenotypes can be segmented accurately using this approach by integrating information across time. The graph-cutting approach can also compensate for gradual decreases in spheroid intensity over time due to imaging, as compared to segmentation methods that establish a uniform threshold for all time.

Segmentation masks are automatically saved in the output folders for quality control, where segmentation boundaries are superimposed over the spheroid intensity images in videos. By examining the video, the users can quickly review the segmentation quality, and refine if necessary.

TASI analysis captures differences in spheroid phenotypes

Coordination between leader and follower cells in collective migration has been investigated, and key differences between leader and follower cells include cytoskeleton structure43 and signaling pathway activations29,44,45. It is not clear, however, whether these complementary differences have a genetic basis or are induced by microenvironmental conditions. It is unknown, for example, if a follower cell becomes a leader when exposed to the spheroid/environment interface, or to what extent leader and follower phenotypes are transitory states that can be reversed. To answer these questions, we used TASI to analyze spheroids that were derived from purified leader or follower cells using SaGA.

The morphological differences between these spheroids are apparent in Fig. 2. Leader spheroids exhibit extensive chain-like branching, where the follower spheroids are compact and have more regular boundaries and sheet-like growth. The parental spheroids used to derive these populations are shown for comparison, and have intermediate morphologic qualities. Branch detection and core/invasive radius detection results for these spheroids are shown in Fig. 2b. The branch detection and radius finding algorithms work effectively across all spheroid types.

Temporal plots of key features are presented in Fig. 4 for each spheroid type. We noted from the interval in these plots that trends are remarkably stable for each spheroid type, with replicates from a given type exhibiting little variation, suggesting that the segmentation and feature extraction methods are robust. Significant differences exist were observed in how the features evolved over time for each spheroid type. Leader spheroids rapidly develop branches in the first 5 hours of growth and then reach a plateau, although the core radius continues to increase. The branch number for follower spheroids increases very slowly and consistently over 8 hours, and proportional to core radius (and hence spheroid circumference). The complexity of follower spheroids remains close to 1 for all time points, suggesting a spherical morphology. Trends for parental spheroids were similar to follower spheroids, with a slight shift towards a more invasive phenotype.

Model fitting and statistical testing of spheroid types

To further quantify differences in migration and growth between spheroid types, we fit models to the temporal sequences of each feature using least squares. Linear and exponential models are the most commonly used models for tumor growth, so we utilized these two models as well as a quadratic model to the sequences in Fig. 5. Fitted models are shown in Fig. 5. We noted that the R2 values are generally high, ranging from 0.71 to 0.99. Linear models accurately describing the temporal evolution of follower and parental spheroids. The temporal evolution of the leader spheroids is much more complex, and was better fit by the quadratic models in most cases (adjusted R2 ranges 0.71–0.99). The branch number and complexity dynamics of the leader spheroids are an exception, and are not described well by any model (adjusted R2 ranges 0.58~0.90).

Figure 5
figure 5

Model temporal feature evolution. Model fitting curves for mean (a) branch number, (b) invasive radius, (c) core radius, (d) area, (e) perimeter and (f) complexity as a function of time for each cell line. The dash-dot line represents the 1st order polynomial (or linear) model fitting. The dotted line represents the 2nd order polynomial model fitting. The dashed line represents the exponential model fitting. Shaded areas represent 95% confidence intervals for feature values over the replicates.

We performed statistical tests on these models to further quantify differences between the three spheroid types (see Table 2). The summary of the statistical test results among three cell lines is listed in Table 2. The features with the most significant differences in model parameters included area (linear model, ANOVA p = 3.40e-7), complexity (quadratic model, pa = 9.88e-8, pb = 7,16e-10), and perimeter (quadratic model, pa = 7.96e-6, pb = 3.93e-9). Eccentricity and single cell number had the weakest differences across spheroid types. The statistical tests confirmed our aim of defining unique features to classify different collective migration patterns.

Discussion

The application of TASI image analysis to spheroid data obtained by SaGA illustrates how spheroid cultures and image analysis can be used to investigate tissue microenvironments and their role in cancer invasion and metastasis. TASI contributes an end-to-end software approach for characterizing spheroid growth and invasion dynamics, providing image segmentation, feature extraction, modeling, and statistical analysis capabilities within the same tool. As an open source framework, it can readily be extended and tailored to the specific needs of investigators.

Our analysis of spheroids derived from purified leader and follower cells38 used features like branch tip count and core radius to reveal important differences in growth and invasion. Leader and follower cells likely play complementary roles in establishing viable metastases distant from the primary tumor, and understanding this process and the differences in these cell phenotypes can lead to better targeting of these important mechanisms in the future. Growth and invasion are by definition dynamic processes, and by providing a framework to measure dynamic behaviors of spheroids, TASI enables precise and quantitative characterization of spheroid behavior. The ability to model these behaviors and to perform statistical tests between experimental conditions could aid in screening drugs or functional genetics studies by detecting subtle differences in dynamic behavior as opposed to static morphology. Objectivity and repeatability in these types of experiments is increasingly critical, and with large amounts of data, traditional manual quantification may not be practical.

Although our software provides new capabilities for spheroid analysis, the proposed approaches and validation have important limitations. TASI currently uses a projection operation to convert 3-dimensional image sequences to 2-dimensional to simplify image analysis. In the future we plan to extend the image analysis algorithms in TASI to perform three-dimensional temporal imaging (x, y, z + time) of spheroid cultures. Adding the z-dimension requires extending the graph-cutting segmentation to 4-dimensional volumes, and implementing features like surface area calculation and 3-dimensional skeletonization and branching analysis. Despite flattening 3-dimensional volumes to two dimensions, TASI is able to measure clear and statistically significant differences in our leader/follower/parental spheroids. Extending TASI to leverage existing cell tracking algorithms is another important direction for future development. Tracking will enable more detailed analysis of the movement patterns of leader cells, and more complex characterizations of the constituents in chain-like projections. Although the leader/follower/parental spheroids used in our study represent a broad spectrum of spheroid dynamics and morphologies, applying TASI to other spheroid models remains an important goal to provide additional validation of our software.