% Filtered back-projection reconstruction of lotus data
%
% Tatiana Bubba and Samuli Siltanen September 2016

% Read in the data
load sinogram sinogram

% Correct for centre of rotation 
sinogram = sinogram(1:2221,1:360); 

% Reconstruction using filtered back-projection in fan-beam geometry.
% Geometric considerations:
% -The distance between the source and detector is 63cm
% -The distance between the source and center of rotation is 54cm
% -The detector is 12cm wide and has 2240 columns of pixels
D   = 2240*54/12; % Distance between source and center of rotation in pixels
FSS = 54/63;
recon = ifanbeam(sinogram(:,1:360),D,...
    'FanRotationIncrement',1,...
    'FanSensorGeometry','line',...
    'FanSensorSpacing',FSS,...
    'OutputSize',1500);

% Gamma correction for visualization
plotim = recon; 
plotim = plotim-min(plotim(:)); 
plotim = plotim/max(plotim(:));
gammacorr = .3;
plotim = plotim.^gammacorr;

figure(2)
clf
imagesc(plotim,[0.6 .8])
axis equal
axis off
colormap jet


