📄 mfbox_temporalicag.m
字号:
function varargout=mfbox_temporalicag(varargin)% MFBOX_TEMPORALICAG M-file for mfbox_temporalicag.fig%% See also: GUIDE, GUIDATA, GUIHANDLES%% Copyright by Peter Gruber and Fabian J. Theis% Signal Processing & Information Theory group% Institute of Biophysics, University of Regensburg, Germany% Homepage: http://research.fabian.theis.name% http://www-aglang.uni-regensburg.de%% This file is free software, subject to the % GNU GENERAL PUBLIC LICENSE, see gpl.txt% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name',mfilename, ... 'gui_Singleton',gui_Singleton, ... 'gui_OpeningFcn',@mfbox_temporalicag_OpeningFcn, ... 'gui_OutputFcn',@mfbox_temporalicag_OutputFcn, ... 'gui_LayoutFcn',[] , ... 'gui_Callback',[]);if (nargin&&(ischar(varargin{1}))) gui_State.gui_Callback = str2func(varargin{1});endif (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 mfbox_temporalicag is made visible.function mfbox_temporalicag_OpeningFcn(hObject,eventdata,handles,varargin)% varargin{1} contains data X% varargin{2} (optional) contains data mask% varargin{3} (optional) contains the parameters% varargin{4} (optional) contains runflag (0: param edit only, 1: param+run, 2: run only)handles.output = hObject;handles.X = varargin{1};s = size(handles.X);handles.dim = s(1:end-1);if (length(handles.dim)==1), handles.dim = [handles.dim,1]; endhandles.n = s(end);if (nargin>4), handles.mask = varargin{2};else handles.mask = logical(ones(handles.dim));endif (nargin>5), handles.params = varargin{3};else handles.params = [];endif (nargin>6), handles.runflag = varargin{4}; else handles.runflag = 1;endset(handles.numComponents,'String',mat2str(handles.params.numComponents));set(handles.iter,'String',mat2str(handles.params.maxNumIterations));set(handles.epsilon,'String',mat2str(handles.params.epsilon));set(handles.beta,'String',mat2str(handles.params.beta),'Enable',handles.params.usepast);set(handles.pastiter,'String',mat2str(handles.params.maxNumPastIterations),'Enable',handles.params.usepast);set(handles.usepast,'Value',strcmp(handles.params.usepast,'on'));if (handles.runflag<1), set(handles.run,'String','Set ...'); endguidata(hObject, handles);uiwait(handles.temporalica);% --- Outputs from this function are returned to the command line.function varargout=mfbox_temporalicag_OutputFcn(hObject,eventdata,handles) % varargout{1} the (edited) parameters% varargout{2-4} (optional) contain A,W,Sif (isstruct(handles)) close(handles.temporalica) varargout{1} = handles.params;else varargout{1} = [];endfunction beta_Callback(hObject,eventdata,handles)set(hObject,'String',mat2str(abs(str2double(get(hObject,'String')))));guidata(hObject,handles);% --- Executes during object creation, after setting all properties.function beta_CreateFcn(hObject,eventdata,handles)if (ispc&&(isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor')))) set(hObject,'BackgroundColor','white');endfunction pastiter_Callback(hObject,eventdata,handles)v = max(floor(str2double(get(hObject,'String'))),1);set(hObject,'String',mat2str(v));guidata(hObject,handles);% --- Executes during object creation, after setting all properties.function pastiter_CreateFcn(hObject,eventdata,handles)if (ispc&&(isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor')))) set(hObject,'BackgroundColor','white');endfunction numComponents_Callback(hObject,eventdata,handles)v = max(min(floor(str2double(get(hObject,'String'))),handles.n),1);set(hObject,'String',mat2str(v));guidata(hObject,handles);% --- Executes during object creation, after setting all properties.function numComponents_CreateFcn(hObject,eventdata,handles)if (ispc&&(isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor')))) set(hObject,'BackgroundColor','white');end% --- Executes on button press in run.function run_Callback(hObject,eventdata,handles)p = {'off','on'};handles.params.numComponents = str2double(get(handles.numComponents,'String'));handles.params.epsilon = str2double(get(handles.epsilon,'String'));handles.params.maxNumIterations = str2double(get(handles.iter,'String'));handles.params.beta = str2double(get(handles.beta,'String'));handles.params.maxNumPastIterations = str2double(get(handles.pastiter,'String'));handles.params.usepast = p{get(handles.usepast,'Value')+1};guidata(hObject,handles);uiresume(gcf);function epsilon_Callback(hObject,eventdata,handles)set(hObject,'String',mat2str(abs(str2double(get(hObject,'String')))));guidata(hObject,handles);% --- Executes during object creation, after setting all properties.function epsilon_CreateFcn(hObject,eventdata,handles)if (ispc&&(isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor')))) set(hObject,'BackgroundColor','white');endfunction iter_Callback(hObject,eventdata,handles)v = max(floor(str2double(get(hObject,'String'))),1);set(hObject,'String',mat2str(v));guidata(hObject,handles);% --- Executes during object creation, after setting all properties.function iter_CreateFcn(hObject,eventdata,handles)if (ispc&&(isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor')))) set(hObject,'BackgroundColor','white');end% --- Executes on button press in usepast.function usepast_Callback(hObject,eventdata,handles)p = {'off','on'};usepast = p{get(hObject,'Value')+1};set(handles.beta,'Enable',usepast);set(handles.pastiter,'Enable',usepast);guidata(hObject,handles);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -