Distance metrics (Gonzalez & Woods): Three common distance metrics for image analysis: Euclidean (D_e = √(Δx² + Δy²)) — the true straight-line distance, producing circular iso-distance contours; City block / Manhattan (D_4 = |Δx| + |Δy|) — the path along grid axes, producing diamond-shaped contours; Chessboard (D_8 = max(|Δx|, |Δy|)) — allows diagonal steps at unit cost, producing square contours. For biological spatial analysis, Euclidean distance is standard because cell-to-cell distances in tissue don't follow grid constraints.
The inside distance transform and shape: The inside distance transform of a convex object has a single peak at its center, with the peak value equal to the inscribed circle radius. For touching objects, the valley between their peaks indicates the contact region. This is why the negated inside distance transform serves as an ideal watershed input — each object's center is a local minimum (catchment basin), and the contact region is a ridge (watershed boundary). Solomon & Breckon note that the Euclidean distance transform "calculates distance from each background point to nearest foreground point" and when negated and used as a watershed surface, it performs shape-based segmentation.
Proximity zones and buffer analysis: Thresholding a distance map at a specific value creates a buffer zone — the set of all pixels within that distance of the objects. This is equivalent to morphological dilation by that distance but computed continuously rather than for a single integer value. A distance map thus encodes all possible dilation distances simultaneously, enabling flexible proximity analysis without rerunning the dilation at each distance.
Nearest-neighbor statistics: For two sets of objects (e.g., tumor cells and immune cells), the distance from each tumor cell's centroid to the nearest immune cell can be read directly from the immune cell distance map. The distribution of these nearest-neighbor distances characterizes the spatial relationship between the two populations: a narrow distribution centered on small distances indicates close spatial association; a wide distribution centered on large distances indicates spatial separation.
The distance transform converts binary objects into continuous distance surfaces. Inside objects, the distance to the nearest boundary reveals shape (peaks at centers, valleys at thin connections). Outside objects, the distance reveals proximity relationships. This simple transformation enables powerful spatial analysis: finding all cells within 50 µm of the tumor boundary is just a threshold on the tumor distance map.