-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGUI_StepThree_FolderInfo_test.m
More file actions
executable file
·213 lines (168 loc) · 8.81 KB
/
GUI_StepThree_FolderInfo_test.m
File metadata and controls
executable file
·213 lines (168 loc) · 8.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
function varargout = GUI_StepThree_FolderInfo_test(varargin)
% GUI_STEPTHREE_FOLDERINFO MATLAB code for GUI_StepThree_FolderInfo.fig
% GUI_STEPTHREE_FOLDERINFO, by itself, creates a new GUI_STEPTHREE_FOLDERINFO or raises the existing
% singleton*.
%
% H = GUI_STEPTHREE_FOLDERINFO returns the handle to a new GUI_STEPTHREE_FOLDERINFO or the handle to
% the existing singleton*.
%
% GUI_STEPTHREE_FOLDERINFO('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in GUI_STEPTHREE_FOLDERINFO.M with the given input arguments.
%
% GUI_STEPTHREE_FOLDERINFO('Property','Value',...) creates a new GUI_STEPTHREE_FOLDERINFO or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before GUI_StepThree_FolderInfo_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to GUI_StepThree_FolderInfo_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help GUI_StepThree_FolderInfo
% Last Modified by GUIDE v2.5 24-Dec-2018 09:09:20
%global var init
global useold; useold=0; %use of old folders for concatenation
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @GUI_StepThree_FolderInfo_test_OpeningFcn, ...
'gui_OutputFcn', @GUI_StepThree_FolderInfo_test_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 GUI_StepThree_FolderInfo is made visible.
function GUI_StepThree_FolderInfo_test_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 GUI_StepThree_FolderInfo (see VARARGIN)
% Choose default command line output for GUI_StepThree_FolderInfo
handles.output = hObject;
load('ExpeInfo')
handles.ExpeInfo = ExpeInfo;
handles.ExpeInfo.PreProcessingInfo.MergeDone{1} = 0;
handles.ExpeInfo.PreProcessingInfo.RefDone{1} = 0;
handles.ExpeInfo.PreProcessingInfo.nobehav{1} = 0;
set(handles.DataRecap,'String',...
[newline,...
num2str(ExpeInfo.PreProcessingInfo.NumWideband) ' electrodes recorded',...
newline,...
num2str(ExpeInfo.PreProcessingInfo.NumAccelero) ' accelerometer channels',...
newline,...
num2str(ExpeInfo.PreProcessingInfo.NumDigChan) ' digital channels',...
' with ' num2str(ExpeInfo.PreProcessingInfo.NumDigInput) ' digital inputs',...
newline,...
num2str(ExpeInfo.PreProcessingInfo.NumAnalog) ' analog channels'])
set(handles.FixIt1,'String',['If this is wrong fix it NOW'],'ForegroundColor','r')
set(handles.WideBandCheckText,'String',['amplifier.dat with ' num2str(ExpeInfo.PreProcessingInfo.NumWideband) ' channels'])
set(handles.AcceleroCheckText,'String',['auxiliary.dat with ' num2str(ExpeInfo.PreProcessingInfo.NumAccelero) ' channels'])
set(handles.DigInCheckText,'String',['digitalin.dat with ' num2str(ExpeInfo.PreProcessingInfo.NumDigChan) ' channels'])
set(handles.AnalogCheckText,'String',['analogin.dat with ' num2str(ExpeInfo.PreProcessingInfo.NumAnalog) ' channels'])
set(handles.FixIt2,'String',['If this is wrong fix it NOW'],'ForegroundColor','r')
set(handles.FixIt2,'String',['If this is wrong fix it NOW'],'ForegroundColor','r')
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes GUI_StepThree_FolderInfo wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = GUI_StepThree_FolderInfo_test_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} = handles.output;
% --- Executes on button press in MergeCheckbox.
function MergeCheckbox_Callback(hObject, eventdata, handles)
TempData = guidata(hObject);
TempData.ExpeInfo.PreProcessingInfo.MergeDone{1} = hObject.Value;
guidata(hObject,TempData)
function DonePreProcessing_Callback(hObject, eventdata, handles)
TempData = guidata(hObject);
ExpeInfo = TempData.ExpeInfo;
save('ExpeInfo.mat','ExpeInfo')
delete(TempData.figure1)
LastStepDoPreProcessing_SB
function GetDataFolders_Callback(hObject, eventdata, handles)
load('ExpeInfo.mat')
% Check if folder to concatenate have alerady been entered and let you
% choose
if isfield(ExpeInfo.PreProcessingInfo,'NumFilesToConcatenate')
% YES/NO dialogue window
% to use the old files or not
f = figure('units','pixels','position',[400,400,220,100],...
'toolbar','none','menu','none');
% Question...
hOld.t = uicontrol('style','text','units','pixels', ...
'position',[20 50 180 40], ...
'String', 'Do you wish to use the folders already selected?');
% Create yes/no button
hOld.c(1) = uicontrol('style','pushbutton','units','pixels',...
'position',[50,15,50,30],'string','Yes','callback',@OldConc);
hOld.c(2) = uicontrol('style','pushbutton','units','pixels',...
'position',[120,15,50,30],'string','No','callback',@NewConc);
end
if useold
FigureID = guidata(GUIGetOldFilesToConcatenate);
else
FigureID = guidata(GUIGetFilesToConcatenate);
end
waitfor(FigureID.figure1)
load('ExpeInfo.mat')
disp('ok')
TempData = guidata(hObject);
TempData.ExpeInfo = ExpeInfo;
guidata(hObject,TempData)
set(handles.ChooseFolderOfInterest,'string',strjoin(ExpeInfo.PreProcessingInfo.FolderForConcatenation_Ephys,'|'))
function ChooseFolderOfInterest_Callback(hObject, eventdata, handles)
TempData = guidata(hObject);
items = get(hObject,'String')
TempData.ActiveFolder = strtrim(items(get(hObject,'Value'),:));
set(handles.WideBandCheckText,'String',['amplifier.dat with ' num2str(TempData.ExpeInfo.PreProcessingInfo.NumWideband) ' channels'])
if TempData.ExpeInfo.PreProcessingInfo.MergeDone{hObject.Value}
set(TempData.ArrowBox,'String',['----->'])
set(TempData.mergedfileCheck,'String',['amplifier.dat with ',...
num2str(TempData.ExpeInfo.PreProcessingInfo.NumAnalog + TempData.ExpeInfo.PreProcessingInfo.NumDigChan + TempData.ExpeInfo.PreProcessingInfo.NumAccelero + TempData.ExpeInfo.PreProcessingInfo.NumWideband) ' channels'])
if TempData.ExpeInfo.PreProcessingInfo.RefDone{hObject.Value}
set(TempData.mergedfileCheck,'String',['amplifier_M' num2str(TempData.ExpeInfo.nmouse) '.dat with ',...
num2str(TempData.ExpeInfo.PreProcessingInfo.NumAnalog + TempData.ExpeInfo.PreProcessingInfo.NumDigChan + TempData.ExpeInfo.PreProcessingInfo.NumAccelero + TempData.ExpeInfo.PreProcessingInfo.NumWideband) ' channels'])
end
else
set(TempData.ArrowBox,'String',[''])
set(TempData.mergedfileCheck,'String',[''])
if TempData.ExpeInfo.PreProcessingInfo.RefDone{hObject.Value}
set(handles.WideBandCheckText,'String',['amplifier_M' num2str(TempData.ExpeInfo.nmouse) '.dat with ' num2str(TempData.ExpeInfo.PreProcessingInfo.NumWideband) ' channels'])
end
end
set(handles.DonePreProcessing,'enable','on')
% Pushbutton callback
function OldConc(hObject, EventData, handles)
disp('Yes, use old folders')
useold=1;
delete(f)
function NewConc(hObject, EventData, handles)
disp('No, use new ones')
useold=0;
delete(f)
%
% --- Executes during object creation, after setting all properties.
function ChooseFolderOfInterest_CreateFcn(hObject, eventdata, handles)
% hObject handle to ChooseFolderOfInterest (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu 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