-
Notifications
You must be signed in to change notification settings - Fork 0
/
ScriptFig3.m
110 lines (96 loc) · 3.39 KB
/
ScriptFig3.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
%--------------------------------------------------------------------------
% This script reproduces the Figure 3 of the paper
%
% [1] E. Soubies and M. Unser, "Computational super-sectioning for single-slice structured-illumination microscopy"
% IEEE Transactions on Computational Imaging, vol. 5 no. 2, pp. 240-250, 2019.
%
% Copyright (2018) E. Soubies [email protected]
%--------------------------------------------------------------------------
clear;close all;
%% Parameters
% -- Paths
basedir=cd;
dataname=[basedir,'/Data/Acqdata.tif']; % File name data image
psfname=[basedir,'/Data/PSF.tif']; % File name psf
pattname=[basedir,'/Data/patterns.tif']; % File name patterns
gtname=[]; % File name ground truth (if no let empty)
outFolder=basedir; % Folder to save results
sav=0; % Boolean if true save the result
% -- Data
valback=0; % Background value
downFact=[2 2]; % Downsampling factors
% -- Objective Function
lamb=1e-4; % Hyperparameter (can be an array to loop)
nbOutSl=2; % The number of considered out-of-focus slices will be (2*nbOutSl-1)
symPsf=1; % Boolean true if psf is symmetric (in this case 2*nbOutSl out-of-focus slides are considered on the same side of the psf in z)
Reg=1; % Choice regul: 1 for TV, 2 for Hessian-Schatten
% -- Initialize Figures
figIters=figure; hold on; set(gca,'Fontsize',14); grid;xlabel('Iterations'); ylabel('f(x)/f(x^0)');
set(gca,'yscale','log')
figtime=figure; hold on; set(gca,'Fontsize',14); grid;xlabel('Elapsed time (min)'); ylabel('f(x)/f(x^0)');
set(gca,'yscale','log')
%% Algorithms
% -- Commun parameters
ItUpOut=5;
maxIt=100; % Max iterations
% *** ADMM ***
alg=1;
rhoDTNN= 7e-2;
rhoReg= 7e-2;
% - Full Splitting (iter GC = 1)
split=1;
iterCG=1;
run ./SimScript2D
F0=Opt.cost*zeros(H.sizein);
% Plots
figure(figIters)
semilogy([0,Opt.OutOp.iternum],[F0,Opt.OutOp.evolcost]/F0,'LineWidth',2);
drawnow;
figure(figtime)
semilogy(linspace(0,Opt.time/60,length(Opt.OutOp.evolcost)+1),[F0,Opt.OutOp.evolcost]/F0,'LineWidth',2);
drawnow;
% - Full Splitting (iter GC = 3)
iterCG=3;
run ./SimScript2D
F0=Opt.cost*zeros(H.sizein);
% Plots
figure(figIters)
semilogy([0,Opt.OutOp.iternum],[F0,Opt.OutOp.evolcost]/F0,'LineWidth',2);
drawnow;
figure(figtime)
semilogy(linspace(0,Opt.time/60,length(Opt.OutOp.evolcost)+1),[F0,Opt.OutOp.evolcost]/F0,'LineWidth',2);
drawnow;
% - Splitting proposed in [1]
split=2;
rhoDTNN= 7e-4;
rhoReg= 7e-4;
valId=2;
run ./SimScript2D
F0=Opt.cost*zeros(H.sizein);
% Plots
figure(figIters)
semilogy([0,Opt.OutOp.iternum],[F0,Opt.OutOp.evolcost]/F0,'LineWidth',2);
drawnow;
figure(figtime)
semilogy(linspace(0,Opt.time/60,length(Opt.OutOp.evolcost)+1),[F0,Opt.OutOp.evolcost]/F0,'LineWidth',2);
drawnow;
% *** Primal-Dual (Splitting proposed in ref [12] of [1]) ***
alg=2;
rho=1.99;
tau=2.5;
run ./SimScript2D
F0=Opt.cost*zeros(H.sizein);
figure(figIters)
semilogy([0,Opt.OutOp.iternum],[F0,Opt.OutOp.evolcost]/F0,'LineWidth',2);
drawnow;
figure(figtime)
semilogy(linspace(0,Opt.time/60,length(Opt.OutOp.evolcost)+1),[F0,Opt.OutOp.evolcost]/F0,'LineWidth',2);
drawnow;
figure(figIters)
legend('ADMM FS (1 iter CG)','ADMM FS (3 iters CG)', ...
'ADMM Inner-loop free',...
'Primal-Dual');
figure(figtime)
legend('ADMM FS (1 iter CG)','ADMM FS (3 iters CG)', ...
'ADMM Inner-loop free',...
'Primal-Dual');