phenotypic.measure.MeasureGridSpread#
- class phenotypic.measure.MeasureGridSpread(*args, **kwargs)[source]
Bases:
GridMeasureFeaturesQuantify within-well colony dispersion using pairwise centroid distances.
Compute the sum of squared pairwise Euclidean distances between all colony centroids in each grid section. High values indicate multiple dispersed objects within a single well – a sign of over-segmentation, fragmented growth, or invasive spreading.
- Returns:
pd.DataFrame: Section-level statistics sorted by spread (descending) with columns:
count: number of colonies detected in the section.
ObjectSpread: sum of squared pairwise Euclidean distances between colony centroids in the section.
- Best For:
Detecting over-segmented wells where multiple objects were found instead of a single cohesive colony.
Identifying invasive or spreading growth that extends beyond the designated grid position.
Flagging wells with questionable data quality for manual review or exclusion from downstream analysis.
- Consider Also:
MeasureGridSpatialfor between-well neighbor distances rather than within-well dispersion.MeasureGridLinRegStatsfor positional accuracy metrics based on linear regression.MeasureBoundsfor raw centroid positions per colony.
- See Also:
Tutorial 7: Measuring and Exporting for a walkthrough of grid-level measurements.
Category: GRID_SPREAD# Name
Description
ObjectSpreadSum of squared pairwise Euclidean distances between all unique colony pairs within a grid section. Quantifies spatial dispersion of colonies in a grid cell. Higher values indicate greater spread from the section center, suggesting over-segmentation, multi-detections, or colonies growing beyond expected boundaries. Used to identify problematic grid sections requiring refinement or quality review.
Methods
__init__Compute grid edges and assign each detected object to a grid cell.
- __del__()
Automatically stop tracemalloc when the object is deleted.
- measure(image)
Compute grid edges and assign each detected object to a grid cell.
- Parameters:
image – Image with detected objects.
- Returns:
DataFrame with grid assignments (ROW_NUM, COL_NUM, ROW_MAJOR_IDX).