mednet.data.temporal.hyperftype_split

Parse frame lists from temporal_hyperftype.json exam rows.

Functions

elapsed_seconds_by_file(stamps)

Map each frame filename to its elapsed-seconds value, skipping NaN entries.

frame_names(stamps)

Return the filenames from a list of stamps in their original order.

frame_sort_key(name)

Sort key placing numeric-stem frames before non-numeric ones.

parse_frames_field(frames)

Parse frames from a temporal exam row (strings or stamp objects).

Classes

FrameStamp(file, elapsed_seconds[, ...])

Record of a single frame's filename and relative acquisition timestamp.

class mednet.data.temporal.hyperftype_split.FrameStamp(file, elapsed_seconds, elapsed_display=None)[source]

Bases: object

Record of a single frame’s filename and relative acquisition timestamp.

file: str
elapsed_seconds: float
elapsed_display: str | None = None
mednet.data.temporal.hyperftype_split.frame_sort_key(name)[source]

Sort key placing numeric-stem frames before non-numeric ones.

Parameters:

name (str) – Frame filename; only the stem (no extension) is used.

Returns:

(0, int_stem) for all-digit stems, (1, stem) otherwise.

Return type:

tuple[int, int | str]

mednet.data.temporal.hyperftype_split.parse_frames_field(frames)[source]

Parse frames from a temporal exam row (strings or stamp objects).

Parameters:

frames (Any) – Raw frames value from a split JSON row.

Returns:

Parsed list of FrameStamp records; empty on invalid input.

Return type:

list[FrameStamp]

mednet.data.temporal.hyperftype_split.frame_names(stamps)[source]

Return the filenames from a list of stamps in their original order.

Parameters:

stamps (list[FrameStamp]) – Sequence of FrameStamp records.

Returns:

Filenames in the same order as stamps.

Return type:

list[str]

mednet.data.temporal.hyperftype_split.elapsed_seconds_by_file(stamps)[source]

Map each frame filename to its elapsed-seconds value, skipping NaN entries.

Parameters:

stamps (list[FrameStamp]) – Sequence of FrameStamp records.

Returns:

{filename: elapsed_seconds} for every stamp whose elapsed time is finite.

Return type:

dict[str, float]