|
| 1 | +function varargout = guireadneurone(varargin) |
| 2 | +% GUIREADNEURONE Application M-file for guireadneurone.fig |
| 3 | +% FIG = GUIREADNEURONE launch guireadneurone GUI. |
| 4 | +% GUIREADNEURONE('callback_name', ...) invoke the named callback. |
| 5 | +% |
| 6 | +% ======================================================================== |
| 7 | +% NOTE: |
| 8 | +% This file is part of the NeurOne data import plugin for EEGLAB. |
| 9 | +% ======================================================================== |
| 10 | +% |
| 11 | +% Current version: 1.0.3.4 (2016-06-17) |
| 12 | +% Author: Mega Electronics |
| 13 | + |
| 14 | +% If no input arguments are used, the GUI is launched |
| 15 | +if nargin == 0 |
| 16 | + |
| 17 | + neuroneimportfig = openfig(mfilename,'new'); |
| 18 | + |
| 19 | + % Initialize a structure of handles to pass to callbacks. |
| 20 | + handles = guihandles(neuroneimportfig); |
| 21 | + |
| 22 | + % Load logos |
| 23 | + bgcolor=[0.656 0.758 1.0]; |
| 24 | + megaLogo=imread('mega_gradient_edit.png','BackgroundColor',bgcolor); |
| 25 | + axes(handles.mega_logo); |
| 26 | + image(megaLogo) |
| 27 | + axis off |
| 28 | + axis image |
| 29 | + |
| 30 | + neuroneLogo=imread('neurone_logo.png','BackgroundColor',bgcolor); |
| 31 | + axes(handles.neurone_logo); |
| 32 | + image(neuroneLogo) |
| 33 | + axis off |
| 34 | + axis image |
| 35 | + |
| 36 | + % Declare variables |
| 37 | + handles.chans=''; |
| 38 | + handles.sessionPhaseNumber=1; |
| 39 | + handles.loadStatus=0; |
| 40 | + |
| 41 | + % Store the structure |
| 42 | + guidata(neuroneimportfig, handles) |
| 43 | + |
| 44 | + % Wait for callbacks. 'Ok' or 'Cancel' to continue. |
| 45 | + uiwait(neuroneimportfig); |
| 46 | + |
| 47 | + if nargout > 0 |
| 48 | + varargout{1} = neuroneimportfig; |
| 49 | + end |
| 50 | + |
| 51 | +elseif ischar(varargin{1}) |
| 52 | + |
| 53 | + try |
| 54 | + if (nargout) |
| 55 | + [varargout{1:nargout}] = feval(varargin{:}); |
| 56 | + else |
| 57 | + feval(varargin{:}); |
| 58 | + end |
| 59 | + catch |
| 60 | + disp(lasterr); |
| 61 | + end |
| 62 | + |
| 63 | +end |
| 64 | + |
| 65 | + |
| 66 | +% --- Executes on button press in cancel_button. |
| 67 | +function varargout = cancel_button_Callback(hObject, eventdata, handles) |
| 68 | +% hObject handle to cancel_button (see GCBO) |
| 69 | +% eventdata reserved - to be defined in a future version of MATLAB |
| 70 | +% handles structure with handles and user data (see GUIDATA) |
| 71 | + |
| 72 | +handles.loadStatus=0; |
| 73 | +guidata(hObject,handles); |
| 74 | +uiresume(handles.guireadneurone_fig) |
| 75 | + |
| 76 | + |
| 77 | +function varargout = channel_area_Callback(hObject, eventdata, handles) |
| 78 | +% hObject handle to channel_area (see GCBO) |
| 79 | +% eventdata reserved - to be defined in a future version of MATLAB |
| 80 | +% handles structure with handles and user data (see GUIDATA) |
| 81 | + |
| 82 | +% Hints: get(hObject,'String') returns contents of channel_area as text |
| 83 | +% str2double(get(hObject,'String')) returns contents of channel_area as a double |
| 84 | + |
| 85 | +handles.chans=get(hObject,'string'); |
| 86 | +guidata(hObject,handles); |
| 87 | + |
| 88 | + |
| 89 | +% --- Executes during object creation, after setting all properties. |
| 90 | +function varargout = channel_area_CreateFcn(hObject, eventdata, handles) |
| 91 | +% hObject handle to channel_area (see GCBO) |
| 92 | +% eventdata reserved - to be defined in a future version of MATLAB |
| 93 | +% handles empty - handles not created until after all CreateFcns called |
| 94 | + |
| 95 | +% Hint: edit controls usually have a white background on Windows. |
| 96 | +% See ISPC and COMPUTER. |
| 97 | +if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
| 98 | + set(hObject,'BackgroundColor','white'); |
| 99 | +end |
| 100 | + |
| 101 | +function varargout = session_area_Callback(hObject, eventdata, handles) |
| 102 | +% hObject handle to channel_area (see GCBO) |
| 103 | +% eventdata reserved - to be defined in a future version of MATLAB |
| 104 | +% handles structure with handles and user data (see GUIDATA) |
| 105 | + |
| 106 | +% Hints: get(h,'String') returns contents of channel_area as text |
| 107 | +% str2double(get(hObject,'String')) returns contents of channel_area as a double |
| 108 | + |
| 109 | +handles.sessionPhaseNumber=str2num(get(hObject,'String')); |
| 110 | +guidata(hObject,handles); |
| 111 | + |
| 112 | + |
| 113 | +% --- Executes during object creation, after setting all properties. |
| 114 | +function varargout = session_area_CreateFcn(hObject, eventdata, handles) |
| 115 | +% hObject handle to channel_area (see GCBO) |
| 116 | +% eventdata reserved - to be defined in a future version of MATLAB |
| 117 | +% handles empty - handles not created until after all CreateFcns called |
| 118 | + |
| 119 | +% Hint: edit controls usually have a white background on Windows. |
| 120 | +% See ISPC and COMPUTER. |
| 121 | +if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) |
| 122 | + set(hObject,'BackgroundColor','white'); |
| 123 | +end |
| 124 | + |
| 125 | + |
| 126 | +% --- Executes on button press in help_button. |
| 127 | +function varargout = help_button_Callback(hObject, eventdata, handles) |
| 128 | +% hObject handle to help_button (see GCBO) |
| 129 | +% eventdata reserved - to be defined in a future version of MATLAB |
| 130 | +% handles structure with handles and user data (see GUIDATA) |
| 131 | + |
| 132 | +pophelp('pop_readneurone.m'); |
| 133 | + |
| 134 | + |
| 135 | +% --- Executes on button press in ok_button. |
| 136 | +function varargout = ok_button_Callback(hObject, eventdata, handles) |
| 137 | +% hObject handle to ok_button (see GCBO) |
| 138 | +% eventdata reserved - to be defined in a future version of MATLAB |
| 139 | +% handles structure with handles and user data (see GUIDATA) |
| 140 | + |
| 141 | + handles.loadStatus=1; |
| 142 | + guidata(hObject,handles); |
| 143 | + uiresume(handles.guireadneurone_fig); |
0 commit comments