% Naive tomography test WITH inverse crime
%
% Samuli Siltanen Jan 2015

% Choose noise level
noiselevel = 0.001;

% Choose the size of the image (attenuation function)
N = 32;

% Choose the angles between 0 and 180 degrees
T  = 50;

% Load precomputed stuff
loadcommand = ['load data/XRmatrix_',num2str(N),'_',num2str(T),' A N T th'];
eval(loadcommand)

% Simulate tomographic data WITH inverse crim
ph   = phantom(N);
mIC  = A*ph(:);
mnIC = mIC + noiselevel*max(abs(mIC))*randn(size(mIC));

% Compute naive inversions
recIC = A\mIC;
recIC = reshape(recIC,N,N);
recnIC = A\mnIC;
recnIC = reshape(recnIC,N,N);

% Take a look
figure(1)
clf
imagesc([ph,recIC,recnIC])
colormap gray
axis equal
axis off
