function [HC,xc,yc,r,peak] = hough_circle_get_peak(HC,xcDelta,ycDelta,rDelta)

pos=find(HC.stack==max(HC.stack(:)));
[nyc,nxc,nr]=ind2sub(size(HC.stack),pos(1));
xc=HC.xc(nxc);
yc=HC.yc(nyc);
r=HC.r(nr);
peak=HC.stack(nyc,nxc,nr);
[nxc1,nxc2]=range(nxc,ceil(xcDelta/HC.xcDelta/2),1,size(HC.stack,2));
[nyc1,nyc2]=range(nyc,ceil(ycDelta/HC.ycDelta/2),1,size(HC.stack,1));
[nr1,nr2]=range(nr,ceil(rDelta/HC.rDelta/2),1,size(HC.stack,3));
HC.stack(nyc1:nyc2,nxc1:nxc2,nr1:nr2)=0;
end


function [x1,x2]=range(x,dx,xmin,xmax)

x1=max(xmin,fix(x-dx));
x2=min(xmax,fix(x+dx));
end

