Commit 5dde03b4 authored by Leon Merten Lohse's avatar Leon Merten Lohse

Fix support constraint in phaserec_nonlinTikhonov

The support mask for the initial guess was not padded.
parent 42e92497
Pipeline #120044 passed with stage
in 1 minute and 48 seconds
......@@ -280,7 +280,7 @@ if doIterativeOptimization
proxConstraints = @(f,tau) proxMax(proxMin(proxSupport(f)));
% Compute minimizer using a fast ADMM algorithm
[result, stats] = fADMM(proxConstraints, proxCTF, ...
[result, ~] = fADMM(proxConstraints, proxCTF, ...
zeros(size(sumCTFHolograms), class(sumCTFHolograms)), ...
settings.optimization);
......
......@@ -184,7 +184,7 @@ end
% Optional padding of holograms (and of optional support)
holograms = padarray(gpuArrayIf(holograms, useGPU), [settings.pady settings.padx], 'replicate');
if ~isempty(settings.support)
support = padarray(gpuArrayIf(settings.support, useGPU), [settings.pady settings.padx]);
settings.support = padarray(gpuArrayIf(settings.support, useGPU), [settings.pady settings.padx]);
end
N = size(holograms(:,:,1));
......@@ -194,7 +194,6 @@ N = size(holograms(:,:,1));
% ----------------------------------------------------------------------------------------------- %
% --------- Step 1: perform CTF-reconstruction to obtain initial guess (if not assigned) -------- %
% ----------------------------------------------------------------------------------------------- %
settingsCTF = settings;
settingsCTF.padx = 0; % Holograms are already padded,
settingsCTF.pady = 0; % so no more padding necessary
......@@ -257,8 +256,7 @@ if settings.minPhase > -inf || settings.maxPhase < inf || ~isempty(settings.supp
projMax = Id;
end
if numel(settings.support)
% If padding is applied to the data, the support has to be padded as well
projSupport = @(f) support .* f;
projSupport = @(f) settings.support .* f;
else
projSupport = Id;
end
......
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