function getMousePositionOnImage(src, event)
handles = guidata(src);
cursorPoint = get(handles.axes1, 'CurrentPoint');
curX = cursorPoint(1,1);
curY = cursorPoint(1,2);
xLimits = get(handles.axes1, 'xlim');
yLimits = get(handles.axes1, 'ylim');
if (curX<min(xLimits)) (curX==min(xLimits))
end
if (curX>max(xLimits)) (curX==max(xLimits))
end
if (curY<min(yLimits)) (curY==min(yLimits))
end
if (curY>max(yLimits)) (curY==max(yLimits))
end
x=round(curX)
y=round(curY)
setappdata(0,'curX',x);
setappdata(0,'curY',y);
delete( findobj(gca, 'type', 'line') );
hold on
plot(x,y,'ro','MarkerSize',10,'LineWidth',2)
hold off;
IMG = getimage(handles.axes1);
delta=50;
if (x<delta+1)|| (y<delta+1)
ROI = IMG(1:delta, 1:delta,:);
else
ROI = IMG(y-delta:y+delta, x-delta:x+delta,:);
end
axes(handles.axes3)
cla
[high,low]=Autoscaleimage(handles,ROI,3);
imshow(ROI,[low,high]);
hold on
plot(delta+1,delta+1,'ro','MarkerSize',10,'LineWidth',2);
hold off