Commit c40abe3f authored by Leon Merten Lohse's avatar Leon Merten Lohse

Remove useless settings.reg_type from phaserec_MBA

There is no reason to ever use anything other than the default reg_type='mba'.
parent 6f5e15f4
Pipeline #139721 passed with stage
in 1 minute and 43 seconds
......@@ -20,8 +20,6 @@ function phase = phaserec_mba(hologram, fresnelNumber, settings)
% ----------------
% reg_alpha : Default = 0.01
% Regularisation Parameter alpha
% reg_type : {'none', 'mba', 'tikhonov'}, Default = 'mba'
% Regularisation method
% padx : Default = 0
% Amount by which the hologram is symmetrically (replicate)-padded along the
% x-dimension before reconstruction
......@@ -78,7 +76,6 @@ function phase = phaserec_mba(hologram, fresnelNumber, settings)
defaults.padx = 0;
defaults.pady = 0;
defaults.reg_alpha = 0.01;
defaults.reg_type = 'mba';
if (nargin == 0)
phase = defaults;
......@@ -99,24 +96,16 @@ laplaceKernel = -fftfreqNormSq(size(hologramPadded));
% make (regularized) inverse Laplace filter kernel
if (settings.reg_alpha == 0)
settings.reg_method = 'none';
end
switch (settings.reg_type)
case 'none'
% avoid division by 0
laplaceKernel(0,0) = 1;
filterKernel = 1 ./ (-laplaceKernel);
% set zero frequency (singularity) to 0
filterKernel(0,0) = 0;
case 'mba'
else
filterKernel = 1 ./ (-laplaceKernel + settings.reg_alpha);
case 'tikhonov'
filterKernel = -laplaceKernel ./ (laplaceKernel.^2 + settings.reg_alpha^2);
otherwise
error(['Invalid reg_method ' settings.reg_method])
end
% apply inversion filter kernel to reconstruct the phase
phase = (2 * pi * fresnelNumber) * real(ifft2(fft2(hologramPadded-1).*filterKernel));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment