Margin with z-binning
About
Follow-up of !188 (merged). The goal is to make sure margin works with (z-)binning.
To do
-
Check _build_processing_steps
-
Adapt start_xyz and end_xyz when using binning -
End-to-end reconstruction test
Notes
When splitting the dataset in chunks of sub-volumes, there are a few cases to consider.
The processing is either split along the vertical direction (process projections[:, start_z:end_z, :]
), or in the "angles" direction (process projections[start_a:end_a, :, :]
.
Either way, let's denote N
the size of the dimension where the processing is split along (can be either be N_z = delta_z
or n_angles
.
Case 0: no binning, no margin
C1 C3
|------|------|------|---|
C2 C4
Simplest case, here we have
N = \displaystyle\sum_{i=1}^K C_i
where there are K
chunks C_1, \ldots, C_K
.
Case 1: margin, no binning
Each chunk of size C_i
is eventually truncated to C_i - M_i
where M_i
is the total margin (up and down).
| C1 | | C3 |
|------|--|----|--|----|--|----|
| C2 | | C4 |
N = \displaystyle\sum_{i=1}^K C_i - M_i
Case 2: binning, no margin
Each chunk of size C_i
is eventually reduced to C_i // b
where b
denotes the binning factor, and //
is the integer division.
When there is no margin, sticking together all the binned chunks yields
\displaystyle\sum_{i=1}^K C_i // b
To have this sum equal to N//b
is not obvious, as generally (a + b) // c
is not equal to a // c + b // c
.
A sufficient condition is to have C_i \text{ mod } b = 0
, i.e all the chunks sizes are multiple of the binning factor.
Case 1+2: binning and margin
We need to have
\displaystyle\sum_{i=1}^K (C_i - M_i) // b
equal to N//b
.
Similarly as above, the simplest sufficient condition is C_i \text{ mod } b = 0
and M_i \text{ mod } b = 0
, i.e all the chunk size and margins are multiple of b.