itasc.contact_analysis.shape.core

Compute a per-object, per-frame shape table — label-agnostic.

One row per (frame, object label): area, perimeter, equivalent diameter, the fitted-ellipse axis lengths and their ratio, circularity, eccentricity, solidity, extent, orientation, and centroid — all from skimage.measure.regionprops(). Dimensional descriptors are converted to physical units using the caller-supplied pixel_size_um (µm per pixel): areas to µm² (area_um2), lengths and centroids to µm (the *_um columns). The ratios (aspect_ratio, circularity, eccentricity, solidity, extent) are dimensionless and scale-invariant.

The core is label-agnostic: it runs over whatever label stack it is handed (cell or nucleus), so the cell / nucleus quantifiers differ only by which input field they read. The object-key column name is caller-supplied (always cell_id — really the shared track id).

The table is computed in memory (compute_object_shape()) and pooled by the aggregate stage; nothing is persisted per position. The module is backend-only (no Qt / napari import), so scripts and the standalone wheel can use it.

Module attributes

DESCRIPTOR_COLUMNS

The measured descriptor columns (everything but the tidy keys) — the value axis a plot/export chooses from.

Functions

circularity(area, perimeter)

4π·area / perimeter², clamped to ≤ 1 (a perfect disk is 1.0).

compute_object_shape(label_path, *, ...[, ...])

Per-object shape descriptors for every frame, as a column-major table.

read_label_stack(path)

itasc.contact_analysis.shape.core.DESCRIPTOR_COLUMNS = ('area_um2', 'perimeter_um', 'equivalent_diameter_um', 'major_axis_length_um', 'minor_axis_length_um', 'aspect_ratio', 'circularity', 'eccentricity', 'solidity', 'extent', 'orientation', 'centroid_y_um', 'centroid_x_um')

The measured descriptor columns (everything but the tidy keys) — the value axis a plot/export chooses from. Kept explicit so the on-disk order is stable.

itasc.contact_analysis.shape.core.compute_object_shape(label_path, *, pixel_size_um, object_key='cell_id')[source]

Per-object shape descriptors for every frame, as a column-major table.

Columns: frame, object_key, then DESCRIPTOR_COLUMNS.

Return type:

dict[str, ndarray]

Parameters:
itasc.contact_analysis.shape.core.circularity(area, perimeter)[source]

4π·area / perimeter², clamped to ≤ 1 (a perfect disk is 1.0).

Return type:

float

Parameters:
itasc.contact_analysis.shape.core.read_label_stack(path)[source]
Return type:

ndarray

Parameters:

path (Path)