📄 mfbox_hrficag.m
字号:
function varargout=mfbox_hrficag(varargin)% MFBOX_HRFICAG M-file for mfbox_hrficag.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_hrficag_OpeningFcn, ... 'gui_OutputFcn',@mfbox_hrficag_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_hrficag is made visible.function mfbox_hrficag_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.timestep,'String',sprintf('%1.2f',handles.params.timestep));set(handles.maxiter,'String',mat2str(handles.params.maxiter));set(handles.delta,'String',sprintf('%1.5f',handles.params.delta));set(handles.alpha,'String',sprintf('%1.2f',handles.params.alpha));plot(mfbox_hrf(handles.params.timestep));title(handles.errorplot,'HRF');if (handles.runflag<1), set(handles.run,'String','Set ...'); endguidata(hObject,handles);uiwait(handles.hrfica);% --- Outputs from this function are returned to the command line.function varargout=mfbox_hrficag_OutputFcn(hObject,eventdata,handles) % varargout{1} the (edited) parametersif (isstruct(handles)) close(handles.hrfica) varargout{1} = handles.params;else varargout{1} = [];endfunction timestep_Callback(hObject, eventdata, handles)v = max(abs(str2double(get(hObject,'String'))),0);set(hObject,'String',sprintf('%1.2f',v));plot(mfbox_hrf(v));title(handles.errorplot,'HRF');guidata(hObject, handles);% --- Executes during object creation, after setting all properties.function timestep_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)handles.params.numComponents = str2double(get(handles.numComponents,'String'));handles.params.timestep = str2double(get(handles.timestep,'String'));handles.params.delta = str2double(get(handles.delta,'String'));handles.params.maxiter = str2double(get(handles.maxiter,'String'));handles.params.alpha = str2double(get(handles.alpha,'String'));guidata(hObject,handles);uiresume(gcf);function delta_Callback(hObject,eventdata,handles)v = max(abs(str2double(get(hObject,'String'))),0);set(hObject,'String',sprintf('%1.5f',v));guidata(hObject,handles);% --- Executes during object creation, after setting all properties.function delta_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');endfunction maxiter_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 maxiter_CreateFcn(hObject,eventdata,handles)if (ispc&&(isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor')))) set(hObject,'BackgroundColor','white');endfunction alpha_Callback(hObject,eventdata,handles)v = min(max(abs(str2double(get(hObject,'String'))),0),1);set(hObject,'String',sprintf('%1.2f',v));guidata(hObject,handles);% --- Executes during object creation, after setting all properties.function alpha_CreateFcn(hObject,eventdata,handles)if (ispc&&(isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor')))) set(hObject,'BackgroundColor','white');end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -