load head2.mat

rand('state',sum(100*clock));

% Create noise to add to images
buffer=max(max(head2))/20;

[image1Complex,image1Mag] = MakeComplexImage(head2,buffer,256);
[image2Complex,image2Mag] = MakeComplexImage(head2,buffer,256);
[image3Complex,image3Mag] = MakeComplexImage(head2,buffer,256);
[image4Complex,image4Mag] = MakeComplexImage(head2,buffer,256);

[CorrFilt1,WienerFilt1] = FilterImages(image1Complex,image2Complex);
[CorrFilt2,WienerFilt2] = FilterImages(image3Complex,image4Complex);

snrOrig = CalcSNR(image1Mag,image2Mag)
CNRorig = CNR(image1Mag,image2Mag)
snrCorr = CalcSNR(CorrFilt1,CorrFilt2)
CNRcorr = CNR(CorrFilt1,CorrFilt2)
snrWiener = CalcSNR(WienerFilt1,WienerFilt2)
CNRwiener = CNR(WienerFilt1,WienerFilt2)

[MedFilt1,GaussFilt1,ContFilt1,AveFilt1] = ExtraImageFilters((image1Mag+image2Mag)/2);
[MedFilt2,GaussFilt2,ContFilt2,AveFilt2] = ExtraImageFilters((image3Mag+image4Mag)/2);

snrMed = CalcSNR(MedFilt1,MedFilt2)
CNRmed = CNR(MedFilt1,MedFilt2)
snrGauss = CalcSNR(GaussFilt1,GaussFilt2)
CNRgauss = CNR(GaussFilt1,GaussFilt2)
snrContrast = CalcSNR(ContFilt1,ContFilt2)
CNRcontrast = CNR(ContFilt1,ContFilt2)
snrAve = CalcSNR(AveFilt1,AveFilt2)
CNRave = CNR(AveFilt1,AveFilt2)
