extract_object_stats

FeatureExtractor.extract_object_stats(features=('area', 'circularity', 'elongation', 'extent'), intensity_channels=())[source]

Extract features from connected components per cluster for each cell.

Implemented features are: area, circlularity, elongation, and extent of connected components per cluster for each cell. In addition, the mean intensity per component/region of channels specified in intensity_channels is calculated. Per component/region features are calculated and stored in uns['object_stats'], together with OBJ_ID and cluster that this region belongs to. To aggregate these computed stats in a mean/median values per OBJ_ID, use FeatureExtractor.get_object_stats().

$circularity = (4 * pi * Area) / Perimeter^2$

$elongation = (major_axis - minor_axis) / major_axis$

Parameters
  • features (Iterable[str]) – List of features to be calculated.

  • intensity_channels (Iterable[str]) – List of channels for which the mean intensity should be extracted.

Return type

None

Returns

  • Nothing, modifies adata

  • - Adds ``uns`` entry (object_stats and object_stats_params)

  • - Adds ``obs`` entries (mean_{channel_name})