% Plot the results of XRM3_NoCrimeData_comp.m. 
%
% Arguments:
% N    resolution of the previous computation is N x N
% T    the number of angles in the measurement
%
% Samuli Siltanen October 2012

function XR04_NoCrimeData_plot(N,T)

% Gamma correction value for making the plots brighter
gammacorr = .5;

% Load precomputed results at resolution N from file
loadcommand = ['load data/XRMC_NoCrime_', num2str(N),'_',num2str(T), ' N N2 m mnc mncn th target target2 err_sup err_squ'];
eval(loadcommand)


% Difference between the two measurements
difference = abs(m-mnc);

% Maximum value needed for creating same colorscale to all three subimages
MAX = max([m(:);mnc(:);difference(:)]);

% Normalize the values of the pixel images m, mnc and difference so that
% the pixel values are (1) comparable and (2) between zero and one.
m   = max(0,m);
m   = m/MAX;
mnc = max(0,mnc);
mnc = mnc/MAX;
difference = difference/MAX;

% Plot parameters
fsize = 10;

% Show actual phantom (target)
figure(6)
clf
subplot(1,2,1)
imagesc(max(0,target).^gammacorr)
colormap gray
axis square
axis off
title(['Shepp-Logan phantom at size ', num2str(N), 'x', num2str(N)],'fontsize',fsize)
subplot(1,2,2)
imagesc(max(0,target2).^gammacorr)
colormap gray
axis square
axis off
title(['Shepp-Logan phantom at size ', num2str(N2), 'x', num2str(N2)],'fontsize',fsize)

% Take a look at the measurement WITH inverse crime
figure(1)
clf
subplot(1,3,1)
imagesc(m.^gammacorr,[0,1])
colormap gray
axis square
axis off
title('Sinogram with inverse crime','fontsize',fsize)
% Take a look at the measurement WITHOUT inverse crime
subplot(1,3,2)
imagesc(mnc.^gammacorr,[0,1])
colormap gray
axis square
axis off
title('More honest sinogram','fontsize',fsize)
% Take a look at the difference between the two measurements
subplot(1,3,3)
imagesc(difference.^gammacorr,[0,1])
colormap gray
axis square
axis off
title('Difference','fontsize',fsize)



% figure(11)
% clf
% subplot(1,2,1)
% imagesc(max(0,target).^(.5))
% axis equal
% colormap gray
% subplot(1,2,2)
% imagesc(m)
% axis square
% colormap gray


