Revision 28:02aa9826efe0 multithreshold 1.46/expGUI_MT.m

View differences:

multithreshold 1.46/expGUI_MT.m
46 46

  
47 47
% Edit the above text to modify the response to help expGUI_MT
48 48

  
49
% Last Modified by GUIDE v2.5 29-May-2011 16:02:02
49
% Last Modified by GUIDE v2.5 25-Jun-2011 21:41:35
50 50

  
51 51
% Begin initialization code - DO NOT EDIT
52 52
gui_Singleton = 1;
......
610 610
% ------------------------------------------------ pushbuttonRun_Callback
611 611
function pushbuttonRun_Callback(hObject, eventdata, handles)
612 612
global checkForPreviousGUI % holds screen positioning across repeated calls 
613
global experiment betweenRuns paradigmNames
613
global experiment betweenRuns paradigmNames errormsg
614 614
checkForPreviousGUI.GUIposition=get(handles.figure1,'position');
615 615
experiment.singleShot=0;
616 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'
617
    case 'profile'
640 618
        %% special option for two successive and linked measurements
641 619
        clc
642 620
        experiment.paradigm='threshold_16ms';
643 621
        set(handles.edittargetDuration,'string', num2str(0.25))
644
        set(handles.editstopCriteriaBox,'string','30') % nTrials
622
        set(handles.editstopCriteriaBox,'string','10') % nTrials
645 623
        run (handles)
646 624
        
625
        if ~isempty(errormsg)
626
            disp(errormsg)
627
            optionNo=strmatch('profile',paradigmNames);
628
            set(handles.popupmenuParadigm,'value',optionNo);
629
            experiment.paradigm='profile';
630
            aParadigmSelection(handles)
631
            return
632
        end
633
        
634
        global resultsTable
635
        longTone=resultsTable(2:end,2:end);
636
        
647 637
        set(handles.edittargetDuration,'string', num2str(0.016))
648
        set(handles.editstopCriteriaBox,'string','30') % nTrials
638
        set(handles.editstopCriteriaBox,'string','10') % nTrials
649 639
        run (handles)
640
        if ~isempty(errormsg)
641
            disp(errormsg)
642
            optionNo=strmatch('profile',paradigmNames);
643
            set(handles.popupmenuParadigm,'value',optionNo);
644
            experiment.paradigm='profile';
645
            experiment.stop=-0;
646
            aParadigmSelection(handles)
647
            return
648
        end
649
        
650
        shortTone=resultsTable(2:end,2:end);
650 651

  
651 652
        % use these threshold for TMC
652 653
        thresholds16ms=betweenRuns.thresholds;
653
        optionNo=strmatch('TMC_16ms',paradigmNames);
654
        optionNo=strmatch('TMC',paradigmNames);
654 655
        set(handles.popupmenuParadigm,'value',optionNo);
655 656
        aParadigmSelection(handles)
656 657
        set(handles.edittargetLevel,'string', thresholds16ms+10);
657
        set(handles.editstopCriteriaBox,'string','30')  % nTrials
658
        set(handles.editstopCriteriaBox,'string','10')  % nTrials
658 659
        pause(.1) 
659 660
        run (handles)
660 661
        
662
        if ~isempty(errormsg)
663
            disp(errormsg)
664
            optionNo=strmatch('profile',paradigmNames);
665
            set(handles.popupmenuParadigm,'value',optionNo);
666
            experiment.paradigm='profile';
667
            experiment.stop=-0;
668
            aParadigmSelection(handles)
669
            return
670
        end
671

  
672
        TMC=resultsTable(2:end,2:end);
673
        gaps=resultsTable(2:end,1);
674
        BFs=resultsTable(1, 2:end);
675
        
676
        % use these threshold for IFMC
677
        optionNo=strmatch('IFMC',paradigmNames);
678
        set(handles.popupmenuParadigm,'value',optionNo);
679
        aParadigmSelection(handles)
680
        set(handles.edittargetLevel,'string', thresholds16ms+10);
681
        set(handles.editstopCriteriaBox,'string','10')  % nTrials
682
        pause(.1) 
683
        run (handles)
684

  
685
        if ~isempty(errormsg)
686
            disp(errormsg)
687
            optionNo=strmatch('profile',paradigmNames);
688
            set(handles.popupmenuParadigm,'value',optionNo);
689
            experiment.paradigm='profile';
690
            experiment.stop=-0;
691
            aParadigmSelection(handles)
692
            return
693
        end       
694

  
695
        IFMCs=resultsTable(2:end,2:end);
696
        offBFs=resultsTable(2:end,1);
697
        
661 698
        % reset original paradigm
662
        optionNo=strmatch('thr_TMC',paradigmNames);
699
        optionNo=strmatch('profile',paradigmNames);
663 700
        set(handles.popupmenuParadigm,'value',optionNo);
664 701
        aParadigmSelection(handles)
665 702

  
703
        save profile longTone shortTone gaps BFs TMC offBFs IFMCs
704
        plotProfile(longTone,shortTone,gaps,BFs,TMC,offBFs,IFMCs)
705
        
666 706
    otherwise
667 707
        run (handles)
668 708
        experiment.stop=0;
......
673 713
tic
674 714
expGUIhandles=handles;
675 715
set(handles.pushbuttonStop, 'backgroundColor', [.941 .941 .941])
716
set(handles.editparamChanges,'visible','off')
676 717

  
677 718
% message box white (removes any previous error message)
678 719
set(handles.textMSG,...
......
1030 1071
option=get(handles.popupmenuEar,'value');
1031 1072
options=get(handles.popupmenuEar,'string');			% left/right/model
1032 1073
experiment.ear=options{option};
1074
set(handles.editparamChanges,'visible','off')
1033 1075
switch experiment.ear
1034 1076
    case 'statsModelLogistic'
1035 1077
        set(handles.editStatsModel,'string', '15, 0.5')
1036 1078
    case 'statsModelRareEvent'
1037 1079
        set(handles.editStatsModel,'string', '20 1')
1080
    case {'MAPmodelListen',  'MAPmodelMultiCh', 'MAPmodelSingleCh'}
1081
        set(handles.editparamChanges,'visible','on')
1038 1082
end
1039 1083
earSetUp(handles)
1040 1084

  
......
1355 1399
drawnow
1356 1400

  
1357 1401
function pushbuttonOME_Callback(hObject, eventdata, handles)
1402
global experiment
1358 1403
aReadAndCheckParameterBoxes(handles);
1359
testOME
1404
testOME(experiment.name);
1360 1405

  
1361 1406
function pushbuttonBM_Callback(hObject, eventdata, handles)
1362 1407
global  stimulusParameters experiment
1363 1408
aReadAndCheckParameterBoxes(handles);
1364
testBM(stimulusParameters.targetFrequency, experiment.name);
1409
relativeFrequencies=[0.25    .5   .75  1  1.25 1.5    2];
1410

  
1411
testBM(stimulusParameters.targetFrequency, ...
1412
    experiment.name,relativeFrequencies);
1365 1413

  
1366 1414
function pushbuttonAN_Callback(hObject, eventdata, handles)
1367 1415
global stimulusParameters
......
1382 1430
testSynapse
1383 1431

  
1384 1432
function pushbuttonFM_Callback(hObject, eventdata, handles)
1433
global stimulusParameters experiment
1385 1434
aReadAndCheckParameterBoxes(handles);
1386
testFM
1435
showPSTHs=1;
1436
testFM(stimulusParameters.targetFrequency(1),experiment.name, showPSTHs)
1387 1437

  
1388 1438
function popupmenuPhase_Callback(hObject, eventdata, handles)
1389 1439
global stimulusParameters
......
1399 1449
aReadAndCheckParameterBoxes(handles);
1400 1450
% print model parameters using the 'name' box (e.g. CTa -> MAPparamsCTa)
1401 1451
showParams=1; BFlist=-1;
1452
paramChanges=get(handles.editparamChanges,'string');
1453
eval(paramChanges)
1454

  
1402 1455
paramFunctionName=['method=MAPparams' experiment.name ...
1403
    '(BFlist, stimulusParameters.sampleRate, showParams);'];
1456
    '(BFlist, stimulusParameters.sampleRate, showParams,paramChanges);'];
1404 1457
eval(paramFunctionName) % go and fetch the parameters requesting parameter printout
1405 1458

  
1406 1459

  
......
1703 1756

  
1704 1757

  
1705 1758
    
1759

  
1760

  
1761
function editparamChanges_Callback(hObject, eventdata, handles)
1762

  
1763

  
1764
function editparamChanges_CreateFcn(hObject, eventdata, handles)
1765

  
1766
% Hint: edit controls usually have a white background on Windows.
1767
%       See ISPC and COMPUTER.
1768
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
1769
    set(hObject,'BackgroundColor','white');
1770
end
1771

  
1772

  

Also available in: Unified diff