Multi-stage reconstruction with overlapping chunks
This PR adds the support for reconstruction with "Paganin margin".
When performing phase retrieval, there might be artefacts at the edges of each image because of the filtering (see #122 (closed)).
These artefacts are visible when chunks are stitched together vertically, even when using "edges" padding.
In a multi-stage reconstruction, we can use data at top/bottom for padding. There are several ways to do it:
- "Naive": do all the processing on radios
(n_angles, delta_z, n_x)
, then crop to(n_angles, delta_z - margin_top - margin_bottom, n_x)
- More optimized: once phase retrieval is done, crop radios to
(n_angles, delta_z - margin_top - margin_bottom, n_x)
and do the rest of the processing on this sub-array.
Approach (2) is more difficult to implement.
Fortunately, pycuda.gpuarray
enables to manipulate arrays views seamlessly.
The difficulty, internally, is to change the "shape" of the radios just after the phase retrieval.
To do:
-
Compute margin as a function of the chunk z-position in volume -
Add margin
parameter forPhaseRetrieval
class in the pipeline -
Change radios shape after phase retrieval -
Make sure it works with CudaFullFieldPipelineLimitedMemory
-
Tests
Once this is done, the following will be done in another PR:
- Estimate phase margin automatically (#122 (closed))
- Call the full-field classes with proper sub-region overlapping (#128 (closed))
Edited by Pierre Paleo