acia.timing#
Helpers for physical calibration (time and pixel size) in pint units.
Sequences and overlays carry an optional physical calibration:
timepoints– a per-frame pintQuantityarray (time of each frame), specified at load either explicitly or via a scalarframe_interval;pixel_size– a pint length per pixel (isotropic scalar, or a 2-element[y, x]Quantity for anisotropic pixels).
These helpers normalise user-supplied values into pint quantities.
- acia.timing.to_quantity(value)[source]#
Coerce a value to a pint
Quantity(parse strings like"15 minute").
- acia.timing.resolve_timepoints(n, *, timepoints=None, frame_interval=None)[source]#
Return a length-
npintQuantityof per-frame timepoints, orNone.- Parameters:
n (int) – number of frames.
timepoints – explicit per-frame times as a pint
Quantityarray.frame_interval – scalar time between frames (pint
Quantityor a string like"15 minute"); yieldsarange(n) * interval.
- acia.timing.pixel_input_unit(pixel_size, dim)[source]#
Derive the per-pixel input unit for a length (
dim=1) or area (dim=2).Accepts a scalar pint
Quantity(isotropic), a 2-element pint array, or a(x, y)tuple/list of quantities (e.g. from OMERO). ReturnsNoneifpixel_sizeisNone. For anisotropic input, area uses the product of the two axes and length their geometric mean (axis order does not matter).- Parameters:
dim (int)