Detect and auto-correct camera tilt for centered CoR
About
This MR is part of a series of MRs on: Automatic detection and correction of detector's pixel columns tilts with respect to the rotation axis.
General
Ultimate goal is to be able to specify the following in the configuration file:
Add a new key in the same spirit of rotation_axis_position
, called tilt_correction = [auto|algo1|algo2|value]
where:
-
auto
is the default automatic tilt computation method (could be different between rotation axis in the center and rotation axis on the side). -
algo1
,algo2
refer to tilt computation methods -
value
is a scalar chosen by the user
Follow-up of !102 (merged).
Specific
Here we implement a new method for the tilt detection based on the fft-polar transform (log could be an option, to be discussed), and its integration in the pipeline.
This MR only targets acquisitions with rotation axis in the center. Acquisition with rotation axis on the side, will be tackled in a different MR, because they require extra care.
To do
-
Implement fft-ploar transform based tilt fitting in CameraTilt
(method and docstring) -
Implement handling of the configuration file -
Unit tests -
Integrate in pipeline -
End-to-end reconstruction test
Notes
The new interface of CameraTilt
, from namu/preproc/alignment.py
will be:
class CameraTilt(CenterOfRotation):
def compute_angle(
self,
img_1: np.ndarray,
img_2: np.ndarray,
method="1d-correlation", # New argument
roi_yxhw=None,
median_filt_shape=None,
padding_mode=None,
peak_fit_radius=1,
high_pass=None,
low_pass=None,
):
Where method
is one out of:
-
"1d-correlation"
: current behavior, with 1D FFT-based horizontal correlation. -
"fft-polar"
: correlation over the polar warp transform of the 2D-FFT transforms of the two images (at 0 and 180 degrees). A second 2D-FFT correlation will be used for finding the CoR on the rotated images, to honor the current interface.