To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

The primary repository for this project is hosted at git://github.com/rmeddis/MAP.git .
This repository is a read-only copy which is updated automatically every hour.

Statistics Download as Zip
| Branch: | Revision:

root / multithreshold 1.46 / expGUI_MT.m @ 29:b51bf546ca3f

History | View | Annotate | Download (64.3 KB)

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