Skip to main content

fpm_rs/reconstruction/
batch.rs

1/// One scheduled group of acquisition frames supplied to an algorithm step.
2#[derive(Clone, Debug)]
3pub struct Batch {
4    /// Zero-based acquisition-frame indices in processing order.
5    pub indices: Vec<usize>,
6    /// Zero-based position of this batch within the current iteration.
7    pub batch_index: usize,
8}
9
10impl Batch {
11    /// Creates a batch from acquisition-frame `indices` and its iteration-local index.
12    pub fn new(indices: Vec<usize>, batch_index: usize) -> Self {
13        Self {
14            indices,
15            batch_index,
16        }
17    }
18
19    /// Creates the first batch containing a single acquisition frame.
20    pub fn single(frame: usize) -> Self {
21        Self::new(vec![frame], 0)
22    }
23}