%DIPFIG_CLEAR_STATE(FIG,UDATA)
%    Disables all callbacks for the image in FIG, and updates UDATA.

% (C) Copyright 1999-2001               Pattern Recognition Group
%     All rights reserved               Faculty of Applied Physics
%                                       Delft University of Technology
%                                       Lorentzweg 1
%                                       2628 CJ Delft
%                                       The Netherlands
%
% Cris Luengo, July 2000.
% 16-26 August 2001: Changed DIPSHOW. This function changes accordingly.

function dipfig_clear_state(fig,udata)
udata.state = 'none';

if isfield(udata,'orientationim')
   udata = rmfield(udata,'orientationim');
end
set(fig,'pointer','arrow',...
        'WindowButtonDownFcn','',...
        'WindowButtonUpFcn','',...
        'WindowButtonMotionFcn','',...
        'ButtonDownFcn','',...
        'UserData',[]);   % Solve MATLAB bug!
set(fig,'UserData',udata);
dipfig_set_action_check(fig,udata.state);
