function varargout = GUI_projekt1(varargin)
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @GUI_projekt1_OpeningFcn, ...
'gui_OutputFcn', @GUI_projekt1_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
function GUI_projekt1_OpeningFcn(hObject, eventdata, handles, varargin)
handles.output = hObject;
guidata(hObject, handles);
function varargout = GUI_projekt1_OutputFcn(hObject, eventdata, handles)
varargout{1} = handles.output;
function pushbutton1_Callback(hObject, eventdata, handles)
[filename pathname]=uigetfile({'*.trc'}, 'File Selector');
fullpathname=strcat(pathname, filename);
data=fopen(fullpathname);
a=fread(data);
save a;
fseek(data,6,-1);
ms=fread(data,1,'int16');
fvz=fread(data,1,'int16');
fseek(data,182,-1);
adresa=fread(data,1,'int16');
fseek(data,2,-1);
pocet=fread(data,1,'int16');
fseek(data,14,-1);
nazvy=fread(data,pocet+2,'int16');
kolik=ms/1000*fvz;
fseek(data,186,-1);
mesic=fread(data,1,'uint8');
den=fread(data,1,'uint8');
rok=fread(data,1,'uint8');
hodina=fread(data,1,'uint8');
minuta=fread(data,1,'uint8');
sekunda=fread(data,1,'uint8');
fseek(data,192,'bof');
prijmeni=fread(data,22,'uint8=>char')'
jmeno=fread(data,20,'uint8=>char')'
narozeni=fread(data,3,'uint8')'
set(handles.text1,'String', prijmeni)
set(handles.text1,'String', jmeno)
set(handles.text1,'String', narozeni)
fseek(data,adresa,-1);
i=1;
pole(i ,:)=(fread(data,pocet))';
while (i<kolik)
i=i+1;
fseek(data,adresa+i*pocet,-1);
pole(i ,:)=(fread(data,pocet))';
end
popis={'GND or AVG' 'FP1' 'FP2' 'F3' 'F4' 'F7' 'F8' 'FZ' 'C3' 'C4' 'CZ' 'P3' 'P4' 'PZ' 'O1' 'O2' 'T3' 'T4' 'T5' 'T6' 'EOG' 'EMG' 'ECG' 'PNG' 'AUX' 'MKR' 'GNDp'};
i=1;
obr=figure(1);
axes('Xlim',[0 20],'Ylim',[125 pocet*100+225],'XTick',0:5:(kolik-1)/fvz+1,'YTick',225:100:pocet*100+200,'YTickLabelMode','manual','YTickLabels',popis(nazvy(1:pocet)+1))
box('on');
hold('all');
set(obr,'numbertitle','off');
set(obr,'name','EEG');
set(obr,'menubar','none');
grid off;
xlabel(' \rightarrow čas[s]');
ylabel(' \rightarrow kanal');
t=0:1/fvz:(kolik-1)/fvz;
while (i<=pocet)
plot(t,pole(:,i)'+100*i,'b');
i=i+1;
end
function pushbutton2_Callback(hObject, eventdata, handles)
function pushbutton3_Callback(hObject, eventdata, handles)
cla reset;
set(handles.text1,'Value', 0);
set(handles.pushbutton1,'Value', 0);
set(handles.pushbutton2,'Value', 0);
close EEG