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

zusammenfassung.m
function varargout = zusammenfassung(varargin)
% $Id: zusammenfassung.m 10 2004-12-14 16:51:26Z maik $
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @zusammenfassung_OpeningFcn, ...
                   'gui_OutputFcn',  @zusammenfassung_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




function refresh(handles)

set(handles.eBlinksuchfenster,'String',handles.parameter.grobsuche.blinksuchfenster);

set(handles.eFaktX,'String',num2str(handles.parameter.wfakt.x));
set(handles.eFaktY,'String',num2str(handles.parameter.wfakt.y));
 
set(handles.eNoiseX,'String',num2str(handles.parameter.grobsuche.x.schwellwert));
set(handles.eNoiseY,'String',num2str(handles.parameter.grobsuche.y.schwellwert));
 
set(handles.eSpeedX,'String',num2str(handles.parameter.feinsuche.x.schwellwert));
set(handles.eSpeedY,'String',num2str(handles.parameter.feinsuche.y.schwellwert));
set(handles.eRefB,'String',num2str(handles.parameter.blinkamp));

set(handles.eBlinkAufw,'String',num2str(handles.parameter.blinksoftening));




set(handles.eXReiz,'String',num2str(handles.parameter.reizauswertung.xreiz));
set(handles.eYReiz,'String',num2str(handles.parameter.reizauswertung.yreiz));
if(handles.parameter.reizauswertung.yreizflg)
    set(handles.cbYReiz,'Value',get(handles.cbYReiz,'Max'));
else
    set(handles.cbYReiz,'Value',get(handles.cbYReiz,'Min'));
end

if(handles.parameter.reizauswertung.xreizflg)
    set(handles.cbXReiz,'Value',get(handles.cbXReiz,'Max'));
else
    set(handles.cbXReiz,'Value',get(handles.cbXReiz,'Min'));
end



% --- Executes just before zusammenfassung is made visible.
function zusammenfassung_OpeningFcn(hObject, eventdata, handles, varargin)
% prft zuerst ob wir auch eine gltige datenmatrix bekommen haben
if (nargin~=5)
    close;    
    return;
end

handles.parameter=varargin{2};
refresh(handles);


indim=size(varargin{1});
if(length(indim)~=2 || indim(2)<3)    
    close;    
    return;    
end

handles.inputdata= varargin{1};
guidata(gcf, handles);

% Update handles structure
guidata(hObject, handles);

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


% --- Outputs from this function are returned to the command line.
function varargout = zusammenfassung_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,'parameter'))
    varargout{1} = handles.parameter;
    close(handles.figure1);    
end





function eFaktX_Callback(hObject, eventdata, handles)
n=str2double(get(hObject,'String'));
if ~isnan(n)
    handles.parameter.wfakt.x=n;    
    guidata(gcf, handles);    
end
refresh(handles);



% --- Executes during object creation, after setting all properties.
function eFaktX_CreateFcn(hObject, eventdata, handles)
% hObject    handle to eFaktX (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 eFaktY_Callback(hObject, eventdata, handles)
n=str2double(get(hObject,'String'));
if ~isnan(n)
    handles.parameter.wfakt.y=n;
    guidata(gcf, handles);    
end
refresh(handles);



% --- Executes during object creation, after setting all properties.
function eFaktY_CreateFcn(hObject, eventdata, handles)
% hObject    handle to eFaktY (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 bWFakt.
function bWFakt_Callback(hObject, eventdata, handles)
%1. Zeige Schritt 1 an
winkel=uigetangle();  %ermittelt die Augenwinkel
if length(winkel) ==1 
    return;
end

%xwert=schritt2(handles.inputdata);   %ermittelt zugehrige AD Werte aus X Kanal
xwert=uigetdouble(handles.inputdata,2,'Step 2',{'EOG Calibration','Mark horizontal reference saccade'});
if length(xwert) ==1 
     return;
end


%ywert=schritt3(handles.inputdata);   %ermittelt zugehrige AD Werte aus Y Kanal
ywert=uigetdouble(handles.inputdata,3,'Step 3',{'EOG Calibration','Mark vertical reference saccade'}); 
if length(ywert) ==1 
     return;
end

%(Winkel / Spannungdiff) * y  = x (Winkel) 
handles.parameter.wfakt.x=winkel(1) / (xwert(2)-xwert(1));
handles.parameter.wfakt.y=winkel(2) / (ywert(2)-ywert(1)); 

handles.parameter.reizx=winkel(1);
handles.parameter.reizy=winkel(2);

guidata(gcf, handles);
refresh(handles);





function eNoiseX_Callback(hObject, eventdata, handles)
n=str2double(get(hObject,'String'));
if ~isnan(n)
    handles.parameter.grobsuche.x.schwellwert=n;
    guidata(gcf, handles);        
end
refresh(handles);


% --- Executes during object creation, after setting all properties.
function eNoiseX_CreateFcn(hObject, eventdata, handles)
% hObject    handle to eNoiseX (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 eNoiseY_Callback(hObject, eventdata, handles)
n=str2double(get(hObject,'String'));
if ~isnan(n)
    handles.parameter.grobsuche.y.schwellwert=n;
    guidata(gcf, handles);
end
refresh(handles);

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

%nx=schritt4(handles.inputdata,handles.parameter);   %noise bestimmung x
nx=uigetnoise([handles.inputdata(:,1) ...
    handles.inputdata(:,2)*handles.parameter.wfakt.x],'Step 4',...
    {'EOG Calibration','Get horizontal signal noise'});
if length(nx) ==1 
    return;
end
handles.parameter.grobsuche.x.schwellwert=nx(1);
guidata(gcf, handles);
refresh(handles);


% --- Executes on button press in bNoiseY.
function bNoiseY_Callback(hObject, eventdata, handles)
%ny=schritt5(handles.inputdata,handles.parameter);   %noise bestimmung y
ny=uigetnoise([handles.inputdata(:,1) ...
    handles.inputdata(:,3)*handles.parameter.wfakt.y],'Step 5',...
    {'EOG Calibration','Get vertical signal noise'});

if length(ny) ==1 
    return;
end
handles.parameter.grobsuche.y.schwellwert=ny(1);
guidata(gcf, handles);
refresh(handles);

% --- Executes on button press in bOk.
function bOk_Callback(hObject, eventdata, handles)
uiresume(handles.figure1);


function eSpeedX_Callback(hObject, eventdata, handles)
n=str2double(get(hObject,'String'));
if ~isnan(n)
    handles.parameter.feinsuche.x.schwellwert=n;
    guidata(gcf, handles);
end
refresh(handles);

% --- Executes during object creation, after setting all properties.
function eSpeedX_CreateFcn(hObject, eventdata, handles)
% hObject    handle to eSpeedX (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 eSpeedY_Callback(hObject, eventdata, handles)
n=str2double(get(hObject,'String'));
if ~isnan(n)
    handles.parameter.feinsuche.y.schwellwert=n;
    guidata(gcf, handles);
end
refresh(handles);


% --- Executes during object creation, after setting all properties.
function eSpeedY_CreateFcn(hObject, eventdata, handles)
% hObject    handle to eSpeedY (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 eBlinksuchfenster_Callback(hObject, eventdata, handles)
n=str2double(get(hObject,'String'));
if ~isnan(n)
    handles.parameter.grobsuche.blinksuchfenster=n;
    guidata(gcf, handles);
end
refresh(handles);


% --- Executes during object creation, after setting all properties.
function eBlinksuchfenster_CreateFcn(hObject, eventdata, handles)
% hObject    handle to eBlinksuchfenster (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 eRefB_Callback(hObject, eventdata, handles)
n=str2double(get(hObject,'String'));
if ~isnan(n)
    handles.parameter.blinkamp=n;
    guidata(gcf, handles);
end
refresh(handles);

% --- Executes during object creation, after setting all properties.
function eRefB_CreateFcn(hObject, eventdata, handles)
% hObject    handle to eRefB (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end








function edit10_Callback(hObject, eventdata, handles)
% hObject    handle to edit10 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit10 as text
%        str2double(get(hObject,'String')) returns contents of edit10 as a double


% --- Executes during object creation, after setting all properties.
function edit10_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit10 (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on button press in bBlink.
function bBlink_Callback(hObject, eventdata, handles)
blinkamp=uigetblink(handles.inputdata,handles.parameter);
if(isempty(blinkamp))
    return;
end
handles.parameter.blinkamp=blinkamp;
handles.parameter.blinkamp=handles.parameter.blinkamp*handles.parameter.blinkamprage/100;
guidata(gcf, handles);
refresh(handles);




% --- Executes on button press in checkbox1.
function checkbox1_Callback(hObject, eventdata, handles)
% hObject    handle to checkbox1 (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 checkbox1



function edit11_Callback(hObject, eventdata, handles)
% hObject    handle to edit11 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit11 as text
%        str2double(get(hObject,'String')) returns contents of edit11 as a double


% --- Executes during object creation, after setting all properties.
function edit11_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit11 (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on button press in bXStep.
function bXStep_Callback(hObject, eventdata, handles)
 indim=size(handles.inputdata);
 if(indim(2)<4)
     %  nicht genug Kanle
     return;
 end

 wert=uigetdouble(handles.inputdata,4,'Determine Stepwidth',{'Stimulus Calibration','Determine Stepwidth'}); 
 if length(wert) ==1 
     return;
 end
 dist=wert(2)-wert(1);
 handles.parameter.reizauswertung.xreiz=dist;    
 guidata(gcf, handles);
 refresh(handles);

 
 
 
% --- Executes on button press in bYStep.
function bYStep_Callback(hObject, eventdata, handles)
 indim=size(handles.inputdata);
 if(indim(2)<5)
     %  nicht genug Kanle
     return;
 end
 wert=uigetdouble(handles.inputdata,5,'Determine Stepwidth',{'Stimulus Calibration','Determine Stepwidth'});
 if length(wert) ==1 
     return;
 end
 dist=wert(2)-wert(1);
 handles.parameter.reizauswertung.yreiz=dist;    
 guidata(gcf, handles);
 refresh(handles);
 
 





% --- Executes during object creation, after setting all properties.
function eYReiz_CreateFcn(hObject, eventdata, handles)
% hObject    handle to eYReiz (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end





% --- Executes on button press in bCancel.
function bCancel_Callback(hObject, eventdata, handles)
delete(handles.figure1);

function eXReiz_Callback(hObject, eventdata, handles)
n=str2double(get(hObject,'String'));
if ~isnan(n)
    handles.parameter.reizauswertung.xreiz=n;    
    guidata(gcf, handles);
end
refresh(handles);

function eYReiz_Callback(hObject, eventdata, handles)
n=str2double(get(hObject,'String'));
if ~isnan(n)
    handles.parameter.reizauswertung.yreiz=n;    
    guidata(gcf, handles);
end
refresh(handles);



% --- Executes on button press in cbXReiz.
function cbXReiz_Callback(hObject, eventdata, handles)
if(get(hObject,'Value')==get(hObject,'Max'))    
    handles.parameter.reizauswertung.xreizflg=true;
else
    handles.parameter.reizauswertung.xreizflg=false;    
end
guidata(gcf, handles);


% --- Executes on button press in cbYReiz.
function cbYReiz_Callback(hObject, eventdata, handles)
if(get(hObject,'Value')==get(hObject,'Max'))    
    handles.parameter.reizauswertung.yreizflg=true;
else
    handles.parameter.reizauswertung.yreizflg=false;    
end
guidata(gcf, handles);



function eBlinkAufw_Callback(hObject, eventdata, handles)
n=str2double(get(hObject,'String'));
if ~isnan(n) && n>=0 && n<=1    
    handles.parameter.blinksoftening=n;    
    guidata(gcf, handles);
end
refresh(handles);


% --- Executes during object creation, after setting all properties.
function eBlinkAufw_CreateFcn(hObject, eventdata, handles)
% hObject    handle to eBlinkAufw (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


Contact us