playnano.analysis.modules.tracked_particle_boundary_size module¶
Analysis module that measures the size of each tracked particle over time.
The size is the longer side of each region’s bounding box, as found by
particle_region_extraction. A threshold can split the time points into two
states, for example compact and extended.
- class playnano.analysis.modules.tracked_particle_boundary_size.BoundarySizeModule[source]¶
Bases:
AnalysisModuleMeasure each tracked particle’s size, frame by frame.
Pipeline name:
"tracked_particle_boundary_size". It needs the output ofparticle_region_extraction, run withinclude_bbox=True(the default). The size,max_dim, is the longer side of the region’s tight bounding box, in pixels. Seerun()for the parameters and outputs.- requires = ['particle_region_extraction']¶
- run(stack: Any, previous_results: Dict[str, Any] | None = None, *, extraction_module: str = 'particle_region_extraction', threshold: float | None = None, measure: str = 'bbox_max_dim') Dict[str, Any][source]¶
Measure the size of each tracked particle in each frame.
- Parameters:
stack (AFMImageStack) – The stack; not used directly.
previous_results (dict) – Outputs of earlier steps. Must hold the output of
extraction_module.extraction_module (str, optional) – Name of the region extraction step. Default is
"particle_region_extraction".threshold (float, optional) – If given, each frame is also given a
state: 1 ifmax_dimis greater thanthreshold(in pixels), otherwise 0. Default is None.measure (str, optional) – The size measure. Only
"bbox_max_dim"is available. Default is"bbox_max_dim".
- Returns:
"measure","threshold"The values used.
"per_track"One dict per track, with
track_id,frames,timestamps(s),max_dim(pixels) and, with a threshold,state. Frames where the particle was not found havemax_dimNaN andstateNaN."flat_table"The same values with one dict per track and frame, with
track_id,label,frame,timestamp,max_dimand, with a threshold,state; ready forpandas.DataFrame."plot_hints"Names of plotting functions in
playnano_plugins, a package that is not part of playNano."summary"n_tracks,n_rows,n_missing_region_measurementsandstate_included.
- Return type:
- Raises:
RuntimeError – If
previous_resultsis None, lacksextraction_module, or the extraction ran withinclude_bbox=False.ValueError – If
measureis not"bbox_max_dim".
- version = '0.1.0'¶