playnano.analysis.utils.frames module

Per-frame summaries of detected features, as a table or histogram.

playnano.analysis.utils.frames.frame_summary_to_dataframe(features_per_frame: Sequence[Sequence[dict]]) → DataFrame[source]

Summarise the features detected in each frame, one row per frame.

Parameters:

features_per_frame (list of list of dict) – The "features_per_frame" output of a feature detection module, such as feature_detection. Each feature dict must have "area" and "mean".

Returns:

One row per frame, with the columns:

  • frame_index (int): from 0.

  • n_features (int): number of features.

  • total_area and mean_area (float): feature area, in pixels.

  • mean_intensity (float): the average of the features’ mean heights, usually in nm.

mean_area and mean_intensity are 0.0 for a frame with no features.

Return type:

pandas.DataFrame

playnano.analysis.utils.frames.plot_frame_histogram(df: DataFrame, column: str, ax: Axes | None = None, save_to: Path | None = None, bins: int = 20) → Axes[source]

Plot a histogram of one column of a per-frame summary.

Parameters:
Returns:

The axes drawn on.

Return type:

matplotlib.axes.Axes