www.pudn.com > 1111111registrationbasedoncorrelation.rar > proj.m


function varargout = proj(varargin) 
% PROJ M-file for proj.fig 
%      PROJ, by itself, creates a new PROJ or raises the existing 
%      singleton*. 
% 
%      H = PROJ returns the handle to a new PROJ or the handle to 
%      the existing singleton*. 
% 
%      PROJ('CALLBACK',hObject,eventData,handles,...) calls the local 
%      function named CALLBACK in PROJ.M with the given input arguments. 
% 
%      PROJ('Property','Value',...) creates a new PROJ or raises the 
%      existing singleton*.  Starting from the left, property value pairs are 
%      applied to the GUI before proj_OpeningFunction gets called.  An 
%      unrecognized property name or invalid value makes property application 
%      stop.  All inputs are passed to proj_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 proj 
 
% Last Modified by GUIDE v2.5 21-Sep-2005 21:51:00
 
% Begin initialization code - DO NOT EDIT 
gui_Singleton = 1; 
gui_State = struct('gui_Name',       mfilename, ... 
                   'gui_Singleton',  gui_Singleton, ... 
                   'gui_OpeningFcn', @proj_OpeningFcn, ... 
                   'gui_OutputFcn',  @proj_OutputFcn, ... 
                   'gui_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 
addpath(pwd) 
 
% --- Executes just before proj is made visible. 
function proj_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 proj (see VARARGIN) 
 
% Choose default command line output for proj 
 
% 初始化界面 
handles.output = hObject; 
handles.OAname='PSO'; 
handles.MIname='MI'; 
handles.NumOfVar=0; 
set(handles.edit1,'visible','off'); 
set(handles.edit2,'visible','off'); 
set(handles.text3,'visible','off'); 
set(handles.text4,'visible','off'); 
% set(handles.axes1,'','off'); 
% axes(handles.axes1) 
% I1=0; 
% imshow(I1) 
% axes(handles.axes2) 
% I2=0; 
% imshow(I2) 
% axes(handles.axes3) 
% I3=0; 
% imshow(I3) 
 
guidata(hObject, handles); 
 
% UIWAIT makes proj wait for user response (see UIRESUME) 
% uiwait(handles.figure1); 
 
 
% --- Outputs from this function are returned to the command line. 
function varargout = proj_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 during object creation, after setting all properties.
function popupmenu1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu1 (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 popupmenu1.
function popupmenu1_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA) 
 
% 最优化算法选择"PSO"和"POWELL"
popupmenu1string=get(handles.popupmenu1,'string'); 
popupmenu1value=get(handles.popupmenu1,'value'); 
popupmenu1context=get(handles.popupmenu1,{'value','string'}); 
vvv1=deblank(popupmenu1context{2}(popupmenu1context{1})); 
handles.OAname=vvv1{1}; 
 
guidata(hObject,handles);
% Hints: contents = get(hObject,'String') returns popupmenu1 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu1


% --- Executes during object creation, after setting all properties.
function popupmenu2_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu2 (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 popupmenu2.
function popupmenu2_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA) 
 
% 选择互信息尺度函数(MI)
popupmenu2string=get(handles.popupmenu2,'string'); 
popupmenu2value=get(handles.popupmenu2,'value'); 
popupmenu2context=get(handles.popupmenu2,{'value','string'}); 
vvv2=deblank(popupmenu2context{2}(popupmenu2context{1})); 
 
switch vvv2{1} 
    case {'MI','EMI','HiMI'} 
        set(handles.edit1,'visible','off'); 
        set(handles.edit2,'visible','off'); 
        set(handles.text3,'visible','off'); 
        set(handles.text4,'visible','off'); 
        NumOfVar=0;  % 以上三个MI函数输入参数个数为0 
    case 'RMI' 
        set(handles.edit1,'visible','on','string','9'); 
        set(handles.edit2,'visible','off'); 
        set(handles.text3,'visible','on','string','size of region is 3,4,9'); 
        set(handles.text4,'visible','off');         
        NumOfVar=1; 
    case 'GMI' 
        set(handles.edit1,'visible','on','string','0.5'); 
        set(handles.edit2,'visible','off'); 
        set(handles.text3,'visible','on','string','size of gussian'); 
        set(handles.text4,'visible','off'); 
        NumOfVar=1; 
    case 'FPMI' 
        set(handles.edit1,'visible','on','string','3'); 
        set(handles.edit2,'visible','on','string','null'); 
        set(handles.text3,'visible','on','string','size of gussian=1,2,...,15'); 
        set(handles.text4,'visible','on','string','0