Mercurial > hg > map
comparison Copy_of_multithreshold 1.46/expGUI_MT.m @ 28:02aa9826efe0
mainly multiThreshold
author | Ray Meddis <rmeddis@essex.ac.uk> |
---|---|
date | Fri, 01 Jul 2011 12:59:47 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
27:d4a7675b0413 | 28:02aa9826efe0 |
---|---|
1 % expGUI_MT = 'experimenter GUI for multiThreshold | |
2 % allows the experimenter to design experiments. | |
3 % The *running* of experiments is left to subjGUI.m | |
4 % | |
5 % There are three kinds of experiments known as 'earOptions': | |
6 % 1. Measurements using real listeners | |
7 % 'left', 'right', 'diotic', 'dichoticLeft', 'dichoticRight' | |
8 % 2. Measurements using the MAP model as the subject | |
9 % 'MAPmodelListen', 'MAPmodelMultiCh', 'MAPmodelSingleCh' | |
10 % 3. Monte Carlo simulations | |
11 % 'statsModelLogistic','statsModelRareEvent' | |
12 % | |
13 % There are many stimulus configurations relating to different measurement | |
14 % requirements. These configurations are defined in paradigm files located | |
15 % in the 'paradigms' folder with names of the form paradigm_<name>.m. These | |
16 % files specify values in the stimulusParameter and experiment structures. | |
17 % Some minor parameters are specified in the intialiseGUI function below. | |
18 % Each configuration is only a start up arrangement and the user can modify | |
19 % the parameters on the GUI itself. | |
20 % | |
21 % the 'RUN' button initiates the measurements and hands control over to the | |
22 % subjGUI program. When the measurements are complete control is handed | |
23 % back and the stack unwinds without any further action | |
24 | |
25 function varargout = expGUI_MT(varargin) | |
26 %EXPGUI_MT M-file for expGUI_MT.fig | |
27 % EXPGUI_MT, by itself, creates a new EXPGUI_MT or raises the existing | |
28 % singleton*. | |
29 % | |
30 % H = EXPGUI_MT returns the handle to a new EXPGUI_MT or the handle to | |
31 % the existing singleton*. | |
32 % | |
33 % EXPGUI_MT('Property','Value',...) creates a new EXPGUI_MT using the | |
34 % given property value pairs. Unrecognized properties are passed via | |
35 % varargin to expGUI_MT_OpeningFcn. This calling syntax produces a | |
36 % warning when there is an existing singleton*. | |
37 % | |
38 % EXPGUI_MT('CALLBACK') and EXPGUI_MT('CALLBACK',hObject,...) call the | |
39 % local function named CALLBACK in EXPGUI_MT.M with the given input | |
40 % arguments. | |
41 % | |
42 % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one | |
43 % instance to run (singleton)". | |
44 % | |
45 % See also: GUIDE, GUIDATA, GUIHANDLES | |
46 | |
47 % Edit the above text to modify the response to help expGUI_MT | |
48 | |
49 % Last Modified by GUIDE v2.5 29-May-2011 16:02:02 | |
50 | |
51 % Begin initialization code - DO NOT EDIT | |
52 gui_Singleton = 1; | |
53 gui_State = struct('gui_Name', mfilename, ... | |
54 'gui_Singleton', gui_Singleton, ... | |
55 'gui_OpeningFcn', @expGUI_MT_OpeningFcn, ... | |
56 'gui_OutputFcn', @expGUI_MT_OutputFcn, ... | |
57 'gui_LayoutFcn', [], ... | |
58 'gui_Callback', []); | |
59 if nargin && ischar(varargin{1}) | |
60 gui_State.gui_Callback = str2func(varargin{1}); | |
61 end | |
62 | |
63 if nargout | |
64 [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); | |
65 else | |
66 gui_mainfcn(gui_State, varargin{:}); | |
67 end | |
68 % End initialization code - DO NOT EDIT | |
69 | |
70 % -------------------------------------------------- expGUI_MT_OpeningFcn | |
71 function expGUI_MT_OpeningFcn(hObject, eventdata, handles, varargin) | |
72 | |
73 % Choose default command line output for expGUI_MT | |
74 handles.output = hObject; | |
75 | |
76 cla(handles.axes1) | |
77 cla(handles.axes2) | |
78 cla(handles.axes4) | |
79 cla(handles.axes5) | |
80 | |
81 % Update handles structure | |
82 guidata(hObject, handles); | |
83 | |
84 function varargout = expGUI_MT_OutputFcn(hObject, eventdata, handles) | |
85 % Get default command line output from handles structure | |
86 initializeGUI(handles) | |
87 varargout{1} = handles.output; | |
88 setLocationOfGUIs(handles) | |
89 | |
90 function setLocationOfGUIs(handles) | |
91 global checkForPreviousGUI % holds screen positioning across repeated calls | |
92 scrnsize=get(0,'screensize'); | |
93 checkForPreviousGUI=[]; | |
94 % if isstruct(checkForPreviousGUI)... | |
95 % && checkForPreviousGUI.GUIalreadyStarted==1 ... | |
96 % && isfield(checkForPreviousGUI,'GUIposition') | |
97 % set(handles.figure1,'position',checkForPreviousGUI.GUIposition) | |
98 % else | |
99 % % relocate the GUI only if this is the first time of use | |
100 % set(0, 'units','pixels') | |
101 % % occupies top to bottom of screen but only 60% width | |
102 % % [left bottom width height] | |
103 % firstPos=[0.01*scrnsize(4) 0.03*scrnsize(3) 0.6*scrnsize(3) 0.92*scrnsize(4)]; | |
104 % firstPos=[4 0.045*scrnsize(4) 0.6*scrnsize(3) 0.93*scrnsize(4)]; | |
105 % set(handles.figure1, 'units','pixels') | |
106 % set(handles.figure1,'position',firstPos) | |
107 % checkForPreviousGUI.GUIalreadyStarted=1; | |
108 % checkForPreviousGUI.GUIposition=firstPos; | |
109 % end | |
110 set(handles.figure1,'color',[.871 .961 .996]) | |
111 set(handles.figure1,'name', pwd) | |
112 | |
113 % MAP model figure; sits alongside GUI if requested | |
114 figure(99) | |
115 % [left bottom width height] | |
116 MAPpos=[0.615*scrnsize(3) 0.05*scrnsize(4) 0.15*scrnsize(3) 0.85*scrnsize(4)]; | |
117 % visible only on request. | |
118 set(gcf,'position',MAPpos , 'visible','off') | |
119 | |
120 | |
121 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
122 | |
123 % -----------------------------------------------------initializeGUI | |
124 function initializeGUI(handles) | |
125 % Populate the edit boxes and popup menus on the GUI | |
126 % Then wait for user action | |
127 global stimulusParameters experiment betweenRuns | |
128 global targetTypes maskerTypes backgroundTypes | |
129 global variableNames paradigmNames threshEstNames cueNames | |
130 | |
131 % dbstop if error % allow for debugging and user error reporting | |
132 % dbstop if warning | |
133 | |
134 % specify structure fields for pretty automatic printing | |
135 % It also initialises some simple variables | |
136 orderGlobals | |
137 | |
138 addpath ('paradigms') % preset paradigm informations is stored here | |
139 % filesep is usd to be compatible with other operating systems | |
140 % addpath (['..' filesep 'modules'], ['..' filesep 'utilities'], ... | |
141 % ['..' filesep 'parameterStore'], ['..' filesep 'wavFileStore'],... | |
142 % ['..' filesep 'testPrograms']) | |
143 | |
144 % specify all variables that need to be set on the GUI | |
145 variableNames={'stimulusDelay','maskerDuration','maskerLevel',... | |
146 'maskerRelativeFrequency', 'targetFrequency', 'gapDuration',... | |
147 'targetDuration','targetLevel','rampDuration',... | |
148 'cueTestDifference', 'WRVstartValues', 'WRVsteps', 'WRVlimits'}; | |
149 | |
150 % Variable variables | |
151 % (specifies paradigm paramaters that can changed on a 'between runs' basis) | |
152 % make them options in the two between runs variable menus | |
153 % NB 'numOHIOtones' is used only to solve a problem; it should not be | |
154 % selected manually | |
155 betweenRunsVariables={'stimulusDelay','maskerDuration','maskerLevel',... | |
156 'maskerRelativeFrequency','targetFrequency', 'gapDuration',... | |
157 'targetDuration','targetLevel','numOHIOtones'}; | |
158 set(handles.popupmenuVaryParameter1,'string',betweenRunsVariables) | |
159 set(handles.popupmenuVaryParameter2,'string',betweenRunsVariables) | |
160 | |
161 % NB 'Warning: popupmenu control requires a scalar Value' | |
162 % indicates that an inappropriate 'value' is being set. | |
163 % when testing for this, always clear the GUI before running | |
164 | |
165 % Trial presentation order - randomize at startup | |
166 presentationOrderNames={'randomize within blocks', 'fixed sequence', ... | |
167 'randomize across blocks'}; | |
168 set(handles.popupmenuRandomize,'string', presentationOrderNames) | |
169 | |
170 % targetType- value must be set in paradigm | |
171 targetTypes={'tone','noise', 'pinkNoise','whiteNoise','24TalkerBabble',... | |
172 'speech', 'Twister','digitStrings'}; | |
173 set(handles.popupmenuTargetType, 'string', targetTypes); | |
174 | |
175 % maskerType - value must be set in paradigm | |
176 maskerTypes={'tone','noise', 'pinkNoise','TEN','whiteNoise','24TalkerBabble', ... | |
177 'speech'}; | |
178 set(handles.popupmenuMaskerType, 'string', maskerTypes); | |
179 | |
180 % background Type- value must be set in paradigm (default = 1, 'none') | |
181 backgroundTypes={'none','noise', 'pinkNoise', 'TEN','noiseDich',... | |
182 'pinkNoiseDich','whiteNoise','24TalkerBabble',... | |
183 '16TalkerBabble','8TalkerBabble','4TalkerBabble',... | |
184 '4TalkerReversedBabble','2TalkerBabble','1TalkerBabble'}; | |
185 set(handles.popupmenuBackgroundType, 'string', backgroundTypes); | |
186 set(handles.editBackgroundLevel,'string',... | |
187 num2str(stimulusParameters.backgroundLevel)) | |
188 | |
189 % Establish available paradigms by scanning paradigms folder | |
190 paradigmNames= what('paradigms'); | |
191 paradigmNames=paradigmNames.m; % m files only | |
192 for i=1:length(paradigmNames), paradigmNames{i}=paradigmNames{i}(10:end-2); end | |
193 set(handles.popupmenuParadigm,'string', paradigmNames) | |
194 | |
195 % startup paradigm, 'training' (could be anywhere on the list) | |
196 startupParadigm='training'; | |
197 idx= find(strcmp(paradigmNames,startupParadigm)); | |
198 if ~isempty(idx) | |
199 set(handles.popupmenuParadigm,'value', idx) | |
200 else | |
201 % training paradigm is always the startup paradigm | |
202 error(['expGUI_MT\initializeGUI: No ' startupParadigm... | |
203 ' paradigm found in paradigms folder']) | |
204 end | |
205 | |
206 earOptions={'left', 'right', 'diotic', 'dichoticLeft', 'dichoticRight',... | |
207 'MAPmodelListen', 'MAPmodelMultiCh', 'MAPmodelSingleCh'... | |
208 'statsModelLogistic','statsModelRareEvent'}; | |
209 set(handles.popupmenuEar,'string', earOptions) | |
210 defaultOption=1; | |
211 experiment.ear=earOptions{defaultOption}; | |
212 set(handles.popupmenuEar,'value', defaultOption) % 'left' is deafult | |
213 set(handles.pushbuttonSingleShot, 'visible', 'off') % use only for MAP | |
214 | |
215 % masker phase box- value must be set in paradigm | |
216 phaseOptions={'sin','cos','alt','rand'}; | |
217 set(handles.popupmenuPhase,'string', phaseOptions) | |
218 | |
219 % Cue | |
220 cueNames={'cued', 'noCue'}; | |
221 set(handles.popupmenuCueNoCue, 'string', cueNames); | |
222 | |
223 % threshold assessment method - value must be set in paradigm | |
224 threshEstNames={'oneIntervalUpDown', 'MaxLikelihood', ... | |
225 '2I2AFC++', '2I2AFC+++'}; | |
226 set(handles.popupmenuThreshEst, 'string', threshEstNames); | |
227 experiment.stopCriteria2IFC=[75 3 5]; | |
228 experiment.stopCriteriaSI=[20]; | |
229 | |
230 % ** editBoxes that are only set by hand | |
231 % music (relative) level, 'tada!' (manual setting only) | |
232 % increase for the hard of hearing | |
233 set(handles.editMusicLevel,'string','0') | |
234 | |
235 % Catch Trial Rate | |
236 set(handles.editCatchTrialRate,'string','0.2 0.1 2 '); | |
237 | |
238 % calibration | |
239 stimulusParameters.restoreCalibration=7; | |
240 set(handles.editcalibrationdB,'string',... | |
241 stimulusParameters.restoreCalibration) | |
242 | |
243 % a MAPplot | |
244 experiment.MAPplot=0; %default | |
245 set(handles.editMAPplot,'string',num2str(experiment.MAPplot)) | |
246 | |
247 % saveData | |
248 experiment.saveData=1; | |
249 set(handles.editSaveData,'string',num2str(experiment.saveData)) | |
250 | |
251 % printTracks | |
252 experiment.printTracks=0; | |
253 set(handles.editPrintTracks,'string',num2str(experiment.printTracks)) | |
254 | |
255 % standard delay between button press and initiation of next stimulus | |
256 experiment.clickToStimulusPause=1; | |
257 | |
258 % buttonBoxType: NB no problem if mouse is used instead | |
259 experiment.buttonBoxType='square'; | |
260 | |
261 % estimation of the mean | |
262 % {'logisticLS', 'logisticML', 'rareEvent'} | |
263 experiment.functionEstMethod='logisticLS'; | |
264 | |
265 % message box | |
266 set(handles.textMSG,'backgroundcolor', 'w', 'ForegroundColor', 'b', 'string', '') | |
267 set(handles.editMsgFont,'string','7') | |
268 set(handles.editSubjectFont,'string','14') | |
269 | |
270 % default psychometric bin size and logistic slopes | |
271 experiment.psyBinWidth=1; % dB | |
272 maxLogisticK=2; % steepest slope contemplated | |
273 experiment.maxLogisticK=maxLogisticK; | |
274 experiment.numPossLogisticK=100; | |
275 experiment.possLogSlopes= ... | |
276 0.01: maxLogisticK/experiment.numPossLogisticK: maxLogisticK; | |
277 experiment.meanSearchStep=0.25; % dB | |
278 | |
279 % indicate that this is the first run and the GUI should be located in | |
280 % default location. | |
281 experiment.justInitialized=1; | |
282 | |
283 % set up GUI based on training paradigm | |
284 aParadigmSelection(handles); | |
285 earSetUp(handles) | |
286 aThresholdAssessmentMethod(handles) | |
287 aShowRelevantObjects(handles) | |
288 | |
289 % Done. Now wait for action | |
290 | |
291 % -------------------------------------------- popupmenuMaskerType_Callback | |
292 function popupmenuMaskerType_Callback(hObject, eventdata, handles) | |
293 % show or remove masker frequency box | |
294 aShowRelevantObjects(handles) | |
295 | |
296 % -------------------------------------------- popupmenuTargetType_Callback | |
297 function popupmenuTargetType_Callback(hObject, eventdata, handles) | |
298 % show or remove target frequency box | |
299 aShowRelevantObjects(handles) | |
300 | |
301 % -------------------------------------------- popupmenuParadigm_Callback | |
302 function popupmenuParadigm_Callback(hObject, eventdata, handles) | |
303 % Any change to the paradigm selection causes all boxes to be shown | |
304 % showParameters(handles) | |
305 aParadigmSelection(handles); | |
306 | |
307 % -------------------------------------------- aParadigmSelection | |
308 function aParadigmSelection(handles) | |
309 global experiment stimulusParameters betweenRuns paradigmNames | |
310 global variableNames | |
311 | |
312 % identify paradigm selected | |
313 chosenOption=get(handles.popupmenuParadigm,'value'); | |
314 paradigm=paradigmNames{chosenOption}; | |
315 experiment.paradigm=paradigm; | |
316 | |
317 %Paradigm: read in all relevant parameters | |
318 % a file must exist with this name 'paradigm_<paradigm>' | |
319 % 'handles' are only occasionally used | |
320 addpath ('paradigms') | |
321 cmd=['paradigm_' paradigm '(handles);']; | |
322 try | |
323 eval(cmd) | |
324 catch | |
325 error(['ExpGUI\aParadigmSelection:'... | |
326 'paradigm file not found or error in file']) | |
327 end | |
328 rmpath ('paradigms') | |
329 | |
330 switch experiment.paradigm | |
331 % identify masker free paradigms | |
332 case {'training', 'discomfort','absThreshold', 'absThreshold_8',... | |
333 'absThreshold_16','TENtest', 'threshold_duration','SRT'... | |
334 'paradigm_thr_IFMC'} | |
335 experiment.maskerInUse=0; | |
336 otherwise | |
337 experiment.maskerInUse=1; | |
338 end | |
339 | |
340 % if a variable is subject to change, specify list of values here | |
341 % eg. stimulusParameters.targetFrequency=betweenRuns.variableList1; | |
342 cmd=['stimulusParameters.' ... | |
343 betweenRuns.variableName1 '=betweenRuns.variableList1;']; | |
344 eval (cmd); | |
345 cmd=['stimulusParameters.' ... | |
346 betweenRuns.variableName2 '=betweenRuns.variableList2;']; | |
347 eval (cmd); | |
348 | |
349 % establish popup menus on the basis of the paradigm file | |
350 set(handles.popupmenuRandomize,'value', betweenRuns.randomizeSequence) | |
351 set(handles.popupmenuPhase,'string', stimulusParameters.maskerPhase) | |
352 if stimulusParameters.includeCue | |
353 set(handles.popupmenuCueNoCue,'value', 1) | |
354 else | |
355 set(handles.popupmenuCueNoCue,'value', 2) | |
356 end | |
357 | |
358 set(handles.text34, 'string', stimulusParameters.WRVname) | |
359 | |
360 % Put the new data values into the edit boxes on the GUI | |
361 for i=1:length(variableNames) | |
362 cmd=(['set(handles.edit' variableNames{i} ... | |
363 ',''string'', num2str(stimulusParameters.' ... | |
364 variableNames{i} '));']); | |
365 eval(cmd); | |
366 end | |
367 % backgroundLevel is not a variableName (?!) | |
368 set(handles.editBackgroundLevel,'string', num2str... | |
369 (stimulusParameters.backgroundLevel)) | |
370 | |
371 % on RUN the sample rate will be picked from the text box | |
372 % However, MAP overrules the sample rate and sets its own | |
373 aSetSampleRate(stimulusParameters.subjectSampleRate, handles); | |
374 | |
375 | |
376 % used for plotting functions (NB affected by paradigm settings) | |
377 experiment.predictionLevels=stimulusParameters.WRVlimits(1):... | |
378 experiment.meanSearchStep:stimulusParameters.WRVlimits(2); | |
379 experiment.possLogSlopes=abs(experiment.possLogSlopes)*... | |
380 sign(experiment.psyFunSlope); | |
381 | |
382 aResetPopupMenus(handles) | |
383 | |
384 % ------------------------------------------------------ aResetPopupMenus | |
385 function aResetPopupMenus(handles) | |
386 global stimulusParameters betweenRuns variableNames | |
387 global targetTypes maskerTypes experiment backgroundTypes | |
388 | |
389 switch experiment.threshEstMethod | |
390 case {'MaxLikelihood','oneIntervalUpDown'} | |
391 set(handles.editstopCriteriaBox, 'string', ... | |
392 num2str(experiment.singleIntervalMaxTrials)) | |
393 | |
394 case {'2I2AFC++','2I2AFC+++'} | |
395 set(handles.editstopCriteriaBox, 'string', ... | |
396 num2str(experiment.stopCriteria2IFC)) | |
397 otherwise | |
398 error([' aResetPopupMenus: threshEstMethod not recognised -> ' ... | |
399 experiment.threshEstMethod]) | |
400 end | |
401 | |
402 % forced noCue | |
403 switch experiment.paradigm | |
404 case 'discomfort' | |
405 set(handles.popupmenuCueNoCue,'value', 2) | |
406 end | |
407 | |
408 %set variables popupmenus as specified in betweenRuns | |
409 variableParameter1ID=0; variableParameter2ID=0; | |
410 for i=1:length(variableNames) | |
411 if strcmp(variableNames{i},betweenRuns.variableName1) | |
412 variableParameter1ID=i; | |
413 end | |
414 if strcmp(variableNames{i},betweenRuns.variableName2) | |
415 variableParameter2ID=i; | |
416 end | |
417 end | |
418 if variableParameter1ID==0 || variableParameter2ID==0; | |
419 Error('a ResetPopMenu: variableParameter not identified') | |
420 end | |
421 | |
422 % display popupmenus | |
423 set(handles.popupmenuVaryParameter1, 'value',round(variableParameter1ID)) | |
424 set(handles.popupmenuVaryParameter2, 'value',round(variableParameter2ID)) | |
425 | |
426 % targetType | |
427 idx= find(strcmp(stimulusParameters.targetType, targetTypes)); | |
428 set(handles.popupmenuTargetType,'value', idx) | |
429 | |
430 % paradigm selection may alter the maskerType | |
431 idx= find(strcmp(stimulusParameters.maskerType, maskerTypes)); | |
432 set(handles.popupmenuMaskerType,'value', idx) | |
433 | |
434 aShowRelevantObjects(handles) | |
435 | |
436 % % backgroundType popup | |
437 idx= find(strcmp(stimulusParameters.backgroundType, backgroundTypes)); | |
438 set(handles.popupmenuBackgroundType,'value', idx) | |
439 set(handles.editBackgroundLevel,'string', ... | |
440 num2str(stimulusParameters.backgroundLevel)) | |
441 | |
442 % ---------------------------------------------- aShowRelevantObjects | |
443 function aShowRelevantObjects(handles) | |
444 global experiment stimulusParameters | |
445 % called from aShowRelevantObjects | |
446 % always on | |
447 set(handles.edittargetLevel, 'visible', 'on') | |
448 set(handles.edittargetDuration, 'visible', 'on') | |
449 set(handles.edittargetFrequency, 'visible', 'on') | |
450 | |
451 switch experiment.ear | |
452 case {'statsModelLogistic', 'statsModelRareEvent'} | |
453 set(handles.editStatsModel, 'visible', 'on') | |
454 set(handles.textStatsModel, 'visible', 'on') | |
455 set(handles.pushbuttonStop, 'visible', 'on') | |
456 showModelPushButtons(handles, 0) | |
457 set(handles.editCatchTrialRate, 'visible', 'off') | |
458 set(handles.textCatchTrials, 'visible', 'off') | |
459 set(handles.editcalibrationdB, 'visible', 'off') | |
460 set(handles.textcalibration, 'visible', 'off') | |
461 set(handles.popupmenuCueNoCue, 'visible', 'off') | |
462 set(handles.textCue, 'visible', 'off') | |
463 set(handles.editMusicLevel,'visible', 'off') | |
464 set(handles.textMusicLevel,'visible', 'off') | |
465 | |
466 case {'MAPmodel', 'MAPmodelListen', 'MAPmodelMultiCh', 'MAPmodelSingleCh'} | |
467 set(handles.popupmenuCueNoCue, 'visible', 'off') | |
468 set(handles.editStatsModel, 'visible', 'off') | |
469 set(handles.textStatsModel, 'visible', 'off') | |
470 set(handles.pushbuttonStop, 'visible', 'on') | |
471 showModelPushButtons(handles, 1) | |
472 set(handles.editcalibrationdB, 'visible', 'off') | |
473 set(handles.textcalibration, 'visible', 'off') | |
474 set(handles.textCue, 'visible', 'off') | |
475 set(handles.editMusicLevel,'visible', 'off') | |
476 set(handles.textMusicLevel,'visible', 'off') | |
477 | |
478 otherwise | |
479 % i.e. using real subjects (left, right, diotic, dichotic) | |
480 set(handles.editStatsModel, 'visible', 'off') | |
481 set(handles.textStatsModel, 'visible', 'off') | |
482 set(handles.pushbuttonStop, 'visible', 'off') | |
483 showModelPushButtons(handles, 0) | |
484 set(handles.editCatchTrialRate, 'visible', 'on') | |
485 set(handles.textCatchTrials, 'visible', 'on') | |
486 set(handles.editcalibrationdB, 'visible', 'on') | |
487 set(handles.textcalibration, 'visible', 'on') | |
488 set(handles.popupmenuCueNoCue, 'visible', 'on') | |
489 set(handles.textCue, 'visible', 'on') | |
490 set(handles.editMusicLevel,'visible', 'on') | |
491 set(handles.textMusicLevel,'visible', 'on') | |
492 end | |
493 | |
494 switch experiment.threshEstMethod | |
495 case {'MaxLikelihood','oneIntervalUpDown'} | |
496 set(handles.popupmenuCueNoCue,'visible', 'on') | |
497 set(handles.textCue,'visible', 'on') | |
498 set(handles.editstopCriteriaBox, 'string', ... | |
499 num2str(experiment.singleIntervalMaxTrials)) | |
500 | |
501 if stimulusParameters.includeCue==0 | |
502 set(handles.editcueTestDifference,'visible', 'off') | |
503 set(handles.textcueTestDifference,'visible', 'off') | |
504 else | |
505 set(handles.editcueTestDifference,'visible', 'on') | |
506 set(handles.textcueTestDifference,'visible', 'on') | |
507 end | |
508 | |
509 case {'2I2AFC++','2I2AFC+++'} | |
510 set(handles.editCatchTrialRate, 'visible', 'off') | |
511 set(handles.textCatchTrials, 'visible', 'off') | |
512 set(handles.popupmenuCueNoCue,'visible', 'off') | |
513 set(handles.textCue,'visible', 'off') | |
514 set(handles.editcueTestDifference,'visible', 'off') | |
515 set(handles.textcueTestDifference,'visible', 'off') | |
516 end | |
517 | |
518 % show/ remove masker related boxes | |
519 if ~experiment.maskerInUse | |
520 set(handles.editmaskerDuration,'visible', 'off') | |
521 set(handles.editmaskerLevel,'visible', 'off') | |
522 set(handles.editmaskerRelativeFrequency,'visible', 'off') | |
523 set(handles.editgapDuration,'visible', 'off') | |
524 set(handles.textmaskerDuration,'visible', 'off') | |
525 set(handles.textmaskerLevel,'visible', 'off') | |
526 set(handles.textmaskerRelativeFrequency,'visible', 'off') | |
527 set(handles.textgapDuration,'visible', 'off') | |
528 set(handles.popupmenuMaskerType,'visible', 'off') | |
529 set(handles.textMaskerType,'visible', 'off') | |
530 | |
531 % paradigms with maskers | |
532 else | |
533 set(handles.editmaskerDuration,'visible', 'on') | |
534 set(handles.editmaskerLevel,'visible', 'on') | |
535 set(handles.editmaskerRelativeFrequency,'visible', 'on') | |
536 set(handles.editgapDuration,'visible', 'on') | |
537 set(handles.popupmenuMaskerType,'visible', 'on') | |
538 set(handles.textmaskerDuration,'visible', 'on') | |
539 set(handles.textmaskerLevel,'visible', 'on') | |
540 set(handles.textmaskerRelativeFrequency,'visible', 'on') | |
541 set(handles.textgapDuration,'visible', 'on') | |
542 set(handles.popupmenuMaskerType,'visible', 'on') | |
543 set(handles.textMaskerType,'visible', 'on') | |
544 % masker relative frequency /type | |
545 chosenOption=get(handles.popupmenuMaskerType,'value'); | |
546 maskerTypes=get(handles.popupmenuMaskerType,'string'); | |
547 maskerType=maskerTypes{chosenOption}; | |
548 switch maskerType | |
549 case 'tone' | |
550 set(handles.editmaskerRelativeFrequency,'visible', 'on') | |
551 otherwise | |
552 set(handles.editmaskerRelativeFrequency,'visible', 'off') | |
553 end | |
554 end | |
555 | |
556 eval(['set(handles.edit' stimulusParameters.WRVname ... | |
557 ',''visible'',''off'' )']) | |
558 | |
559 % target type | |
560 chosenOption=get(handles.popupmenuTargetType,'value'); | |
561 targetTypes=get(handles.popupmenuTargetType,'string'); | |
562 targetType=targetTypes{chosenOption}; | |
563 switch targetType | |
564 case 'tone' | |
565 set(handles.edittargetFrequency,'visible', 'on') | |
566 otherwise | |
567 set(handles.edittargetFrequency,'visible', 'off') | |
568 end | |
569 | |
570 if strcmp(stimulusParameters.backgroundType,'none') | |
571 set(handles.popupmenuBackgroundType, 'visible', 'on'); | |
572 set(handles.editBackgroundLevel,'visible','off') | |
573 set(handles.textBGlevel,'visible','off') | |
574 else | |
575 set(handles.popupmenuBackgroundType, 'visible', 'on'); | |
576 set(handles.editBackgroundLevel,'visible','on') | |
577 set(handles.textBGlevel,'visible','on') | |
578 end | |
579 | |
580 % ------------------------------------------------ showModelPushButtons | |
581 function showModelPushButtons(handles,on) | |
582 if on | |
583 set(handles.pushbuttonOME, 'visible', 'on') | |
584 set(handles.pushbuttonBM, 'visible', 'on') | |
585 set(handles.pushbuttonRP, 'visible', 'on') | |
586 set(handles.pushbuttonAN, 'visible', 'on') | |
587 set(handles.pushbuttonPhLk, 'visible', 'on') | |
588 set(handles.pushbuttonSYN, 'visible', 'on') | |
589 set(handles.pushbuttonFM, 'visible', 'on') | |
590 set(handles.pushbuttonParams, 'visible', 'on') | |
591 set(handles.pushbuttonSingleShot, 'visible', 'on') | |
592 set(handles.editMAPplot,'visible', 'on') | |
593 set(handles.textMAPplot,'visible', 'on') | |
594 | |
595 else | |
596 set(handles.pushbuttonOME, 'visible', 'off') | |
597 set(handles.pushbuttonBM, 'visible', 'off') | |
598 set(handles.pushbuttonRP, 'visible', 'off') | |
599 set(handles.pushbuttonAN, 'visible', 'off') | |
600 set(handles.pushbuttonPhLk, 'visible', 'off') | |
601 set(handles.pushbuttonSYN, 'visible', 'off') | |
602 set(handles.pushbuttonFM, 'visible', 'off') | |
603 set(handles.pushbuttonParams, 'visible', 'off') | |
604 set(handles.pushbuttonSingleShot, 'visible', 'off') | |
605 set(handles.editMAPplot,'visible', 'off') | |
606 set(handles.textMAPplot,'visible', 'off') | |
607 | |
608 end | |
609 | |
610 % ------------------------------------------------ pushbuttonRun_Callback | |
611 function pushbuttonRun_Callback(hObject, eventdata, handles) | |
612 global checkForPreviousGUI % holds screen positioning across repeated calls | |
613 global experiment betweenRuns paradigmNames | |
614 checkForPreviousGUI.GUIposition=get(handles.figure1,'position'); | |
615 experiment.singleShot=0; | |
616 switch experiment.paradigm | |
617 case 'thr_IFMC' | |
618 %% special option for two successive and linked measurements | |
619 clc | |
620 experiment.paradigm='threshold_16ms'; | |
621 set(handles.editstopCriteriaBox,'string','30') % nTrials | |
622 run (handles) | |
623 | |
624 % use these threshold for IFMC | |
625 thresholds16ms=betweenRuns.thresholds; | |
626 optionNo=strmatch('IFMC_16ms',paradigmNames); | |
627 set(handles.popupmenuParadigm,'value',optionNo); | |
628 aParadigmSelection(handles) | |
629 set(handles.edittargetLevel,'string', thresholds16ms+10); | |
630 set(handles.editstopCriteriaBox,'string','30') % nTrials | |
631 pause(.1) | |
632 run (handles) | |
633 | |
634 % reset original paradigm | |
635 optionNo=strmatch('thr_IFMC',paradigmNames); | |
636 set(handles.popupmenuParadigm,'value',optionNo); | |
637 aParadigmSelection(handles) | |
638 | |
639 case 'thr_TMC' | |
640 %% special option for two successive and linked measurements | |
641 clc | |
642 experiment.paradigm='threshold_16ms'; | |
643 set(handles.edittargetDuration,'string', num2str(0.25)) | |
644 set(handles.editstopCriteriaBox,'string','30') % nTrials | |
645 run (handles) | |
646 | |
647 set(handles.edittargetDuration,'string', num2str(0.016)) | |
648 set(handles.editstopCriteriaBox,'string','30') % nTrials | |
649 run (handles) | |
650 | |
651 % use these threshold for TMC | |
652 thresholds16ms=betweenRuns.thresholds; | |
653 optionNo=strmatch('TMC_16ms',paradigmNames); | |
654 set(handles.popupmenuParadigm,'value',optionNo); | |
655 aParadigmSelection(handles) | |
656 set(handles.edittargetLevel,'string', thresholds16ms+10); | |
657 set(handles.editstopCriteriaBox,'string','30') % nTrials | |
658 pause(.1) | |
659 run (handles) | |
660 | |
661 % reset original paradigm | |
662 optionNo=strmatch('thr_TMC',paradigmNames); | |
663 set(handles.popupmenuParadigm,'value',optionNo); | |
664 aParadigmSelection(handles) | |
665 | |
666 otherwise | |
667 run (handles) | |
668 experiment.stop=0; | |
669 end | |
670 | |
671 function run (handles) | |
672 global experiment expGUIhandles stimulusParameters | |
673 tic | |
674 expGUIhandles=handles; | |
675 set(handles.pushbuttonStop, 'backgroundColor', [.941 .941 .941]) | |
676 | |
677 % message box white (removes any previous error message) | |
678 set(handles.textMSG,... | |
679 'backgroundcolor', 'w', 'ForegroundColor', 'b', 'string', '') | |
680 | |
681 errorMsg=aReadAndCheckParameterBoxes(handles); | |
682 if ~isempty(errorMsg) | |
683 append=0; | |
684 warning=1; | |
685 addToMsg(['error message:' errorMsg], append, warning) | |
686 return | |
687 end | |
688 | |
689 if isnan(stimulusParameters.targetLevel) | |
690 addToMsg('Error: targetlevel not set', 1) | |
691 error('Error: targetlevel not set') | |
692 end | |
693 | |
694 set(handles.textMSG,'backgroundcolor', 'w') | |
695 set(handles.textMSG,'string', ' ') | |
696 | |
697 % leave the program and start up multiThreshold | |
698 subjGUI_MT % leave the program and start up multiThreshold | |
699 experiment.justInitialized=0;% prevents moving subjectGUI | |
700 toc | |
701 | |
702 % --- Executes on button press in pushbuttonSingleShot. | |
703 function pushbuttonSingleShot_Callback(hObject, eventdata, handles) | |
704 global experiment | |
705 experiment.singleShot=1; | |
706 | |
707 % special test for spontaneous activity | |
708 x=get(handles.editWRVstartValues, 'string'); | |
709 y=get(handles.edittargetDuration, 'string'); | |
710 set(handles.editWRVstartValues, 'string', '-20') | |
711 set(handles.edittargetDuration, 'string', '1') | |
712 | |
713 MAPplot=get(handles.editMAPplot, 'string'); | |
714 set(handles.editMAPplot, 'string', '1') | |
715 drawnow | |
716 | |
717 run (handles) | |
718 | |
719 set(handles.editMAPplot, 'string', MAPplot) | |
720 set(handles.editWRVstartValues, 'string', x) | |
721 set(handles.edittargetDuration, 'string', y) | |
722 | |
723 % ------------------------------------------aReadAndCheckParameterBoxes | |
724 function errorMsg=aReadAndCheckParameterBoxes(handles) | |
725 global experiment stimulusParameters betweenRuns statsModel | |
726 global variableNames LevittControl | |
727 % When the program sets the parameters all should be well | |
728 % But when the user changes them... | |
729 | |
730 errorMsg=''; | |
731 | |
732 % name | |
733 experiment.name=get(handles.editName,'string'); | |
734 | |
735 % ear/models | |
736 option=get(handles.popupmenuEar,'value'); | |
737 strings=get(handles.popupmenuEar,'string'); | |
738 experiment.ear=strings{option}; | |
739 | |
740 switch experiment.ear | |
741 case { 'MAPmodel', 'MAPmodelMultiCh', ... | |
742 'MAPmodelSingleCh', 'MAPmodelListen'} | |
743 % MAPmodel writes forced parameter settings to the screen | |
744 % so that they can be read from there | |
745 set(handles.popupmenuRandomize,'value',2) % fixed sequence | |
746 set(handles.editstimulusDelay,'string','0.01') % no stimulus delay | |
747 stimulusParameters.includeCue=0; % no cue for MAP | |
748 end | |
749 | |
750 % find tone type | |
751 option=get(handles.popupmenuTargetType,'value'); | |
752 strings=get(handles.popupmenuTargetType,'string'); | |
753 stimulusParameters.targetType=strings{option}; | |
754 | |
755 % find masker type | |
756 option=get(handles.popupmenuMaskerType,'value'); | |
757 strings=get(handles.popupmenuMaskerType,'string'); | |
758 stimulusParameters.maskerType=strings{option}; | |
759 | |
760 % find background type and level | |
761 option=get(handles.popupmenuBackgroundType,'value'); | |
762 strings=get(handles.popupmenuBackgroundType,'string'); | |
763 stimulusParameters.backgroundTypeValue=option; | |
764 stimulusParameters.backgroundLevel=... | |
765 str2num(get(handles.editBackgroundLevel,'string')); | |
766 stimulusParameters.backgroundType=strings{option}; | |
767 | |
768 % Read all stimulus parameter boxes | |
769 for i=1:length(variableNames) | |
770 cmd=['stimulusParameters.' variableNames{i} ... | |
771 '= str2num(get(handles.edit' variableNames{i} ',''string'' ));']; | |
772 eval(cmd); | |
773 end | |
774 % for multiple levels | |
775 stimulusParameters.targetLevels=stimulusParameters.targetLevel; | |
776 | |
777 % check that all required values are in the edit boxes | |
778 for i=1:length(variableNames)-3 % do not include 'level limits' | |
779 eval([ 'variableValues=stimulusParameters.' variableNames{i} ';']) | |
780 if isempty(variableValues), errorMsg=[ variableNames{i} ... | |
781 ' is an empty box']; return, end | |
782 end | |
783 | |
784 chosenOption=get(handles.popupmenuVaryParameter1,'value'); | |
785 betweenRuns.variableName1=variableNames{chosenOption}; | |
786 eval(['betweenRuns.variableList1 = stimulusParameters.' ... | |
787 betweenRuns.variableName1 ';']); | |
788 | |
789 chosenOption=get(handles.popupmenuVaryParameter2,'value'); | |
790 betweenRuns.variableName2=variableNames{chosenOption}; | |
791 eval(['betweenRuns.variableList2 = stimulusParameters.' ... | |
792 betweenRuns.variableName2 ';']); | |
793 | |
794 % Check that variable parameters 1 & 2 have different names | |
795 if strcmp(betweenRuns.variableName1,betweenRuns.variableName2) ... | |
796 && ~strcmp(betweenRuns.variableName1,'none') | |
797 errorMsg='variable parameters have the same name'; | |
798 return | |
799 end | |
800 | |
801 % calibration | |
802 % this is used to *reduce* the output signal from what it otherwise | |
803 % would be | |
804 % signal values are between 1 - 2^23 | |
805 % these are interpreted as microPascals between -29 dB and 128 dB SPL | |
806 % calibrationdB adjusts these values to compensate for equipment | |
807 % characteristics | |
808 % this will change the range. e.g. a 7 dB calibration will yield | |
809 % a range of -36 to 121 dB SPL | |
810 % Calibration is not used when modelling. Values are treated as dB SPL | |
811 stimulusParameters.calibrationdB=... | |
812 str2num(get(handles.editcalibrationdB,'string')); | |
813 | |
814 % check on cue | |
815 cueSetUp(handles) | |
816 | |
817 stimulusParameters.WRVinitialStep=stimulusParameters.WRVsteps(1); | |
818 stimulusParameters.WRVsmallStep=stimulusParameters.WRVsteps(2); | |
819 | |
820 % jitter start value set after reading in new parameters | |
821 switch experiment.paradigm | |
822 case 'discomfort' | |
823 stimulusParameters.jitterStartdB=0; | |
824 otherwise | |
825 stimulusParameters.jitterStartdB=abs(stimulusParameters.WRVsteps(1)); | |
826 end | |
827 | |
828 | |
829 % stats model mean and slope | |
830 statsModelParameters= str2num(get(handles.editStatsModel,'string')); | |
831 switch experiment.ear | |
832 case {'statsModelLogistic'} | |
833 statsModel.logisticMean=statsModelParameters(1) ; | |
834 statsModel.logisticSlope=statsModelParameters(2); | |
835 statsModel.rareEvenGain=NaN ; | |
836 statsModel.rareEventVmin=NaN; | |
837 case 'statsModelRareEvent' | |
838 statsModel.logisticMean=NaN ; | |
839 statsModel.logisticSlope=NaN; | |
840 statsModel.rareEvenGain=statsModelParameters(2) ; | |
841 statsModel.rareEventVmin=statsModelParameters(1); | |
842 end | |
843 | |
844 % MAP plotting | |
845 experiment.MAPplot=str2num(get(handles.editMAPplot,'string')); | |
846 % if ~isequal(experiment.MAPplot, 0), | |
847 % % any other character will do it | |
848 % experiment.MAPplot=1; | |
849 % end | |
850 | |
851 % save data | |
852 experiment.saveData=str2num(get(handles.editSaveData,'string')); | |
853 if ~isequal(experiment.saveData, 0), | |
854 % any other character will do it | |
855 experiment.saveData=1; | |
856 end | |
857 | |
858 % print tracks | |
859 experiment.printTracks=str2num(get(handles.editPrintTracks,'string')); | |
860 if ~isequal(experiment.printTracks, 0), | |
861 % any other character will do it | |
862 experiment.printTracks=1; | |
863 end | |
864 | |
865 % catch trial rate | |
866 % (1)= start rate, (2)= base rate, (3)= time constant (trials) | |
867 stimulusParameters.catchTrialRates=... | |
868 str2num(get(handles.editCatchTrialRate,'string')); | |
869 if stimulusParameters.catchTrialRates(1) ... | |
870 < stimulusParameters.catchTrialRates(2) | |
871 errorMsg=... | |
872 'catch trial base rates must be less than catch trial start rate'; | |
873 return, | |
874 end | |
875 | |
876 % sample rate | |
877 % The sample rate is set in the paradigm file. | |
878 % Normally this is set in the startUp paradigm file and then left | |
879 % When the model is used, the multiThreshold sample rate | |
880 % overrules anything in the model | |
881 stimulusParameters.sampleRate=... | |
882 str2num(get(handles.textsampleRate,'string')); | |
883 | |
884 % music level | |
885 stimulusParameters.musicLeveldB=... | |
886 str2num(get(handles.editMusicLevel,'string')); | |
887 | |
888 % set message box font size | |
889 experiment.msgFontSize=str2num(get(handles.editMsgFont,'string')); | |
890 experiment.subjGUIfontSize=str2num(get(handles.editSubjectFont,'string')); | |
891 | |
892 % stop criteria | |
893 experiment.singleIntervalMaxTrials=... | |
894 str2num(get(handles.editstopCriteriaBox,'string')); | |
895 experiment.maxTrials=experiment.singleIntervalMaxTrials(1); | |
896 | |
897 % set up 2IFC is required (? better in atrhesholdAssessmentMethod) | |
898 switch experiment.threshEstMethod | |
899 case {'2I2AFC++', '2A2AIFC+++'} | |
900 experiment.peaksUsed=experiment.singleIntervalMaxTrials(2); | |
901 experiment.PeakTroughCriterionSD=... | |
902 experiment.singleIntervalMaxTrials(3); | |
903 experiment.trialsToBeUsed= 5; | |
904 LevittControl.maxTrials=experiment.singleIntervalMaxTrials(1); | |
905 % start value for step until reduced | |
906 LevittControl.startLevelStep= stimulusParameters.WRVsteps(1); | |
907 % reduced step size | |
908 LevittControl.steadyLevittStep= stimulusParameters.WRVsteps(2); | |
909 LevittControl.TurnsToSmallSteps= 2; | |
910 LevittControl.useLastNturns= 2*experiment.peaksUsed; | |
911 LevittControl.minReversals= ... | |
912 LevittControl.TurnsToSmallSteps+2*experiment.peaksUsed; | |
913 LevittControl.targetsdPT = experiment.PeakTroughCriterionSD; | |
914 LevittControl.maxLevittValue= stimulusParameters.WRVlimits(2); | |
915 Levitt2; | |
916 end | |
917 | |
918 % What kind of randomisation is required? | |
919 idx=get(handles.popupmenuRandomize,'value'); | |
920 s=get(handles.popupmenuRandomize,'string'); | |
921 betweenRuns.randomizeSequence=s{idx}; | |
922 | |
923 % Make small adjustments to variable values | |
924 % to keep values unique against later sorting | |
925 x=betweenRuns.variableList1; | |
926 [y idx]= sort(x); | |
927 for i=1:length(y)-1, if y(i+1)==y(i); y(i+1)=y(i)*1.001; end, end | |
928 x(idx)=y; | |
929 betweenRuns.variableList1=x; | |
930 | |
931 x=betweenRuns.variableList2; | |
932 [y idx]= sort(x); | |
933 for i=1:length(y)-1, if y(i+1)==y(i); y(i+1)=y(i)*1.001; end, end | |
934 x(idx)=y; | |
935 betweenRuns.variableList2=x; | |
936 | |
937 % Checks: after reading and setting parameters ------------------------------------------ | |
938 % check for finger trouble (more checks possible | |
939 if stimulusParameters.maskerDuration>10 | |
940 errorMsg='maskerDuration is too long'; return, end | |
941 if stimulusParameters.gapDuration>10 | |
942 errorMsg='gapDuration is too long'; return, end | |
943 if stimulusParameters.targetDuration>10 | |
944 errorMsg='targetDuration is too long'; return, end | |
945 | |
946 % rare event slope check | |
947 if experiment.psyFunSlope<0 ... | |
948 && strcmp(experiment.functionEstMethod,'rareEvent') | |
949 errorMsg='cannot use rareEvent option for negative psychometr slopes'; | |
950 return | |
951 end | |
952 | |
953 % check ramps | |
954 if stimulusParameters.rampDuration*2> stimulusParameters.targetDuration | |
955 errorMsg=' ramp duration is too long for the target'; | |
956 return | |
957 end | |
958 | |
959 if max(stimulusParameters.maskerDuration)>0 ... | |
960 && max(stimulusParameters.rampDuration... | |
961 *2> stimulusParameters.maskerDuration) | |
962 errorMsg=' ramp duration is too long for the masker'; | |
963 return | |
964 end | |
965 | |
966 % Check WRVstartValues for length and compatibility with randomization | |
967 % only one start value supplied so all start values are the same | |
968 if length(stimulusParameters.WRVstartValues)==1 | |
969 stimulusParameters.WRVstartValues= ... | |
970 repmat(stimulusParameters.WRVstartValues, 1, ... | |
971 length(betweenRuns.variableList1)... | |
972 *length(betweenRuns.variableList2)); | |
973 elseif ~isequal(length(stimulusParameters.WRVstartValues), ... | |
974 length(betweenRuns.variableList1)... | |
975 *length(betweenRuns.variableList2)) | |
976 % otherwise we need one value for each combination of var1/ var2 | |
977 errorMsg='WRVstartValues not the same length as number of runs'; | |
978 return | |
979 elseif strcmp(betweenRuns.randomizeSequence, 'randomize within blocks')... | |
980 && length(stimulusParameters.WRVstartValues)>1 | |
981 errorMsg='multiple WRVstartValues inappropriate'; | |
982 return | |
983 end | |
984 | |
985 % set the target level in advance for every wnticipated run | |
986 switch experiment.paradigm | |
987 case {'trainingIFMC', 'TMC','TMC_16ms', 'TMC - ELP', ... | |
988 'IFMC', 'IFMC_16ms'} | |
989 % For TMC and IFMC multiple target levels can be set | |
990 if length(stimulusParameters.targetLevel)==1 | |
991 betweenRuns.targetLevels=... | |
992 repmat(stimulusParameters.targetLevel, 1, ... | |
993 length(betweenRuns.variableList1)... | |
994 *length(betweenRuns.variableList2)); | |
995 elseif length(stimulusParameters.targetLevel)==... | |
996 length(betweenRuns.variableList2) | |
997 % only one level specified, so use this throughout | |
998 x=stimulusParameters.targetLevel; | |
999 x=repmat(x,length(betweenRuns.variableList1),1); | |
1000 x=reshape(x,1,length(betweenRuns.variableList1)*length(betweenRuns.variableList2)); | |
1001 betweenRuns.targetLevels=x; | |
1002 else | |
1003 errorMsg='targetLevels not the same length as number of targetFrequencies'; | |
1004 end | |
1005 end | |
1006 | |
1007 switch experiment.paradigm | |
1008 case {'gapDetection', 'frequencyDiscrimination'} | |
1009 if ~isequal(stimulusParameters.targetDuration, ... | |
1010 stimulusParameters.maskerDuration) | |
1011 addToMsg(... | |
1012 'Warning: masker and target duration not the same.',1,1) | |
1013 end | |
1014 if ~isequal(stimulusParameters.maskerLevel, ... | |
1015 stimulusParameters.targetLevel) | |
1016 addToMsg(['Warning: masker and target level different.'... | |
1017 'They will be changed to be equal',1,1]); | |
1018 end | |
1019 end | |
1020 | |
1021 % -------------------------------------------- aSetSampleRate | |
1022 function aSetSampleRate(sampleRate, handles) | |
1023 global stimulusParameters | |
1024 stimulusParameters.sampleRate=sampleRate; | |
1025 set(handles.textsampleRate,'string',num2str(stimulusParameters.sampleRate)) | |
1026 | |
1027 % -------------------------------------------- popupmenuEar_Callback | |
1028 function popupmenuEar_Callback(hObject, eventdata, handles) | |
1029 global experiment | |
1030 option=get(handles.popupmenuEar,'value'); | |
1031 options=get(handles.popupmenuEar,'string'); % left/right/model | |
1032 experiment.ear=options{option}; | |
1033 switch experiment.ear | |
1034 case 'statsModelLogistic' | |
1035 set(handles.editStatsModel,'string', '15, 0.5') | |
1036 case 'statsModelRareEvent' | |
1037 set(handles.editStatsModel,'string', '20 1') | |
1038 end | |
1039 earSetUp(handles) | |
1040 | |
1041 % -------------------------------------------- earSetUp | |
1042 function earSetUp(handles) | |
1043 global experiment stimulusParameters | |
1044 % option=get(handles.popupmenuEar,'value'); | |
1045 % options=get(handles.popupmenuEar,'string'); % left/right/model | |
1046 % experiment.ear=options{option}; | |
1047 | |
1048 switch experiment.ear | |
1049 case {'statsModelLogistic'} | |
1050 statsModel.logisticSlope=0.5; | |
1051 statsModel.logisticMean=15; | |
1052 set(handles.editStatsModel,'string', ... | |
1053 num2str([statsModel.logisticMean statsModel.logisticSlope])) | |
1054 set(handles.textStatsModel,... | |
1055 'string', {'statsModel',' logistic threshold\ slope'}) | |
1056 case 'statsModelRareEvent' | |
1057 set(handles.textStatsModel,'string', ... | |
1058 {'statsModel',' rareEvent Vmin\ gain'}) | |
1059 end | |
1060 | |
1061 switch experiment.ear | |
1062 case {'statsModelLogistic', 'statsModelRareEvent'} | |
1063 set(handles.editStatsModel, 'visible', 'off') | |
1064 set(handles.textStatsModel, 'visible', 'off') | |
1065 | |
1066 % default psychometric bin size and logistic slopes | |
1067 set(handles.popupmenuRandomize,'value',2) % fixed sequence | |
1068 set(handles.editName,'string', 'statsModel') | |
1069 % experiment.headphonesUsed=0; | |
1070 | |
1071 case {'MAPmodelListen', 'MAPmodelMultiCh', 'MAPmodelSingleCh'} | |
1072 stimulusParameters.includeCue=0; % no cue | |
1073 set(handles.popupmenuCueNoCue,'value', 2) | |
1074 | |
1075 set(handles.editCatchTrialRate,'string','0 0 2 ');%no catch trials | |
1076 set(handles.editName,'string', 'Normal') % force name | |
1077 experiment.name=get(handles.editName,'string'); % read name back | |
1078 set(handles.editcalibrationdB,'string','0') | |
1079 | |
1080 set(handles.popupmenuRandomize,'value',2) % fixed sequence | |
1081 set(handles.editstimulusDelay,'string','0') | |
1082 | |
1083 set(handles.editSaveData,'string', '0') | |
1084 set(handles.editSubjectFont,'string', '10'); | |
1085 experiment.MacGThreshold=0; % num MacG spikes to exceed threshold | |
1086 end | |
1087 aResetPopupMenus(handles) | |
1088 | |
1089 % --------------------------------------------- popupmenuCueNoCue_Callback | |
1090 function popupmenuCueNoCue_Callback(hObject, eventdata, handles) | |
1091 cueSetUp(handles) | |
1092 | |
1093 % ------------------------------------------------------------- cueSetUp | |
1094 function cueSetUp(handles) | |
1095 global stimulusParameters | |
1096 | |
1097 chosenOption=get(handles.popupmenuCueNoCue,'value'); | |
1098 if chosenOption==1 | |
1099 stimulusParameters.includeCue=1; | |
1100 set(handles.editcueTestDifference,'visible', 'on') | |
1101 set(handles.textcueTestDifference,'visible', 'on') | |
1102 stimulusParameters.subjectText=stimulusParameters.instructions{2}; | |
1103 else | |
1104 stimulusParameters.includeCue=0; | |
1105 set(handles.editcueTestDifference,'visible', 'off') | |
1106 set(handles.textcueTestDifference,'visible', 'off') | |
1107 stimulusParameters.subjectText= stimulusParameters.instructions{1}; | |
1108 end | |
1109 | |
1110 % -------------------------------------------- popupmenuThreshEst_Callback | |
1111 function popupmenuThreshEst_Callback(hObject, eventdata, handles) | |
1112 aThresholdAssessmentMethod(handles); | |
1113 | |
1114 % --------------------------------------------- aThresholdAssessmentMethod | |
1115 function aThresholdAssessmentMethod(handles) | |
1116 % identify the threshold assessment method | |
1117 % and set various parameters on the GUI appropriately | |
1118 global stimulusParameters experiment threshEstNames LevittControl | |
1119 | |
1120 chosenOption=get(handles.popupmenuThreshEst,'value'); | |
1121 experiment.threshEstMethod=threshEstNames{chosenOption}; | |
1122 set(handles.editCatchTrialRate, 'visible', 'on') | |
1123 set(handles.textCatchTrials, 'visible', 'on') | |
1124 | |
1125 % establish appropriate stop criterion and post on GUI | |
1126 switch experiment.threshEstMethod | |
1127 case 'MaxLikelihood' | |
1128 experiment.functionEstMethod='logisticML'; | |
1129 stimulusParameters.WRVsteps=10*experiment.psyFunSlope; % ??? | |
1130 set(handles.textstopCriteria,'string', 'stop criteria \ maxTrials') | |
1131 experiment.singleIntervalMaxTrials=experiment.stopCriteriaSI; | |
1132 experiment.allowCatchTrials= 1; | |
1133 switch experiment.paradigm | |
1134 case 'training' | |
1135 experiment.possLogSlopes=0.5; | |
1136 end | |
1137 | |
1138 case 'oneIntervalUpDown' | |
1139 experiment.functionEstMethod='logisticLS'; | |
1140 set(handles.textstopCriteria,'string', 'stop criteria \ maxTrials') | |
1141 experiment.singleIntervalMaxTrials=experiment.stopCriteriaSI; | |
1142 switch experiment.paradigm | |
1143 case 'discomfort' | |
1144 experiment.allowCatchTrials= 0; | |
1145 otherwise | |
1146 experiment.allowCatchTrials= 1; | |
1147 end | |
1148 | |
1149 case {'2I2AFC++', '2I2AFC+++'} | |
1150 LevittControl.rule='++'; % e.g. '++' or '+++' | |
1151 experiment.singleIntervalMaxTrials=experiment.stopCriteria2IFC; | |
1152 experiment.functionEstMethod='peaksAndTroughs'; | |
1153 LevittControl.maxTrials=experiment.singleIntervalMaxTrials(1); | |
1154 set(handles.editWRVsteps,'string', ... | |
1155 num2str(stimulusParameters.WRVsteps)) | |
1156 set(handles.textstopCriteria,'string', {'trials peaks sdCrit'}) | |
1157 experiment.allowCatchTrials= 0; | |
1158 end | |
1159 | |
1160 set(handles.textstopCriteria,'fontSize',8) | |
1161 set(handles.editstopCriteriaBox,'string',... | |
1162 num2str(experiment.singleIntervalMaxTrials)) | |
1163 | |
1164 % establish the appropriate instructions to the subject | |
1165 % NB responsibility for this is now transferred to the paradigm file | |
1166 switch experiment.threshEstMethod | |
1167 % only one value required for level change | |
1168 case {'2I2AFC++', '2A2AIFC+++'} | |
1169 stimulusParameters.subjectText=... | |
1170 'did the tone occur in window 1 or 2?'; | |
1171 case {'MaxLikelihood', 'oneIntervalUpDown'}; | |
1172 switch stimulusParameters.includeCue | |
1173 case 0 | |
1174 stimulusParameters.subjectText=... | |
1175 stimulusParameters.instructions{1}; | |
1176 case 1 | |
1177 stimulusParameters.subjectText= ... | |
1178 stimulusParameters.instructions{2}; | |
1179 end | |
1180 end | |
1181 stimulusParameters.messageString={'training'}; | |
1182 | |
1183 aResetPopupMenus(handles) | |
1184 % -------------------------------------------------- function orderGlobals | |
1185 function orderGlobals | |
1186 global stimulusParameters experiment betweenRuns withinRuns | |
1187 | |
1188 stimulusParameters=[]; | |
1189 stimulusParameters.sampleRate= []; | |
1190 stimulusParameters.targetType= ''; | |
1191 stimulusParameters.targetFrequency= []; | |
1192 stimulusParameters.targetDuration= []; | |
1193 stimulusParameters.targetLevel= []; | |
1194 stimulusParameters.gapDuration= []; | |
1195 stimulusParameters.maskerType= ''; | |
1196 stimulusParameters.maskerRelativeFrequency= []; | |
1197 stimulusParameters.maskerDuration= []; | |
1198 stimulusParameters.maskerLevel= []; | |
1199 stimulusParameters.backgroundType= ''; | |
1200 stimulusParameters.backgroundTypeValue= []; | |
1201 stimulusParameters.backgroundLevel= []; | |
1202 stimulusParameters.includeCue= []; | |
1203 experiment.clickToStimulusPause=[]; | |
1204 stimulusParameters.stimulusDelay= []; | |
1205 stimulusParameters.rampDuration= []; | |
1206 stimulusParameters.absThresholds= []; | |
1207 stimulusParameters.numOHIOtones= []; | |
1208 | |
1209 stimulusParameters.WRVname= ''; | |
1210 stimulusParameters.WRVstartValues= []; | |
1211 stimulusParameters.WRVsteps= []; | |
1212 stimulusParameters.WRVlimits= []; | |
1213 stimulusParameters.WRVinitialStep= []; | |
1214 stimulusParameters.WRVsmallStep= []; | |
1215 experiment.singleIntervalMaxTrials= []; | |
1216 stimulusParameters.calibrationdB= []; | |
1217 | |
1218 stimulusParameters.catchTrialRates= []; | |
1219 stimulusParameters.catchTrialBaseRate= []; | |
1220 stimulusParameters.catchTrialRate= []; | |
1221 stimulusParameters.catchTrialTimeConstant= []; | |
1222 | |
1223 stimulusParameters.dt= []; | |
1224 | |
1225 stimulusParameters.jitterStartdB= []; | |
1226 stimulusParameters.restoreCalibration= []; | |
1227 stimulusParameters.messageString= []; | |
1228 stimulusParameters.cueTestDifference= []; | |
1229 stimulusParameters.subjectText= ''; | |
1230 stimulusParameters.testTargetBegins= []; | |
1231 stimulusParameters.testTargetEnds= []; | |
1232 stimulusParameters.musicLeveldB= []; | |
1233 | |
1234 stimulusParameters.subjectSampleRate=[]; | |
1235 stimulusParameters.MAPSampleRate=[]; | |
1236 | |
1237 experiment=[]; | |
1238 experiment.name= ''; | |
1239 experiment.date= ''; | |
1240 experiment.paradigm= ''; | |
1241 experiment.ear= ''; | |
1242 experiment.headphonesUsed=[]; | |
1243 experiment.singleShot= []; | |
1244 experiment.randomize= ''; | |
1245 experiment.maxTrials= []; | |
1246 experiment.MacGThreshold= []; | |
1247 experiment.resetCriterion= []; | |
1248 experiment.runResetCriterion= []; | |
1249 | |
1250 experiment.comparisonData= []; | |
1251 experiment.absThresholds= []; | |
1252 experiment.threshEstMethod= ''; | |
1253 experiment.functionEstMethod= ''; | |
1254 experiment.psyBinWidth= []; | |
1255 experiment.maxLogisticK=2; | |
1256 experiment.numPossLogisticK=100; | |
1257 experiment.possLogSlopes= []; | |
1258 experiment.meanSearchStep= []; | |
1259 experiment.psyFunSlope= []; | |
1260 experiment.predictionLevels=[]; | |
1261 | |
1262 experiment.buttonBoxType= ''; | |
1263 experiment.buttonBoxStatus= ''; | |
1264 experiment.status= ''; | |
1265 experiment.stop= 0; | |
1266 experiment.pleaseRepeat= []; | |
1267 experiment.justInitialized=[]; | |
1268 | |
1269 experiment.MAPplot= []; | |
1270 experiment.saveData= []; | |
1271 experiment.printTracks= []; | |
1272 experiment.msgFontSize= []; | |
1273 experiment.subjGUIfontSize= []; | |
1274 | |
1275 experiment.timeAtStart= ''; | |
1276 experiment.minElapsed= []; | |
1277 | |
1278 betweenRuns=[]; | |
1279 betweenRuns.variableName1= ''; | |
1280 betweenRuns.variableList1= []; | |
1281 betweenRuns.variableName2= ''; | |
1282 betweenRuns.variableList2= []; | |
1283 betweenRuns.var1Sequence= []; | |
1284 betweenRuns.var2Sequence= []; | |
1285 betweenRuns.randomizeSequence=[]; | |
1286 betweenRuns.timeNow= []; | |
1287 betweenRuns.runNumber= []; | |
1288 % betweenRuns.variableCount1= []; | |
1289 % betweenRuns.variableCount2= []; | |
1290 betweenRuns.thresholds= []; | |
1291 betweenRuns.forceThresholds= []; | |
1292 betweenRuns.observationCount= []; | |
1293 betweenRuns.timesOfFirstReversals= []; | |
1294 betweenRuns.bestThresholdTracks=''; | |
1295 betweenRuns.levelTracks=''; | |
1296 betweenRuns.responseTracks=''; | |
1297 betweenRuns.slopeKTracks= []; | |
1298 betweenRuns.gainTracks= []; | |
1299 betweenRuns.VminTracks= []; | |
1300 betweenRuns.bestGain= []; | |
1301 betweenRuns.bestVMin= []; | |
1302 betweenRuns.bestPaMin= []; | |
1303 betweenRuns.bestLogisticM= []; | |
1304 betweenRuns.bestLogisticK= []; | |
1305 betweenRuns.psychometicFunction=''; | |
1306 betweenRuns.catchTrials= []; | |
1307 betweenRuns.caughtOut= []; | |
1308 | |
1309 withinRuns=[]; | |
1310 withinRuns.trialNumber=[]; | |
1311 withinRuns.nowInPhase2=0; | |
1312 withinRuns.beginningOfPhase2=0; | |
1313 withinRuns.variableValue=[]; | |
1314 withinRuns.direction=''; | |
1315 withinRuns.peaks=[]; | |
1316 withinRuns.troughs= []; | |
1317 withinRuns.levelList= []; | |
1318 withinRuns.responseList= []; | |
1319 withinRuns.meanEstTrack= []; | |
1320 withinRuns.meanLogisticEstTrack=[]; | |
1321 withinRuns.bestSlopeK= []; | |
1322 withinRuns.bestGain= []; | |
1323 withinRuns.bestVMin= []; | |
1324 withinRuns.forceThreshold=[]; | |
1325 withinRuns.catchTrial= []; | |
1326 withinRuns.caughtOut=[]; | |
1327 withinRuns.catchTrialCount=[]; | |
1328 withinRuns.wrongButton= []; | |
1329 withinRuns.babblePlaying=0; | |
1330 | |
1331 % --- Executes on selection change in popupmenuBackgroundType. | |
1332 function popupmenuBackgroundType_Callback(hObject, eventdata, handles) | |
1333 global backgroundTypes | |
1334 option=get(handles.popupmenuBackgroundType,'value'); | |
1335 selectedBackground=backgroundTypes{option}; | |
1336 stimulusParameters.backgroundType=selectedBackground; | |
1337 | |
1338 switch selectedBackground | |
1339 case 'none' | |
1340 set(handles.editBackgroundLevel,'visible','off') | |
1341 set(handles.textBGlevel,'visible','off') | |
1342 otherwise | |
1343 set(handles.editBackgroundLevel,'visible','on') | |
1344 set(handles.textBGlevel,'visible','on') | |
1345 end | |
1346 | |
1347 | |
1348 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
1349 function pushbuttonStop_Callback(hObject, eventdata, handles) | |
1350 global experiment | |
1351 experiment.stop=1; | |
1352 disp('stop!') | |
1353 set(handles.pushbuttonStop, 'backgroundColor','r') | |
1354 pause(.1) | |
1355 drawnow | |
1356 | |
1357 function pushbuttonOME_Callback(hObject, eventdata, handles) | |
1358 aReadAndCheckParameterBoxes(handles); | |
1359 testOME | |
1360 | |
1361 function pushbuttonBM_Callback(hObject, eventdata, handles) | |
1362 global stimulusParameters experiment | |
1363 aReadAndCheckParameterBoxes(handles); | |
1364 testBM(stimulusParameters.targetFrequency, experiment.name); | |
1365 | |
1366 function pushbuttonAN_Callback(hObject, eventdata, handles) | |
1367 global stimulusParameters | |
1368 aReadAndCheckParameterBoxes(handles); | |
1369 % now carry out tests | |
1370 showPSTHs=0; | |
1371 targetFrequency=stimulusParameters.targetFrequency(1); | |
1372 BFlist=targetFrequency; | |
1373 | |
1374 testAN(targetFrequency,BFlist); | |
1375 | |
1376 function pushbuttonPhLk_Callback(hObject, eventdata, handles) | |
1377 aReadAndCheckParameterBoxes(handles); | |
1378 testPhaseLocking | |
1379 | |
1380 function pushbuttonSYN_Callback(hObject, eventdata, handles) | |
1381 aReadAndCheckParameterBoxes(handles); | |
1382 testSynapse | |
1383 | |
1384 function pushbuttonFM_Callback(hObject, eventdata, handles) | |
1385 aReadAndCheckParameterBoxes(handles); | |
1386 testFM | |
1387 | |
1388 function popupmenuPhase_Callback(hObject, eventdata, handles) | |
1389 global stimulusParameters | |
1390 | |
1391 optionNo=get(handles.popupmenuPhase,'value'); | |
1392 options=get(handles.popupmenuPhase,'string'); | |
1393 phase=options{optionNo}; | |
1394 stimulusParameters.maskerPhase=phase; | |
1395 stimulusParameters.targetPhase=phase; | |
1396 | |
1397 function pushbuttonParams_Callback(hObject, eventdata, handles) | |
1398 global experiment stimulusParameters | |
1399 aReadAndCheckParameterBoxes(handles); | |
1400 % print model parameters using the 'name' box (e.g. CTa -> MAPparamsCTa) | |
1401 showParams=1; BFlist=-1; | |
1402 paramFunctionName=['method=MAPparams' experiment.name ... | |
1403 '(BFlist, stimulusParameters.sampleRate, showParams);']; | |
1404 eval(paramFunctionName) % go and fetch the parameters requesting parameter printout | |
1405 | |
1406 | |
1407 % --- Executes on button press in pushbuttonRP. | |
1408 function pushbuttonRP_Callback(hObject, eventdata, handles) | |
1409 global experiment stimulusParameters | |
1410 aReadAndCheckParameterBoxes(handles); | |
1411 % now carry out test | |
1412 testRP(stimulusParameters.targetFrequency,experiment.name) | |
1413 | |
1414 % function handles % ?? | |
1415 | |
1416 | |
1417 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
1418 | |
1419 function editmaskerDuration_Callback(hObject, eventdata, handles) | |
1420 | |
1421 function editmaskerDuration_CreateFcn(hObject, eventdata, handles) | |
1422 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1423 set(hObject,'BackgroundColor','white'); | |
1424 end | |
1425 | |
1426 function editmaskerLevel_Callback(hObject, eventdata, handles) | |
1427 | |
1428 function editmaskerLevel_CreateFcn(hObject, eventdata, handles) | |
1429 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1430 set(hObject,'BackgroundColor','white'); | |
1431 end | |
1432 | |
1433 function editmaskerRelativeFrequency_Callback(hObject, eventdata, handles) | |
1434 | |
1435 function editmaskerRelativeFrequency_CreateFcn(hObject, eventdata, handles) | |
1436 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1437 set(hObject,'BackgroundColor','white'); | |
1438 end | |
1439 | |
1440 function editWRVstartValues_Callback(hObject, eventdata, handles) | |
1441 | |
1442 function editWRVstartValues_CreateFcn(hObject, eventdata, handles) | |
1443 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1444 set(hObject,'BackgroundColor','white'); | |
1445 end | |
1446 | |
1447 function editgapDuration_Callback(hObject, eventdata, handles) | |
1448 | |
1449 function editgapDuration_CreateFcn(hObject, eventdata, handles) | |
1450 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1451 set(hObject,'BackgroundColor','white'); | |
1452 end | |
1453 | |
1454 function edittargetDuration_Callback(hObject, eventdata, handles) | |
1455 | |
1456 function edittargetDuration_CreateFcn(hObject, eventdata, handles) | |
1457 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1458 set(hObject,'BackgroundColor','white'); | |
1459 end | |
1460 | |
1461 function edittargetLevel_Callback(hObject, eventdata, handles) | |
1462 | |
1463 function edittargetLevel_CreateFcn(hObject, eventdata, handles) | |
1464 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1465 set(hObject,'BackgroundColor','white'); | |
1466 end | |
1467 | |
1468 function editrampDuration_Callback(hObject, eventdata, handles) | |
1469 | |
1470 function editrampDuration_CreateFcn(hObject, eventdata, handles) | |
1471 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1472 set(hObject,'BackgroundColor','white'); | |
1473 end | |
1474 | |
1475 function editcueTestDifference_Callback(hObject, eventdata, handles) | |
1476 | |
1477 function editcueTestDifference_CreateFcn(hObject, eventdata, handles) | |
1478 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1479 set(hObject,'BackgroundColor','white'); | |
1480 end | |
1481 | |
1482 | |
1483 function editWRVsteps_Callback(hObject, eventdata, handles) | |
1484 | |
1485 function editWRVsteps_CreateFcn(hObject, eventdata, handles) | |
1486 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1487 set(hObject,'BackgroundColor','white'); | |
1488 end | |
1489 | |
1490 function editWRVlimits_Callback(hObject, eventdata, handles) | |
1491 | |
1492 function editWRVlimits_CreateFcn(hObject, eventdata, handles) | |
1493 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1494 set(hObject,'BackgroundColor','white'); | |
1495 end | |
1496 | |
1497 function edittargetFrequency_Callback(hObject, eventdata, handles) | |
1498 | |
1499 function edittargetFrequency_CreateFcn(hObject, eventdata, handles) | |
1500 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1501 set(hObject,'BackgroundColor','white'); | |
1502 end | |
1503 | |
1504 function editName_Callback(hObject, eventdata, handles) | |
1505 | |
1506 function editName_CreateFcn(hObject, eventdata, handles) | |
1507 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1508 set(hObject,'BackgroundColor','white'); | |
1509 end | |
1510 | |
1511 function editcalibrationdB_Callback(hObject, eventdata, handles) | |
1512 | |
1513 function editcalibrationdB_CreateFcn(hObject, eventdata, handles) | |
1514 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1515 set(hObject,'BackgroundColor','white'); | |
1516 end | |
1517 | |
1518 function editMAPplot_Callback(hObject, eventdata, handles) | |
1519 | |
1520 function editMAPplot_CreateFcn(hObject, eventdata, handles) | |
1521 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1522 set(hObject,'BackgroundColor','white'); | |
1523 end | |
1524 | |
1525 function editMsgFont_Callback(hObject, eventdata, handles) | |
1526 | |
1527 function editMsgFont_CreateFcn(hObject, eventdata, handles) | |
1528 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1529 set(hObject,'BackgroundColor','white'); | |
1530 end | |
1531 | |
1532 function editCatchTrialRate_Callback(hObject, eventdata, handles) | |
1533 | |
1534 function editCatchTrialRate_CreateFcn(hObject, eventdata, handles) | |
1535 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1536 set(hObject,'BackgroundColor','white'); | |
1537 end | |
1538 | |
1539 | |
1540 function editSaveData_Callback(hObject, eventdata, handles) | |
1541 | |
1542 function editSaveData_CreateFcn(hObject, eventdata, handles) | |
1543 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1544 set(hObject,'BackgroundColor','white'); | |
1545 end | |
1546 | |
1547 function editStatsModel_Callback(hObject, eventdata, handles) | |
1548 | |
1549 function editStatsModel_CreateFcn(hObject, eventdata, handles) | |
1550 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1551 set(hObject,'BackgroundColor','white'); | |
1552 end | |
1553 | |
1554 function editBackgroundLevel_Callback(hObject, eventdata, handles) | |
1555 | |
1556 function editBackgroundLevel_CreateFcn(hObject, eventdata, handles) | |
1557 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1558 set(hObject,'BackgroundColor','white'); | |
1559 end | |
1560 | |
1561 function editPrintTracks_Callback(hObject, eventdata, handles) | |
1562 | |
1563 function editPrintTracks_CreateFcn(hObject, eventdata, handles) | |
1564 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1565 set(hObject,'BackgroundColor','white'); | |
1566 end | |
1567 | |
1568 function editstopCriteriaBox_Callback(hObject, eventdata, handles) | |
1569 | |
1570 function editstopCriteriaBox_CreateFcn(hObject, eventdata, handles) | |
1571 | |
1572 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1573 set(hObject,'BackgroundColor','white'); | |
1574 end | |
1575 | |
1576 function editstimulusDelay_Callback(hObject, eventdata, handles) | |
1577 | |
1578 function editstimulusDelay_CreateFcn(hObject, eventdata, handles) | |
1579 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1580 set(hObject,'BackgroundColor','white'); | |
1581 end | |
1582 | |
1583 | |
1584 function popupmenuCueNoCue_CreateFcn(hObject, eventdata, handles) | |
1585 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1586 set(hObject,'BackgroundColor','white'); | |
1587 end | |
1588 | |
1589 function popupmenuEar_CreateFcn(hObject, eventdata, handles) | |
1590 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1591 set(hObject,'BackgroundColor','red'); | |
1592 end | |
1593 | |
1594 function popupmenuVaryParameter1_Callback(hObject, eventdata, handles) | |
1595 | |
1596 function popupmenuVaryParameter1_CreateFcn(hObject, eventdata, handles) | |
1597 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1598 set(hObject,'BackgroundColor','white'); | |
1599 end | |
1600 | |
1601 function popupmenuVaryParameter2_Callback(hObject, eventdata, handles) | |
1602 | |
1603 function popupmenuVaryParameter2_CreateFcn(hObject, eventdata, handles) | |
1604 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1605 set(hObject,'BackgroundColor','white'); | |
1606 end | |
1607 | |
1608 function popupmenuRandomize_Callback(hObject, eventdata, handles) | |
1609 | |
1610 function popupmenuRandomize_CreateFcn(hObject, eventdata, handles) | |
1611 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1612 set(hObject,'BackgroundColor','white'); | |
1613 end | |
1614 | |
1615 function popupmenuParadigm_CreateFcn(hObject, eventdata, handles) | |
1616 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1617 set(hObject,'BackgroundColor','white'); | |
1618 end | |
1619 | |
1620 | |
1621 function popupmenuMaskerType_CreateFcn(hObject, eventdata, handles) | |
1622 | |
1623 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1624 set(hObject,'BackgroundColor','white'); | |
1625 end | |
1626 | |
1627 | |
1628 function popupmenuThreshEst_CreateFcn(hObject, eventdata, handles) | |
1629 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1630 set(hObject,'BackgroundColor','white'); | |
1631 end | |
1632 | |
1633 function popupmenuBackgroundType_CreateFcn(hObject, eventdata, handles) | |
1634 | |
1635 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1636 set(hObject,'BackgroundColor','white'); | |
1637 end | |
1638 | |
1639 | |
1640 function popupmenuTargetType_CreateFcn(hObject, eventdata, handles) | |
1641 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1642 set(hObject,'BackgroundColor','white'); | |
1643 end | |
1644 | |
1645 function editSubjectFont_Callback(hObject, eventdata, handles) | |
1646 | |
1647 function editSubjectFont_CreateFcn(hObject, eventdata, handles) | |
1648 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1649 set(hObject,'BackgroundColor','white'); | |
1650 end | |
1651 | |
1652 function editMusicLevel_Callback(hObject, eventdata, handles) | |
1653 | |
1654 function editMusicLevel_CreateFcn(hObject, eventdata, handles) | |
1655 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1656 set(hObject,'BackgroundColor','white'); | |
1657 end | |
1658 | |
1659 function figure1_ButtonDownFcn(hObject, eventdata, handles) | |
1660 | |
1661 | |
1662 function edit33_Callback(hObject, eventdata, handles) | |
1663 | |
1664 function edit33_CreateFcn(hObject, eventdata, handles) | |
1665 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1666 set(hObject,'BackgroundColor','white'); | |
1667 end | |
1668 | |
1669 | |
1670 function popupmenuPhase_CreateFcn(hObject, eventdata, handles) | |
1671 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1672 set(hObject,'BackgroundColor','white'); | |
1673 end | |
1674 | |
1675 function editsegSize_Callback(hObject, eventdata, handles) | |
1676 | |
1677 function editsegSize_CreateFcn(hObject, eventdata, handles) | |
1678 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1679 set(hObject,'BackgroundColor','white'); | |
1680 end | |
1681 | |
1682 | |
1683 function editnumOHIOtones_Callback(hObject, eventdata, handles) | |
1684 % hObject handle to editnumOHIOtones (see GCBO) | |
1685 % eventdata reserved - to be defined in a future version of MATLAB | |
1686 % handles structure with handles and user data (see GUIDATA) | |
1687 | |
1688 % Hints: get(hObject,'String') returns contents of editnumOHIOtones as text | |
1689 % str2double(get(hObject,'String')) returns contents of editnumOHIOtones as a double | |
1690 | |
1691 | |
1692 % --- Executes during object creation, after setting all properties. | |
1693 function editnumOHIOtones_CreateFcn(hObject, eventdata, handles) | |
1694 % hObject handle to editnumOHIOtones (see GCBO) | |
1695 % eventdata reserved - to be defined in a future version of MATLAB | |
1696 % handles empty - handles not created until after all CreateFcns called | |
1697 | |
1698 % Hint: edit controls usually have a white background on Windows. | |
1699 % See ISPC and COMPUTER. | |
1700 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) | |
1701 set(hObject,'BackgroundColor','white'); | |
1702 end | |
1703 | |
1704 | |
1705 |