itasc.contact_analysis.frame_interval

Resolve a position’s frame interval (seconds per frame).

The time twin of pixel_size. Track dynamics needs the real elapsed time between frames to turn pixel displacements into µm/s, MSD into µm²/s, and lags into seconds. Backend-only (no Qt / napari) so the standalone wheel and headless batch runs can use it. Two sources are consulted, in order:

  1. The position’s itasc_config.jsonmetadata.time_interval_s — the key the main pipeline widget already writes (main_widget.py).

  2. The label TIFF’s ImageJ finterval tag (seconds between frames), the convention ImageJ/Fiji writes for time-lapse stacks.

Returns None when neither yields a positive value; callers treat that as “interval unknown” (the dynamics build is then blocked until one is set).

Functions

resolve_time_interval_s(position_dir, label_path)

Seconds/frame for a position, from its config first, then the TIFF tag.

time_interval_from_config(position_dir)

metadata.time_interval_s from itasc_config.json in position_dir.

time_interval_from_tiff(label_path)

Seconds/frame from a TIFF's ImageJ finterval metadata.

itasc.contact_analysis.frame_interval.resolve_time_interval_s(position_dir, label_path)[source]

Seconds/frame for a position, from its config first, then the TIFF tag.

Returns None when no positive interval can be found.

Return type:

float | None

Parameters:
itasc.contact_analysis.frame_interval.time_interval_from_config(position_dir)[source]

metadata.time_interval_s from itasc_config.json in position_dir.

Return type:

float | None

Parameters:

position_dir (Path | str | None)

itasc.contact_analysis.frame_interval.time_interval_from_tiff(label_path)[source]

Seconds/frame from a TIFF’s ImageJ finterval metadata.

Return type:

float | None

Parameters:

label_path (Path | str | None)