www.gusucode.com > 声音的处理有:LPC,FFT,共振峰,频谱源码程序 > siganlandsystemusingMatlab/SSUM/filters/image/imgfilterexpogui.m
function varargout = imgfilterexpogui(varargin) % IMGFILTEREXPOGUI M-file for imgfilterexpogui.fig % IMGFILTEREXPOGUI, by itself, creates a new IMGFILTEREXPOGUI or raises the existing % singleton*. % % H = IMGFILTEREXPOGUI returns the handle to a new IMGFILTEREXPOGUI or the handle to % the existing singleton*. % % IMGFILTEREXPOGUI('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in IMGFILTEREXPOGUI.M with the given input arguments. % % IMGFILTEREXPOGUI('Property','Value',...) creates a new IMGFILTEREXPOGUI or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before imgfilterexpogui_OpeningFunction gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to imgfilterexpogui_OpeningFcn via varargin. % % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one % instance to run (singleton)". % % See also: GUIDE, GUIDATA, GUIHANDLES % Edit the above text to modify the response to help imgfilterexpogui % Last Modified by GUIDE v2.5 14-Aug-2004 13:24:16 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @imgfilterexpogui_OpeningFcn, ... 'gui_OutputFcn', @imgfilterexpogui_OutputFcn, ... 'gui_LayoutFcn', @imgfilterexpogui_LayoutFcn, ... 'gui_Callback', []); if nargin & isstr(varargin{1}) gui_State.gui_Callback = str2func(varargin{1}); end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); else gui_mainfcn(gui_State, varargin{:}); end % End initialization code - DO NOT EDIT % --- Executes just before imgfilterexpogui is made visible. function imgfilterexpogui_OpeningFcn(hObject, eventdata, handles, varargin) handles.output = hObject; guidata(hObject, handles); set(gcf,'UserData',handles); imgfilterexpofn; if (nargin > 3) datastruct = varargin{1}; imgfilterexpofn('readinput',datastruct); end % --- Outputs from this function are returned to the command line. function varargout = imgfilterexpogui_OutputFcn(hObject, eventdata, handles) varargout{1} = handles.output; % -------------------------------------------------------------------- function FileMenu_Callback(hObject, eventdata, handles) % -------------------------------------------------------------------- function OpenMenuItem_Callback(hObject, eventdata, handles) imgfilterexpofn 'load'; % -------------------------------------------------------------------- function PrintMenuItem_Callback(hObject, eventdata, handles) imgfilterexpofn 'print'; % -------------------------------------------------------------------- function CloseMenuItem_Callback(hObject, eventdata, handles) imgfilterexpofn 'close'; % --- Executes on button press in inverse. function inverse_Callback(hObject, eventdata, handles) imgfilterexpofn 'inverse'; % --- Executes on button press in print. function print_Callback(hObject, eventdata, handles) imgfilterexpofn 'print'; % --- Executes during object creation, after setting all properties. function filtermenu_CreateFcn(hObject, eventdata, handles) % hObject handle to filtermenu (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: popupmenu controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end % --- Executes on selection change in filtermenu. function filtermenu_Callback(hObject, eventdata, handles) contents = get(hObject,'String'); switch (lower(contents{get(hObject,'Value')})) case {'gaussian','del gaussian','laplacian'} set(handles.filtertag,'Visible','on'); set(handles.filterval,'Visible','on'); otherwise set(handles.filtertag,'Visible','off'); set(handles.filterval,'Visible','off'); end % --- Executes during object creation, after setting all properties. function kernel_size_CreateFcn(hObject, eventdata, handles) if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function kernel_size_Callback(hObject, eventdata, handles) % Check for odd int > 1 val = str2double(get(hObject,'String')); if val < 3, % is less than 3 val = 3; elseif rem(val,2) == 0, % is even val = val + 1; elseif rem(val,1) ~= 0, % not an integer val = round(val); if rem(val,2) == 0, val = val + 1; end if val < 3, val = 3; end end set(hObject,'String',num2str(val)); % --- Executes on button press in doFilter. function doFilter_Callback(hObject, eventdata, handles) imgfilterexpofn 'apply_filter'; % --- Executes on button press in undo. function undo_Callback(hObject, eventdata, handles) imgfilterexpofn 'undo_filter'; % --- Executes on button press in scale. function scale_Callback(hObject, eventdata, handles) imgfilterexpofn 'scale'; % --- Executes on button press in zoomreset. function zoomreset_Callback(hObject, eventdata, handles) imgfilterexpofn 'zoom_reset'; % --- Executes during object creation, after setting all properties. function filtertag_CreateFcn(hObject, eventdata, handles) % hObject handle to filtertag (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function filtertag_Callback(hObject, eventdata, handles) % --- Executes during object creation, after setting all properties. function filterval_CreateFcn(hObject, eventdata, handles) % hObject handle to filterval (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function filterval_Callback(hObject, eventdata, handles) contents = get(handles.filtermenu,'String'); switch (lower(contents{get(handles.filtermenu,'Value')})) case 'gaussian' val = str2double(get(hObject,'String')); val = abs(val); otherwise end set(hObject,'String',num2str(val)); % --- Executes during object creation, after setting all properties. function noisemenu_CreateFcn(hObject, eventdata, handles) % hObject handle to noisemenu (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: popupmenu controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end % --- Executes on selection change in noisemenu. function noisemenu_Callback(hObject, eventdata, handles) contents = get(hObject,'String'); switch (lower(contents{get(hObject,'Value')})) case 'gaussian' set(handles.noisetag,'String','Variance'); case 'salt and pepper' set(handles.noisetag,'String','Incidence'); end % --- Executes on button press in noiseapply. function noiseapply_Callback(hObject, eventdata, handles) imgfilterexpofn 'apply_noise'; % -------------------------------------------------------------------- function save_Callback(hObject, eventdata, handles) imgfilterexpofn 'save'; % --- Executes during object creation, after setting all properties. function noisetag_CreateFcn(hObject, eventdata, handles) % hObject handle to filtertag (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function noisetag_Callback(hObject, eventdata, handles) % --- Executes during object creation, after setting all properties. function noiseval_CreateFcn(hObject, eventdata, handles) % hObject handle to filterval (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end function noiseval_Callback(hObject, eventdata, handles) contents = get(handles.noisemenu,'String'); switch (lower(contents{get(handles.noisemenu,'Value')})) case 'gaussian' val = str2double(get(hObject,'String')); val = abs(val); otherwise val = str2double(get(hObject,'String')); end set(hObject,'String',num2str(val)); % --- Executes on button press in undo2. function undo2_Callback(hObject, eventdata, handles) imgfilterexpofn 'undo_noise'; % --- Executes on button press in horizontal. function horizontal_Callback(hObject, eventdata, handles) set(handles.vertical,'Value',0); set(handles.kernel,'Value',0); % --- Executes on button press in vertical. function vertical_Callback(hObject, eventdata, handles) set(handles.horizontal,'Value',0); set(handles.kernel,'Value',0); % --- Executes on button press in kernel. function kernel_Callback(hObject, eventdata, handles) set(handles.horizontal,'Value',0); set(handles.vertical,'Value',0); % --- Executes during object creation, after setting all properties. function colormap_CreateFcn(hObject, eventdata, handles) % hObject handle to colormap (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: popupmenu controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end % --- Executes on selection change in colormap. function colormap_Callback(hObject, eventdata, handles) % hObject handle to colormap (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = get(hObject,'String') returns colormap contents as cell array % contents{get(hObject,'Value')} returns selected item from colormap imgfilterexpofn 'colormap'; % --- Executes on button press in checkbox5. function checkbox5_Callback(hObject, eventdata, handles) % hObject handle to checkbox5 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hint: get(hObject,'Value') returns toggle state of checkbox5 % --- Executes on button press in inversecolor. function inversecolor_Callback(hObject, eventdata, handles) % hObject handle to inversecolor (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hint: get(hObject,'Value') returns toggle state of inversecolor imgfilterexpofn 'inversecolor'; % --- Executes on button press in plot. function plot_Callback(hObject, eventdata, handles) % hObject handle to plot (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) imgfilterexpofn 'plot'; % -------------------------------------------------------------------- function help_Callback(hObject, eventdata, handles) % hObject handle to help (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) imgfilterexpofn 'help'; % -------------------------------------------------------------------- function Untitled_1_Callback(hObject, eventdata, handles) % hObject handle to Untitled_1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % -------------------------------------------------------------------- function imgaliasexpo_Callback(hObject, eventdata, handles) % hObject handle to imgaliasexpo (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) imgfilterexpofn 'imgaliasexpo'; % -------------------------------------------------------------------- function imgspecexpo_Callback(hObject, eventdata, handles) % hObject handle to imgspecexpo (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) imgfilterexpofn 'imgspecexpo'; % --- Creates and returns a handle to the GUI figure. function h1 = imgfilterexpogui_LayoutFcn(policy) % policy - create a new figure or use a singleton. 'new' or 'reuse'. persistent hsingleton; if strcmpi(policy, 'reuse') & ishandle(hsingleton) h1 = hsingleton; return; end h1 = figure(... 'Units','characters',... 'Color',[0.925490196078431 0.913725490196078 0.847058823529412],... 'Colormap',[0 0 0.5625;0 0 0.625;0 0 0.6875;0 0 0.75;0 0 0.8125;0 0 0.875;0 0 0.9375;0 0 1;0 0.0625 1;0 0.125 1;0 0.1875 1;0 0.25 1;0 0.3125 1;0 0.375 1;0 0.4375 1;0 0.5 1;0 0.5625 1;0 0.625 1;0 0.6875 1;0 0.75 1;0 0.8125 1;0 0.875 1;0 0.9375 1;0 1 1;0.0625 1 1;0.125 1 0.9375;0.1875 1 0.875;0.25 1 0.8125;0.3125 1 0.75;0.375 1 0.6875;0.4375 1 0.625;0.5 1 0.5625;0.5625 1 0.5;0.625 1 0.4375;0.6875 1 0.375;0.75 1 0.3125;0.8125 1 0.25;0.875 1 0.1875;0.9375 1 0.125;1 1 0.0625;1 1 0;1 0.9375 0;1 0.875 0;1 0.8125 0;1 0.75 0;1 0.6875 0;1 0.625 0;1 0.5625 0;1 0.5 0;1 0.4375 0;1 0.375 0;1 0.3125 0;1 0.25 0;1 0.1875 0;1 0.125 0;1 0.0625 0;1 0 0;0.9375 0 0;0.875 0 0;0.8125 0 0;0.75 0 0;0.6875 0 0;0.625 0 0;0.5625 0 0],... 'IntegerHandle','off',... 'InvertHardcopy',get(0,'defaultfigureInvertHardcopy'),... 'MenuBar','none',... 'Name','imgfilterexpo',... 'NumberTitle','off',... 'PaperOrientation','landscape',... 'PaperPosition',get(0,'defaultfigurePaperPosition'),... 'PaperSize',[11 8.5],... 'Pointer','crosshair',... 'Position',[128.6 -0.0769230769230769 89.8 54.3846153846154],... 'Renderer',get(0,'defaultfigureRenderer'),... 'RendererMode','manual',... 'Resize','off',... 'HandleVisibility','callback',... 'Tag','imgfilterexpo_fig',... 'UserData',zeros(1,0)); setappdata(h1, 'GUIDEOptions', struct(... 'active_h', [], ... 'taginfo', struct(... 'figure', 2, ... 'axes', 7, ... 'pushbutton', 16, ... 'popupmenu', 10, ... 'listbox', 2, ... 'text', 19, ... 'slider', 2, ... 'checkbox', 6, ... 'radiobutton', 8, ... 'frame', 3, ... 'edit', 8), ... 'override', 1, ... 'release', 13, ... 'resize', 'simple', ... 'accessibility', 'callback', ... 'mfile', 1, ... 'callbacks', 1, ... 'singleton', 1, ... 'syscolorfig', 1, ... 'lastSavedFile', 'C:\Documents and Settings\Bob\Desktop\SSUM_WIN\filters\image\imgfilterexpo.m', ... 'blocking', 0)); h2 = uimenu(... 'Parent',h1,... 'Callback','imgfilterexpogui(''FileMenu_Callback'',gcbo,[],guidata(gcbo))',... 'Label','File',... 'Tag','FileMenu'); h3 = uimenu(... 'Parent',h2,... 'Callback','imgfilterexpogui(''OpenMenuItem_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Open Image',... 'Tag','open'); h4 = uimenu(... 'Parent',h2,... 'Callback','imgfilterexpogui(''save_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Save Image',... 'Tag','save'); h5 = uimenu(... 'Parent',h2,... 'Callback','imgfilterexpogui(''print_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Print',... 'Tag','print'); h6 = uimenu(... 'Parent',h2,... 'Callback','imgfilterexpogui(''CloseMenuItem_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Close',... 'Separator','on',... 'Tag','CloseMenuItem'); h7 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','imgfilterexpogui(''inverse_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[41.4 3.30769230769231 12 1.46153846153846],... 'String','Inverse',... 'Style','checkbox',... 'Tag','inverse'); h8 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'ListboxTop',0,... 'Position',[3 0.230769230769231 35.6 17],... 'String',{ '' },... 'Style','frame',... 'Tag','frame1'); h9 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'BackgroundColor',[1 1 1],... 'Callback','imgfilterexpogui(''filtermenu_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[4.6 11.1538461538462 17 1.46153846153846],... 'String',{ 'Average' 'Median' 'Gaussian' 'del Gaussian' 'Laplacian' },... 'Style','popupmenu',... 'Value',1,... 'CreateFcn','imgfilterexpogui(''filtermenu_CreateFcn'',gcbo,[],guidata(gcbo))',... 'Tag','filtermenu'); h10 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'FontSize',12,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[4.6 12.6923076923077 17 1.76923076923077],... 'String','Type',... 'Style','text',... 'Tag','text10'); h11 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'BackgroundColor',[1 1 1],... 'Callback','imgfilterexpogui(''kernel_size_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[26.2 11.1538461538462 10.6 1.46153846153846],... 'String','3',... 'Style','edit',... 'CreateFcn','imgfilterexpogui(''kernel_size_CreateFcn'',gcbo,[],guidata(gcbo))',... 'Tag','kernel_size'); h12 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'FontSize',12,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[26.2 12.9230769230769 8 1.53846153846154],... 'String','Size',... 'Style','text',... 'Tag','text11'); h13 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','imgfilterexpogui(''doFilter_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[16.2 6.15384615384615 9 1.46153846153846],... 'String','Apply',... 'Tag','doFilter'); h14 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','imgfilterexpogui(''undo_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[27.8 6.15384615384615 9 1.46153846153846],... 'String','Undo',... 'Tag','undo'); h15 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','imgfilterexpogui(''scale_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[55.8 3.30769230769231 12 1.46153846153846],... 'String','Scale',... 'Style','checkbox',... 'Value',1,... 'Tag','scale'); h16 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','imgfilterexpogui(''zoomreset_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[67.8 3.30769230769231 13 1.46153846153846],... 'String','Zoom Reset',... 'Tag','zoomreset'); h17 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'BackgroundColor',[1 1 1],... 'Callback','imgfilterexpogui(''filtertag_Callback'',gcbo,[],guidata(gcbo))',... 'Enable','inactive',... 'HorizontalAlignment','right',... 'ListboxTop',0,... 'Position',[4.6 8.76923076923077 10.6 1.46153846153846],... 'String','Variance',... 'Style','edit',... 'CreateFcn','imgfilterexpogui(''filtertag_CreateFcn'',gcbo,[],guidata(gcbo))',... 'Tag','filtertag'); h18 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'BackgroundColor',[1 1 1],... 'Callback','imgfilterexpogui(''filterval_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[17.6 8.76923076923077 10.6 1.46153846153846],... 'String','0.5',... 'Style','edit',... 'CreateFcn','imgfilterexpogui(''filterval_CreateFcn'',gcbo,[],guidata(gcbo))',... 'Tag','filterval'); h19 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'ListboxTop',0,... 'Position',[40.6 5.23076923076923 25 12],... 'String',{ '' },... 'Style','frame',... 'Tag','frame2'); h20 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'BackgroundColor',[1 1 1],... 'Callback','imgfilterexpogui(''noisemenu_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[42.6 11.1538461538462 20 1.46153846153846],... 'String',{ 'Salt and Pepper' 'Gaussian' },... 'Style','popupmenu',... 'Value',1,... 'CreateFcn','imgfilterexpogui(''noisemenu_CreateFcn'',gcbo,[],guidata(gcbo))',... 'Tag','noisemenu'); h21 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'FontSize',12,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[42.6 15.1538461538462 17 1.76923076923077],... 'String','Add Noise',... 'Style','text',... 'Tag','text13'); h22 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','imgfilterexpogui(''noiseapply_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[42.6 6.15384615384615 9 1.46153846153846],... 'String','Apply',... 'Tag','noiseapply'); h23 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'BackgroundColor',[1 1 1],... 'Callback','imgfilterexpogui(''noisetag_Callback'',gcbo,[],guidata(gcbo))',... 'Enable','inactive',... 'HorizontalAlignment','right',... 'ListboxTop',0,... 'Position',[42.6 8.76923076923077 10.6 1.46153846153846],... 'String','Incidence',... 'Style','edit',... 'CreateFcn','imgfilterexpogui(''noisetag_CreateFcn'',gcbo,[],guidata(gcbo))',... 'Tag','noisetag'); h24 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'BackgroundColor',[1 1 1],... 'Callback','imgfilterexpogui(''noiseval_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[54.6 8.76923076923077 8 1.46153846153846],... 'String','0.1',... 'Style','edit',... 'CreateFcn','imgfilterexpogui(''noiseval_CreateFcn'',gcbo,[],guidata(gcbo))',... 'Tag','noiseval'); h25 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','imgfilterexpogui(''undo2_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[53.4 6.15384615384615 9 1.46153846153846],... 'String','Undo',... 'Tag','undo2'); h26 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','imgfilterexpogui(''horizontal_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[23 4.15384615384615 14 1.46153846153846],... 'String','Horizontal',... 'Style','radiobutton',... 'Tag','horizontal'); h27 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','imgfilterexpogui(''vertical_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[23 2.46153846153846 14 1.46153846153846],... 'String','Vertical',... 'Style','radiobutton',... 'Tag','vertical'); h28 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','imgfilterexpogui(''kernel_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[23 0.846153846153846 14 1.46153846153846],... 'String','Kernel',... 'Style','radiobutton',... 'Value',1,... 'Tag','kernel'); h29 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'FontSize',12,... 'ListboxTop',0,... 'Position',[4.6 2.15384615384615 17 1.84615384615385],... 'String','Application',... 'Style','text',... 'Tag','text14'); h30 = axes(... 'Parent',h1,... 'Units','characters',... 'CameraPosition',[0.5 0.5 9.16025403784439],... 'CameraPositionMode',get(0,'defaultaxesCameraPositionMode'),... 'Color',get(0,'defaultaxesColor'),... 'ColorOrder',get(0,'defaultaxesColorOrder'),... 'Position',[6.6 22.0769230769231 81 30],... 'XColor',get(0,'defaultaxesXColor'),... 'YColor',get(0,'defaultaxesYColor'),... 'ZColor',get(0,'defaultaxesZColor'),... 'Tag','spectrum'); h31 = get(h30,'title'); set(h31,... 'Parent',h30,... 'Color',[0 0 0],... 'HorizontalAlignment','center',... 'Position',[0.5 1.01666666666667 1.00005459937205],... 'VerticalAlignment','bottom',... 'HandleVisibility','off'); h32 = get(h30,'xlabel'); set(h32,... 'Parent',h30,... 'Color',[0 0 0],... 'HorizontalAlignment','center',... 'Position',[0.497530864197531 -0.0602564102564103 1.00005459937205],... 'VerticalAlignment','cap',... 'HandleVisibility','off'); h33 = get(h30,'ylabel'); set(h33,... 'Parent',h30,... 'Color',[0 0 0],... 'HorizontalAlignment','center',... 'Position',[-0.0703703703703704 0.496153846153846 1.00005459937205],... 'Rotation',90,... 'VerticalAlignment','bottom',... 'HandleVisibility','off'); h34 = get(h30,'zlabel'); set(h34,... 'Parent',h30,... 'Color',[0 0 0],... 'HorizontalAlignment','right',... 'Position',[-0.0851851851851852 1.07051282051282 1.00005459937205],... 'HandleVisibility','off',... 'Visible','off'); h35 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'FontSize',12,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[6.6 18.9230769230769 14.6 1.69230769230769],... 'String','Colormap',... 'Style','text',... 'Tag','text15'); h36 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'BackgroundColor',[1 1 1],... 'Callback','imgfilterexpogui(''colormap_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[22 19 13.8 1.46153846153846],... 'String',{ 'Jet' 'Bone' 'HSV' 'Gray' 'Hot' 'Cool' 'Prism' },... 'Style','popupmenu',... 'Value',1,... 'CreateFcn','imgfilterexpogui(''colormap_CreateFcn'',gcbo,[],guidata(gcbo))',... 'Tag','colormap'); h37 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','imgfilterexpogui(''inversecolor_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[38.6 19 12 1.46153846153846],... 'String','Inverse',... 'Style','checkbox',... 'Tag','inversecolor'); h38 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'FontSize',12,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[21.2 52.1538461538462 57 1.61538461538462],... 'String','Two-Dimenesional Fourier Transform',... 'Style','text',... 'Tag','text16'); h39 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'FontSize',12,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[4.6 15.3846153846154 17 1.53846153846154],... 'String','Apply Filter',... 'Style','text',... 'Tag','text17'); h40 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'Callback','imgfilterexpogui(''plot_Callback'',gcbo,[],guidata(gcbo))',... 'ListboxTop',0,... 'Position',[4.6 6.15384615384615 9 1.46153846153846],... 'String','Plot',... 'Tag','plot'); h41 = uicontrol(... 'Parent',h1,... 'Units','characters',... 'FontSize',12,... 'HorizontalAlignment','left',... 'ListboxTop',0,... 'Position',[42.6 12.6923076923077 17 1.76923076923077],... 'String','Type',... 'Style','text',... 'Tag','text18'); h42 = uimenu(... 'Parent',h1,... 'Callback','imgfilterexpogui(''Untitled_1_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Send to...',... 'Tag','Untitled_1'); h43 = uimenu(... 'Parent',h42,... 'Callback','imgfilterexpogui(''imgaliasexpo_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Image Aliasing Explorer',... 'Tag','imgaliasexpo'); h44 = uimenu(... 'Parent',h42,... 'Callback','imgfilterexpogui(''imgspecexpo_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Image Spectrum Explorer',... 'Tag','imgspecexpo'); h45 = uimenu(... 'Parent',h1,... 'Callback','imgfilterexpogui(''help_Callback'',gcbo,[],guidata(gcbo))',... 'Label','Help',... 'Tag','help'); hsingleton = h1; % --- Handles default GUIDE GUI creation and callback dispatch function varargout = gui_mainfcn(gui_State, varargin) % GUI_MAINFCN provides these command line APIs for dealing with GUIs % % IMGFILTEREXPOGUI, by itself, creates a new IMGFILTEREXPOGUI or raises the existing % singleton*. % % H = IMGFILTEREXPOGUI returns the handle to a new IMGFILTEREXPOGUI or the handle to % the existing singleton*. % % IMGFILTEREXPOGUI('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in IMGFILTEREXPOGUI.M with the given input arguments. % % IMGFILTEREXPOGUI('Property','Value',...) creates a new IMGFILTEREXPOGUI or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before untitled_OpeningFunction gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to untitled_OpeningFcn via varargin. % % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one % instance to run (singleton)". % Copyright 1984-2002 The MathWorks, Inc. % $Revision: 1.4 $ $Date: 2002/05/31 21:44:31 $ gui_StateFields = {'gui_Name' 'gui_Singleton' 'gui_OpeningFcn' 'gui_OutputFcn' 'gui_LayoutFcn' 'gui_Callback'}; gui_Mfile = ''; for i=1:length(gui_StateFields) if ~isfield(gui_State, gui_StateFields{i}) error('Could not find field %s in the gui_State struct in GUI M-file %s', gui_StateFields{i}, gui_Mfile); elseif isequal(gui_StateFields{i}, 'gui_Name') gui_Mfile = [getfield(gui_State, gui_StateFields{i}), '.m']; end end numargin = length(varargin); if numargin == 0 % IMGFILTEREXPOGUI % create the GUI gui_Create = 1; elseif numargin > 3 & ischar(varargin{1}) & ishandle(varargin{2}) % IMGFILTEREXPOGUI('CALLBACK',hObject,eventData,handles,...) gui_Create = 0; else % IMGFILTEREXPOGUI(...) % create the GUI and hand varargin to the openingfcn gui_Create = 1; end if gui_Create == 0 varargin{1} = gui_State.gui_Callback; if nargout [varargout{1:nargout}] = feval(varargin{:}); else feval(varargin{:}); end else if gui_State.gui_Singleton gui_SingletonOpt = 'reuse'; else gui_SingletonOpt = 'new'; end % Open fig file with stored settings. Note: This executes all component % specific CreateFunctions with an empty HANDLES structure. % Do feval on layout code in m-file if it exists if ~isempty(gui_State.gui_LayoutFcn) gui_hFigure = feval(gui_State.gui_LayoutFcn, gui_SingletonOpt); else gui_hFigure = local_openfig(gui_State.gui_Name, gui_SingletonOpt); % If the figure has InGUIInitialization it was not completely created % on the last pass. Delete this handle and try again. if isappdata(gui_hFigure, 'InGUIInitialization') delete(gui_hFigure); gui_hFigure = local_openfig(gui_State.gui_Name, gui_SingletonOpt); end end % Set flag to indicate starting GUI initialization setappdata(gui_hFigure,'InGUIInitialization',1); % Fetch GUIDE Application options gui_Options = getappdata(gui_hFigure,'GUIDEOptions'); if ~isappdata(gui_hFigure,'GUIOnScreen') % Adjust background color if gui_Options.syscolorfig set(gui_hFigure,'Color', get(0,'DefaultUicontrolBackgroundColor')); end % Generate HANDLES structure and store with GUIDATA guidata(gui_hFigure, guihandles(gui_hFigure)); end % If user specified 'Visible','off' in p/v pairs, don't make the figure % visible. gui_MakeVisible = 1; for ind=1:2:length(varargin) if length(varargin) == ind break; end len1 = min(length('visible'),length(varargin{ind})); len2 = min(length('off'),length(varargin{ind+1})); if ischar(varargin{ind}) & ischar(varargin{ind+1}) & ... strncmpi(varargin{ind},'visible',len1) & len2 > 1 if strncmpi(varargin{ind+1},'off',len2) gui_MakeVisible = 0; elseif strncmpi(varargin{ind+1},'on',len2) gui_MakeVisible = 1; end end end % Check for figure param value pairs for index=1:2:length(varargin) if length(varargin) == index break; end try, set(gui_hFigure, varargin{index}, varargin{index+1}), catch, break, end end % If handle visibility is set to 'callback', turn it on until finished % with OpeningFcn gui_HandleVisibility = get(gui_hFigure,'HandleVisibility'); if strcmp(gui_HandleVisibility, 'callback') set(gui_hFigure,'HandleVisibility', 'on'); end feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:}); if ishandle(gui_hFigure) % Update handle visibility set(gui_hFigure,'HandleVisibility', gui_HandleVisibility); % Make figure visible if gui_MakeVisible set(gui_hFigure, 'Visible', 'on') if gui_Options.singleton setappdata(gui_hFigure,'GUIOnScreen', 1); end end % Done with GUI initialization rmappdata(gui_hFigure,'InGUIInitialization'); end % If handle visibility is set to 'callback', turn it on until finished with % OutputFcn if ishandle(gui_hFigure) gui_HandleVisibility = get(gui_hFigure,'HandleVisibility'); if strcmp(gui_HandleVisibility, 'callback') set(gui_hFigure,'HandleVisibility', 'on'); end gui_Handles = guidata(gui_hFigure); else gui_Handles = []; end if nargout [varargout{1:nargout}] = feval(gui_State.gui_OutputFcn, gui_hFigure, [], gui_Handles); else feval(gui_State.gui_OutputFcn, gui_hFigure, [], gui_Handles); end if ishandle(gui_hFigure) set(gui_hFigure,'HandleVisibility', gui_HandleVisibility); end end function gui_hFigure = local_openfig(name, singleton) if nargin('openfig') == 3 gui_hFigure = openfig(name, singleton, 'auto'); else % OPENFIG did not accept 3rd input argument until R13, % toggle default figure visible to prevent the figure % from showing up too soon. gui_OldDefaultVisible = get(0,'defaultFigureVisible'); set(0,'defaultFigureVisible','off'); gui_hFigure = openfig(name, singleton); set(0,'defaultFigureVisible',gui_OldDefaultVisible); end