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 asfeature_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_areaandmean_area(float): feature area, in pixels.mean_intensity(float): the average of the features’ mean heights, usually in nm.
mean_areaandmean_intensityare 0.0 for a frame with no features.- Return type:
- 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:
df (pandas.DataFrame) – A table from
frame_summary_to_dataframe().column (str) – The column to plot, for example
"n_features".ax (matplotlib.axes.Axes, optional) – Axes to draw on. If None, a new figure is created. Default is None.
save_to (str or pathlib.Path, optional) – If given, save the figure to this file at 150 dpi. Default is None.
bins (int, optional) – Number of histogram bins. Default is 20.
- Returns:
The axes drawn on.
- Return type: