|
vitrio 0.1.4
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
|
The events a detector counted over a stretch of time. More...
#include <vitrio/detector_event_timeline.hpp>
Public Member Functions | |
| detector_event_timeline (std::size_t rank) | |
| Construct an empty timeline of a given rank. | |
| detector_event_timeline (const detector_event_timeline &other) | |
| detector_event_timeline (detector_event_timeline &&other) noexcept | |
| detector_event_timeline & | operator= (const detector_event_timeline &other) |
| detector_event_timeline & | operator= (detector_event_timeline &&other) noexcept |
| void | add_group (std::uint64_t timestamp, detector_event_position_view positions) |
| Append the events of one timestamp. | |
| void | clear () noexcept |
| Drop the events held, keeping the rank and the capacity. | |
| void | reserve (std::size_t group_count, std::size_t event_count) |
| Make room for a number of groups and events without allocating later. | |
| std::size_t | get_rank () const noexcept |
| Get the number of coordinates each event carries. | |
| std::size_t | get_group_count () const noexcept |
| Get how many groups are held. | |
| std::size_t | get_event_count () const noexcept |
| Get how many events are held, in every group. | |
| std::uint64_t | get_timestamp (std::size_t group) const noexcept |
| Get the timestamp of one group. | |
| detector_event_position_view | get_positions (std::size_t group) const noexcept |
| Get the positions of the events of one group. | |
| detector_event_position_view | get_positions () const noexcept |
| Get the positions of every event held. | |
The events a detector counted over a stretch of time.
Events are held in groups of one timestamp each, the groups in strictly ascending order of their timestamps. A detector that reads out frames gives a group per frame, its timestamp the index of the frame. One that stamps each event with its own time gives a group per distinct time, so that the events of an instant still share one timestamp. A time at which nothing was counted needs no group.
An event is its position: one coordinate per axis, slowest first. Times and positions are counted in the quanta a detector_event_timeline_descriptor states, which the timeline itself does not carry.
The positions of every event are held as one matrix, a row per event and a column per axis, and each group is a run of its rows, so a timeline of any length costs a bounded number of allocations. clear keeps the capacity: a timeline refilled after clearing allocates nothing until it outgrows what it held before.
The rank is stated when a timeline is constructed and never changes.
|
explicit |
Construct an empty timeline of a given rank.
| rank | Number of coordinates each event carries. |
| std::invalid_argument | If rank is zero. |
| void vitrio::detector_event_timeline::add_group | ( | std::uint64_t | timestamp, |
| detector_event_position_view | positions | ||
| ) |
Append the events of one timestamp.
| timestamp | Time of the events. Must be later than that of the group appended last. |
| positions | The positions of the events, which are copied. Must have the rank of this timeline. |
| std::invalid_argument | If timestamp is not later than that of the last group, or if positions does not have the rank of this timeline. |
|
noexcept |
Get how many events are held, in every group.
|
noexcept |
Get how many groups are held.
|
noexcept |
Get the positions of every event held.
|
noexcept |
Get the positions of the events of one group.
| group | Position of the group. Must be below get_group_count. |
|
noexcept |
Get the number of coordinates each event carries.
|
noexcept |
Get the timestamp of one group.
| group | Position of the group. Must be below get_group_count. |
group. | void vitrio::detector_event_timeline::reserve | ( | std::size_t | group_count, |
| std::size_t | event_count | ||
| ) |
Make room for a number of groups and events without allocating later.
| group_count | Number of groups to make room for. |
| event_count | Number of events to make room for. |