% iPda = pdaStopInd;
% -- figures
dirname = dirOuter;
recMat = reshape(hsolCVU,[seti.nROI, seti.nROI]);

figure(101); imagesc(real(recMat)); title('reconstruction (real)'); colorbar;
axis xy;
savePngFigSimple(101,dirname,'rec_real',iPda);

figure(102); imagesc(imag(recMat)); title('reconstruction (imag)'); colorbar;
axis xy;
savePngFigSimple(102,dirname,'rec_imag',iPda);

v1 = real(recMat(round(seti.nROI/2),:));
qExaMat = reshape(seti.qROIexact,[seti.nROI,seti.nROI]);
v2 = real(qExaMat(round(seti.nROI/2),:));
figure(103); plot(1:length(v1),v1,1:length(v2),v2);legend('rec','exact');
savePngFigSimple(103,dirname,'rec_schnitt',iPda);

if seti.invNo ~= 1 % i.e. in this file: pda
    figure(104); plot(1:iPda,errInPda(1:iPda)); title('error in pda');
    savePngFigSimple(104,dirname,'err',iPda);

    figure(105);
    xa = 1:iPda;
    [ax,h1,h2] = plotyy([xa',xa',xa'],[minf.fs(xa),minf.fg(xa),minf.fp(xa)],xa',minf.fd(xa));
    legend([h1;h2],'fs','fg','fp','fd');
    clear ps xa;
    axis(ax,'square');
    xlabel('pda (inner) iterations');
    title('parts of min functional');
    savePngFigSimple(105,dirname,'minf',iPda);

end

figure(106); % proxGsp (real part)
%
y1 = seti.R(wx+vsp);
y1mat = reshape(y1,[seti.nROI, seti.nROI]);
y1 = y1mat(round(seti.nROI/2),:);
%
y2 = seti.shrkRe(seti.R(wx+vsp),tau*seti.alpha*seti.dVinv);
y2mat = reshape(y2,[seti.nROI, seti.nROI]);
y2 = y2mat(round(seti.nROI/2),:);
%
y3 = seti.R(xnpRVD);
y3mat = reshape(y3,[seti.nROI, seti.nROI]);
y3 = y3mat(round(seti.nROI/2),:);
%
xa = 1:length(y1mat);
plot(xa,y1,xa,y2,xa,y3);
legend('R(wx+vsp) (nROI/2,:)','shrkRe(R(wx+vsp)) (nROI/2,:)','proxGsp (nROI/2,:)');
savePngFigSimple(106,dirname,'proxGsp',iPda);

figure(107);
%size(wygVal) %4 x 128 x 128
y1 = seti.R(seti.R(wygVal)); % 1 x 128 x 128 (only plot 1st component)
y1mat = reshape(y1,[seti.nROI, seti.nROI]);
y1 = y1mat(round(seti.nROI/2),:);
%
y2 = seti.R(seti.R(ygnp)); % 1 x 128 x 128
y2mat = reshape(y2,[seti.nROI, seti.nROI]);
y2 = y2mat(round(seti.nROI/2),:);
%
xa = 1:length(y1mat);
plot(xa,y1,xa,y2);
legend('wygVal (round(nROI/2),:)','proxFgPlus (round(nROI/2),:)');
%
savePngFigSimple(107,dirname,'wygVal_proxFgPlus',iPda);

v1 = seti.R(seti.Kd(xmnRVD,JA,JB));
v2 = seti.R(seti.R(seti.Kg(xmnRVD)));
figure(108); imagesc(v1); colorbar;
axis xy;
savePngFigSimple(108,dirname,'R_Kd',iPda);

figure(109); imagesc(squeeze(v2)); colorbar;
axis xy;
savePngFigSimple(109,dirname,'R_Kg',iPda);

v1 = seti.R(KdAdjyd);
v2 = seti.R(KgAdjyg);
figure(110); imagesc(real(reshape(v1,[seti.nROI, seti.nROI]))); colorbar;
axis xy;
savePngFigSimple(110,dirname,'R_KdAdj',iPda);

figure(111); imagesc(squeeze(real(reshape(v2,[seti.nROI, seti.nROI])))); colorbar;
axis xy;
savePngFigSimple(111,dirname,'R_KgAdj',iPda);