%  Demonstration for showing th projection
%  process in CT scanning
%
%  Version 1.0, 3/11-97, Jørgen Arendt Jensen
%   Version 1.2, October 29, 2018, JAJ
%      Adapted for newer versions of Matlab

%  Set default text font and line size

set(0,'defaultaxesfontsize',18);
set(0,'defaulttextfontsize',18);

clf
hp1=axes('position',[0.25 0.4 0.7 0.58]);  %  Window for display
axes(hp1)
colormap(gray)
axis off
zoom on
hp2=axes('position',[0.25 0.05 0.7 0.3]);  %  Window for display

%  Load the thorax

disp('Loading data...')
load thorax_film
img=thorax(1:2:512,1:2:512);
axes(hp1);
imagesc(img);
colormap(gray);
axis off;
axis('image');

%  Place push buttons on the display

t1=uicontrol('Style','Pushbutton','Units','normalized','Position',[0.02 0.8 0.15 0.08],...
             'Callback','load thorax_film; img=thorax(1:2:512,1:2:512); axes(hp1); imagesc(img); colormap(gray); axis off; axis(''image'');',...
             'String','Thorax', 'fontsize',18);

t2=uicontrol('Style','Pushbutton','Units','normalized','Position',[0.02 0.7 0.15 0.08],...
             'Callback','load torso_film; img=torso(1:2:512,1:2:512); axes(hp1); imagesc(img); colormap(gray); axis off; axis(''image'');',...
             'String','Torso', 'fontsize',18);

t3=uicontrol('Style','Pushbutton','Units','normalized','Position',[0.02 0.6 0.15 0.08],...
             'Callback','load head_film; img=head(1:2:512,1:2:512); axes(hp1); imagesc(img); colormap(gray); axis off; axis(''image'');',...
             'String','Head', 'fontsize',18);


t4=uicontrol('Style','Pushbutton','Units','normalized','Position',[0.02 0.4 0.15 0.08],...
             'Callback','make_project',...
             'String','Project', 'fontsize',18);

t5=uicontrol('Style','Pushbutton','Units','normalized','Position',[0.02 0.3 0.15 0.08],...
             'Callback','make_pro_film',...
             'String','Projection film', 'fontsize',18);


