autoemx.core.particle_outlines module
Outlines of the particles found in a frame by a segmentation, to show the segmentation on the frame image (GUI: Analysis > Particle sizes, frame browser).
One small JSON file per frame and segmentation, outside the ledger (loaded only when the frame is shown):
<sample>/particle_outlines/segmentation_<id>/<frame_id>.json, with the outline of each particle counted in the
statistics (in the order of the frame’s particles: particle i of the frame) and of the other particles found
(touching the frame edge, or outside the diameters searched in the frame). Each outline is a polygon
[x0, y0, x1, y1, ...] in pixels of the frame image.
Created on Sat Oct 17 2026 @author: Andrea
- autoemx.core.particle_outlines.outlines_path(sample_dir: str, segmentation_id: int, frame_id: str) str[source]
File of the particle outlines of a frame under a segmentation.
- autoemx.core.particle_outlines.frame_outlines(labels: ndarray, counted: Iterable[int], others: Iterable[int] = ()) Dict[str, list][source]
Outlines of the particles of a label image:
counted(labels of the particles counted, in the order of the frame’s particles) andothers(labels of the other particles found).
- autoemx.core.particle_outlines.save_outlines(sample_dir: str, segmentation_id: int, frame_id: str, outlines: Dict[str, list]) str[source]
Save the particle outlines of a frame under a segmentation; returns the file.
- autoemx.core.particle_outlines.load_outlines(sample_dir: str, segmentation_id: int | None, frame_id: str) Dict[str, list] | None[source]
Particle outlines of a frame under a segmentation, or None if not saved (frames segmented before outlines were saved: segmenting them again with the same settings adds them).