function M = roirect() [x y] = ginput(2); s = size(currentImage); M(1:s(1),1:s(2)) = 0; x = fix(sort(x)); y = fix(sort(y)); M( y(1):y(2), x(1):x(2) ) = 1; M = logical(M);