image thumbnail

eogui – a software to analyze electro-oculogram (EOG) recordings

by

 

10 Aug 2011 (Updated )

detects blinks and saccadic eye movements in EOG recordings

selbereich.m
function varargout = selbereich(varargin)
% $Id: selbereich.m 6 2004-12-13 12:28:39Z maik $
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @selbereich_OpeningFcn, ...
                   'gui_OutputFcn',  @selbereich_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(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 selbereich is made visible.
function selbereich_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 selbereich (see VARARGIN)


% prft zuerst ob wir auch eine gltige datenmatrix bekommen haben
if (nargin<5)    
    return;
end 
handles.minidx=varargin{1};
handles.maxidx=varargin{2};



set(handles.eVon,'String',num2str(handles.minidx));
set(handles.eBis,'String',num2str(handles.maxidx));



% Update handles structure
guidata(hObject, handles);

% UIWAIT makes selbereich wait for user response (see UIRESUME)
uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = selbereich_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} = [];

if(isfield(handles,'output'))
    varargout{1} = handles.output;        
    close();
end


% --- Executes on button press in cAll.
function cAll_Callback(hObject, eventdata, handles)
% hObject    handle to cAll (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
if(get(handles.cAll,'Value')==get(handles.cAll,'Max'))
    set(handles.cPart,'Value',get(handles.cPart,'Min'))
else
    set(handles.cPart,'Value',get(handles.cPart,'Max'))    
end


% --- Executes on button press in cPart.
function cPart_Callback(hObject, eventdata, handles)
% hObject    handle to cPart (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
if(get(handles.cAll,'Value')==get(handles.cPart,'Max'))
    set(handles.cAll,'Value',get(handles.cAll,'Min'))
else
    set(handles.cAll,'Value',get(handles.cAll,'Max'))    
end





function eVon_Callback(hObject, eventdata, handles)
% hObject    handle to eVon (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
set(handles.cPart,'Value',get(handles.cPart,'Max'))
set(handles.cAll,'Value',get(handles.cAll,'Min'))
num=str2double(get(hObject,'String'));
if(isnan(num))    
    warndlg('ungltige Eingabe','Fehler');    
    return;
end

if(num>handles.maxidx | num<handles.minidx)
    set(hObject,'String',num2str(handles.minidx));
end
set(handles.cPart,'Value',get(handles.cPart,'Max'));
set(handles.cAll,'Value',get(handles.cAll,'Min'));






% --- Executes during object creation, after setting all properties.
function eVon_CreateFcn(hObject, eventdata, handles)
% hObject    handle to eVon (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 eBis_Callback(hObject, eventdata, handles)
% hObject    handle to eBis (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

set(handles.cPart,'Value',get(handles.cPart,'Max'))
set(handles.cAll,'Value',get(handles.cAll,'Min'))

num=str2double(get(hObject,'String'));

if(isnan(num))    
    warndlg('ungltige Eingabe','Fehler');
    return;
end

if(num>handles.maxidx | num<handles.minidx)
    set(hObject,'String',num2str(handles.maxidx));
end
set(handles.cPart,'Value',get(handles.cPart,'Max'));
set(handles.cAll,'Value',get(handles.cAll,'Min'));



% --- Executes during object creation, after setting all properties.
function eBis_CreateFcn(hObject, eventdata, handles)
% hObject    handle to eBis (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


% --- Executes on button press in bWeiter.
function bWeiter_Callback(hObject, eventdata, handles)
% hObject    handle to bWeiter (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

if(get(handles.cAll,'Value')~=get(handles.cAll,'Max'))
    num1=str2double(get(handles.eVon,'String'));
    num2=str2double(get(handles.eBis,'String'));

    if(isnan(num1) || isnan(num2))
        warndlg('ungltige Eingabe','Fehler');
        return;
    end

    if(num2<=num1)
        warndlg('Ausschnitt zu klein','Fehler');
        return;    
    end
    
    
    %suche start und ende
    %s=find(handles.data(:,1)>=num1,1);
    %e=find(handles.data(:,1)>=num2,1);    
    %if(isempty(s) || isempty(e))
    %    warndlg('Fehler im Bereich','Fehler');
    %    return;            
    %end    
    handles.output=[num1 num2];
else
    handles.output=[];
end
guidata(gcf, handles);    
uiresume(handles.figure1);



% --- Executes on button press in bAbbruch.
function bAbbruch_Callback(hObject, eventdata, handles)
% hObject    handle to bAbbruch (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
handles.output=[];
guidata(gcf, handles); 
uiresume(handles.figure1);

Contact us