% End initialization code - DO NOT EDIT
% --- Executes just before myproject is made visible.
function myproject_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to myproject (see VARARGIN)
% Choose default command line output for myproject
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes myproject wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = myproject_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
%以下为另存为按钮的回调函数,功能为存储图像处理后的图像到用户选择的磁盘空间中。
% --- Executes on button press in lingcunwei.
function lingcunwei_Callback(hObject, eventdata, handles) %另存为按钮的回调函数
global ImagenUmbral %定义全局变量
if isempty(ImagenUmbral)==1,msgbox('Doesn''t exist an image');return,
end %如果 ImagenUmbral 不包含图像,则弹出对话框并显示'Doesn''t exist an image'
[filename,pathname]=uiputfile({'*.jpg';,'*.tif';,'*.gif';,'*.bmp';,'*.png';, ...
'*.hdf';,'*.pcx';,'*.xwd';,'*.ico';,'*.cur';,'*.ras';, ...
'*.pdm';,'*.pgm';,'*.ppm'},'Save file name'); %显示保存文件的对话框
if isequal(filename,0) | isequal(pathname,0)
errordlg('Saving canceled','Threshold GUI'); error('Saving canceled')
else %如果不存在该文件,或者不存在保存路径,则显示错误信息
评论0
最新资源