StrataQuest Home › StrataQuest Glossary › Density of Events
Measurement Engine

Density of Events

Computing local event density across tissue regions

View
Definition
Tumor hotspots are dense, necrotic regions are sparse, and immune infiltrates form density patterns of their own. Density of Events turns a scatter of cell positions into a smooth map of how many cells lie near each point in the tissue. Bright regions are crowded and dark ones are sparse, so a visual impression of "highly cellular" becomes a reproducible measurement.
Supporting
TQ to SQ workflow
Video · Supporting
User Interface - Raw Data
Video · Supporting
Spatial Density Mapping
How crowded each region is
Gaussian Kernel Smoothing
Configurable spatial scale
Hotspot Identification
Find the densest regions automatically
Per-Region Quantification
Density values in ROIs

How It Works

The engine builds a continuous surface out of discrete cell positions in four steps:

  1. Input. A coded imageLoading... supplies the detected events and their positions.
  2. Kernel placement. At each pixel, a Gaussian kernel of the specified radius and standard deviation searches for nearby events. Closer events receive more weight, and events beyond the kernel radius contribute nothing.
  3. Density computation. The weighted contributions of the nearby events add up to the density value at that pixel. Together the values form a smooth, continuous surface.
  4. Border handling. Events from neighboring Fields of ViewLoading... (default: 100 pixels) are included, so the density does not drop artificially at tile boundaries.

The output is a grayscale image in which pixel brightness encodes local cell density.

Simplified

A bell-shaped weight is centered on every point of the tissue. The engine counts the cells under it, with closer cells counting more, and the counts become a smooth heatmap of crowded and sparse regions.

Science Behind It

Kernel density estimation (KDE): Density of Events is a spatial kernel density estimator, a standard statistical method for estimating a probability density function from point samples. Each cell centroid adds a Gaussian "bump" to the surface, and the bumps sum to a smooth estimate of the underlying density. The kernel bandwidth (standard deviation) sets the smoothing. If it is too small, every cell becomes its own isolated peak; if it is too large, local hotspots average away.

1/f noise and spatial correlation: Tissue architecture is correlated at all scales at once (Gardner's analysis of 1/f noise). Cell density is neither random like white noise nor smoothly varying; it is fractal-like, with clusters inside clusters. The kernel's scale sets which level of that hierarchy you see.

Spatial point processes: In spatial statistics, a set of cell positions is one realization of a spatial point process, and a completely random (Poisson) process has the same expected density everywhere. Real tissue departs from that, because cells cluster (immune aggregates, tumor nests) or repel each other (regularly spaced epithelial cells). Density of Events shows where tissue departs from an even spread: bright regions are crowded and dark regions sparse. Its output is a density map, not a significance test against a random pattern.

The tile boundary problem: StrataQuest processes whole-slide images in tiles, and at a tile's edge the cells of the adjacent tile are out of view, so density reads too low there. The border handling parameter corrects this by including events from neighboring FOVs, much like the border handling in nuclei detectionLoading....

Simplified

Density estimation turns discrete points (cell positions) into a smooth surface (the density map). The main parameter is kernel size: a kernel that is too small shows noise, and one that is too large loses local detail.

Parameters & Settings

ParameterTypeDescription
CodedCoded imageThe events whose density to compute (nuclei, specific phenotype, etc.).
Kernel radius (px)Numeric, in pixels (default: 1)Sets the size of the processing window.
Kernel shapeOption (default: Circle)Shape of the search area.
Standard deviationNumeric (default: 1)Gaussian standard deviation controlling the fall-off weighting.
Border sizeNumeric (default: 100)Pixels from neighboring FOVs included to prevent edge artifacts.
Simplified

The main setting is Kernel radius: larger values give smoother maps of broad trends, and smaller values show fine variation. Border size keeps tile edges from reading falsely low.

Practical Example

Here is Ki-67 hotspot scoring in breast cancer:

  1. Detect all nuclei and classify the Ki-67+ cells by gatingLoading....
  2. Run Density of Events on the Ki-67+ coded image, with the kernel radius, which is set in pixels, chosen so the kernel spans a pathological "hotspot".
  3. Find the peak density region in the density map.
  4. Measure the Ki-67 positivity percentage within that hotspot region.

Scanning the slide by eye for "the most mitotically active area" is a judgment call. The density map finds the densest Ki-67+ region by a fixed rule, so repeated analyses of a slide return the same hotspot, whoever runs them.

Simplified

Map the density of Ki-67-positive cells and take the peak. The peak is the most proliferative area, found reproducibly instead of by "scan and estimate".

Connected Terms

Share This Term
Term Connections