%% fig8.m: script to display fig8:

% variables in fig8.mat:
% fdgImage100it - the FDG prior image reconstructed with 100 iterations of MLEM, then smoothed with a 4mm FWHM Gaussian
% fdgImage200it - the FDG prior image reconstructed with 200 iterations of MLEM, then smoothed with a 4mm FWHM Gaussian
% fdgImage500it - the FDG prior image reconstructed with 50 iterations of MLEM, then smoothed with a 4mm FWHM Gaussian
% metRecon_fdg100it - the methionine image reconstructed using FDG guided MAPEM with the smoothed 100 iteration FDG image as the guiding image
% metRecon_fdg200it - the methionine image reconstructed using FDG guided MAPEM with the smoothed 200 iteration FDG image as the guiding image
% metRecon_fdg50it - the methionine image reconstructed using FDG guided MAPEM with the smoothed 50 iteration FDG image as the guiding image
% tumrMask - the mask used to calculate the tumour mean values
% blue2RedCmap - a blue to red colourmap for showing the difference images

load('fig8.mat')
%%
figure
subplot(3,3,4),petdisplay(fdgImage50it(110:230,110:230,84)),pettitle('FDG_{50}'),clFdg(1:2) = caxis;colorbar
subplot(3,3,1),petdisplay(fdgImage100it(110:230,110:230,84)),pettitle('FDG_{100}'),clFdg(3:4) = caxis;colorbar
subplot(3,3,7),petdisplay(fdgImage200it(110:230,110:230,84)),pettitle('FDG_{200}'),clFdg(5:6) = caxis;colorbar
setColourAxes(gcf,[0,max(clFdg)]);

subplot(3,3,5),petdisplay(metRecon_fdg50it(110:230,110:230,84)),pettitle(sprintf('FDG-Guided MAPEM MET\n tumour mean = %f',mean(metRecon_fdg50it(tumrMask)))),clMet(1:2) = caxis;colorbar
subplot(3,3,2),petdisplay(metRecon_fdg100it(110:230,110:230,84)),pettitle(sprintf('FDG-Guided MAPEM MET\n tumour mean = %f',mean(metRecon_fdg100it(tumrMask)))),clMet(3:4) = caxis;colorbar
subplot(3,3,8),petdisplay(metRecon_fdg200it(110:230,110:230,84)),pettitle(sprintf('FDG-Guided MAPEM MET\n tumour mean = %f',mean(metRecon_fdg200it(tumrMask)))),clMet(5:6) = caxis;colorbar
subplot(3,3,2),caxis([0,max(clMet)]);
subplot(3,3,5),caxis([0,max(clMet)]);
subplot(3,3,8),caxis([0,max(clMet)]);

subplot(3,3,6),petdisplay(metRecon_fdg50it(110:230,110:230,84)-metRecon_fdg100it(110:230,110:230,84)),clDiff(1:2) = caxis;colorbar
subplot(3,3,3),petdisplay(metRecon_fdg100it(110:230,110:230,84)-metRecon_fdg100it(110:230,110:230,84)),pettitle('Differences from FDG_{100}-guided'),clDiff(3:4) = [0,0];
subplot(3,3,9),petdisplay(metRecon_fdg200it(110:230,110:230,84)-metRecon_fdg100it(110:230,110:230,84)),clDiff(5:6) = caxis;colorbar
maxDiff = max(abs(clDiff));
subplot(3,3,3),caxis([-maxDiff,maxDiff]);colormap(gca,blue2RedCmap)
subplot(3,3,6),caxis([-maxDiff,maxDiff]);colormap(gca,blue2RedCmap)
subplot(3,3,9),caxis([-maxDiff,maxDiff]);colormap(gca,blue2RedCmap)