Here are some lines of my code, so as to make it clear
% --- Executes on button press in levelset.
function levelset_Callback(hObject, eventdata, handles)global img_grayglobal Imgglobal im3global img
im3=img;
I=img_gray; figure; imshow(I)
title('Select the region of interest from the whole image')
rect = getrect(gcf);
Img = I(rect(2):rect(2)+rect(4),rect(1):rect(1)+rect(3)); %GIVES WARNING
Img=double(Img);
figure(1);
imshow(uint8(Img));
[nx,ny]=size(Img);
ic=floor(nx/2);
jc=floor(ny/2);
r=ic/3;
Best Answer