1. %% PSR calcualtion
peak=max(max(y1));
[h1,h2]=find(y1==peak);
[a,b]=size(y1);
if h1>10 && h2>10 && h1<a-10 && h2<b-10
y1((h1-2):(h1+2),(h2-2):(h2+2))=0;
mask=y1(h1-10:h1+10,h2-10:h2+10);
[a1,b1]=size(mask);
end
c=1;
for i=1:a1
for j=1:b1
if mask(i,j)==0
else
newmask(c,:)=mask(i,j);
c=c+1;
end
end
end
mn=mean(newmask);
sd=std(newmask);
psr=(peak-mn)/sd