comparison 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 fafe69c43108
children b51bf546ca3f
comparison
equal deleted inserted replaced
27:d4a7675b0413 28:02aa9826efe0
44 % 44 %
45 % See also: GUIDE, GUIDATA, GUIHANDLES 45 % See also: GUIDE, GUIDATA, GUIHANDLES
46 46
47 % Edit the above text to modify the response to help expGUI_MT 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 % Begin initialization code - DO NOT EDIT 51 % Begin initialization code - DO NOT EDIT
52 gui_Singleton = 1; 52 gui_Singleton = 1;
53 gui_State = struct('gui_Name', mfilename, ... 53 gui_State = struct('gui_Name', mfilename, ...
54 'gui_Singleton', gui_Singleton, ... 54 'gui_Singleton', gui_Singleton, ...
608 end 608 end
609 609
610 % ------------------------------------------------ pushbuttonRun_Callback 610 % ------------------------------------------------ pushbuttonRun_Callback
611 function pushbuttonRun_Callback(hObject, eventdata, handles) 611 function pushbuttonRun_Callback(hObject, eventdata, handles)
612 global checkForPreviousGUI % holds screen positioning across repeated calls 612 global checkForPreviousGUI % holds screen positioning across repeated calls
613 global experiment betweenRuns paradigmNames 613 global experiment betweenRuns paradigmNames errormsg
614 checkForPreviousGUI.GUIposition=get(handles.figure1,'position'); 614 checkForPreviousGUI.GUIposition=get(handles.figure1,'position');
615 experiment.singleShot=0; 615 experiment.singleShot=0;
616 switch experiment.paradigm 616 switch experiment.paradigm
617 case 'thr_IFMC' 617 case 'profile'
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 618 %% special option for two successive and linked measurements
641 clc 619 clc
642 experiment.paradigm='threshold_16ms'; 620 experiment.paradigm='threshold_16ms';
643 set(handles.edittargetDuration,'string', num2str(0.25)) 621 set(handles.edittargetDuration,'string', num2str(0.25))
644 set(handles.editstopCriteriaBox,'string','30') % nTrials 622 set(handles.editstopCriteriaBox,'string','10') % nTrials
645 run (handles) 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 set(handles.edittargetDuration,'string', num2str(0.016)) 637 set(handles.edittargetDuration,'string', num2str(0.016))
648 set(handles.editstopCriteriaBox,'string','30') % nTrials 638 set(handles.editstopCriteriaBox,'string','10') % nTrials
649 run (handles) 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 % use these threshold for TMC 652 % use these threshold for TMC
652 thresholds16ms=betweenRuns.thresholds; 653 thresholds16ms=betweenRuns.thresholds;
653 optionNo=strmatch('TMC_16ms',paradigmNames); 654 optionNo=strmatch('TMC',paradigmNames);
654 set(handles.popupmenuParadigm,'value',optionNo); 655 set(handles.popupmenuParadigm,'value',optionNo);
655 aParadigmSelection(handles) 656 aParadigmSelection(handles)
656 set(handles.edittargetLevel,'string', thresholds16ms+10); 657 set(handles.edittargetLevel,'string', thresholds16ms+10);
657 set(handles.editstopCriteriaBox,'string','30') % nTrials 658 set(handles.editstopCriteriaBox,'string','10') % nTrials
658 pause(.1) 659 pause(.1)
659 run (handles) 660 run (handles)
660 661
661 % reset original paradigm 662 if ~isempty(errormsg)
662 optionNo=strmatch('thr_TMC',paradigmNames); 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);
663 set(handles.popupmenuParadigm,'value',optionNo); 678 set(handles.popupmenuParadigm,'value',optionNo);
664 aParadigmSelection(handles) 679 aParadigmSelection(handles)
665 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
698 % reset original paradigm
699 optionNo=strmatch('profile',paradigmNames);
700 set(handles.popupmenuParadigm,'value',optionNo);
701 aParadigmSelection(handles)
702
703 save profile longTone shortTone gaps BFs TMC offBFs IFMCs
704 plotProfile(longTone,shortTone,gaps,BFs,TMC,offBFs,IFMCs)
705
666 otherwise 706 otherwise
667 run (handles) 707 run (handles)
668 experiment.stop=0; 708 experiment.stop=0;
669 end 709 end
670 710
671 function run (handles) 711 function run (handles)
672 global experiment expGUIhandles stimulusParameters 712 global experiment expGUIhandles stimulusParameters
673 tic 713 tic
674 expGUIhandles=handles; 714 expGUIhandles=handles;
675 set(handles.pushbuttonStop, 'backgroundColor', [.941 .941 .941]) 715 set(handles.pushbuttonStop, 'backgroundColor', [.941 .941 .941])
716 set(handles.editparamChanges,'visible','off')
676 717
677 % message box white (removes any previous error message) 718 % message box white (removes any previous error message)
678 set(handles.textMSG,... 719 set(handles.textMSG,...
679 'backgroundcolor', 'w', 'ForegroundColor', 'b', 'string', '') 720 'backgroundcolor', 'w', 'ForegroundColor', 'b', 'string', '')
680 721
1028 function popupmenuEar_Callback(hObject, eventdata, handles) 1069 function popupmenuEar_Callback(hObject, eventdata, handles)
1029 global experiment 1070 global experiment
1030 option=get(handles.popupmenuEar,'value'); 1071 option=get(handles.popupmenuEar,'value');
1031 options=get(handles.popupmenuEar,'string'); % left/right/model 1072 options=get(handles.popupmenuEar,'string'); % left/right/model
1032 experiment.ear=options{option}; 1073 experiment.ear=options{option};
1074 set(handles.editparamChanges,'visible','off')
1033 switch experiment.ear 1075 switch experiment.ear
1034 case 'statsModelLogistic' 1076 case 'statsModelLogistic'
1035 set(handles.editStatsModel,'string', '15, 0.5') 1077 set(handles.editStatsModel,'string', '15, 0.5')
1036 case 'statsModelRareEvent' 1078 case 'statsModelRareEvent'
1037 set(handles.editStatsModel,'string', '20 1') 1079 set(handles.editStatsModel,'string', '20 1')
1080 case {'MAPmodelListen', 'MAPmodelMultiCh', 'MAPmodelSingleCh'}
1081 set(handles.editparamChanges,'visible','on')
1038 end 1082 end
1039 earSetUp(handles) 1083 earSetUp(handles)
1040 1084
1041 % -------------------------------------------- earSetUp 1085 % -------------------------------------------- earSetUp
1042 function earSetUp(handles) 1086 function earSetUp(handles)
1353 set(handles.pushbuttonStop, 'backgroundColor','r') 1397 set(handles.pushbuttonStop, 'backgroundColor','r')
1354 pause(.1) 1398 pause(.1)
1355 drawnow 1399 drawnow
1356 1400
1357 function pushbuttonOME_Callback(hObject, eventdata, handles) 1401 function pushbuttonOME_Callback(hObject, eventdata, handles)
1402 global experiment
1358 aReadAndCheckParameterBoxes(handles); 1403 aReadAndCheckParameterBoxes(handles);
1359 testOME 1404 testOME(experiment.name);
1360 1405
1361 function pushbuttonBM_Callback(hObject, eventdata, handles) 1406 function pushbuttonBM_Callback(hObject, eventdata, handles)
1362 global stimulusParameters experiment 1407 global stimulusParameters experiment
1363 aReadAndCheckParameterBoxes(handles); 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 function pushbuttonAN_Callback(hObject, eventdata, handles) 1414 function pushbuttonAN_Callback(hObject, eventdata, handles)
1367 global stimulusParameters 1415 global stimulusParameters
1368 aReadAndCheckParameterBoxes(handles); 1416 aReadAndCheckParameterBoxes(handles);
1369 % now carry out tests 1417 % now carry out tests
1380 function pushbuttonSYN_Callback(hObject, eventdata, handles) 1428 function pushbuttonSYN_Callback(hObject, eventdata, handles)
1381 aReadAndCheckParameterBoxes(handles); 1429 aReadAndCheckParameterBoxes(handles);
1382 testSynapse 1430 testSynapse
1383 1431
1384 function pushbuttonFM_Callback(hObject, eventdata, handles) 1432 function pushbuttonFM_Callback(hObject, eventdata, handles)
1433 global stimulusParameters experiment
1385 aReadAndCheckParameterBoxes(handles); 1434 aReadAndCheckParameterBoxes(handles);
1386 testFM 1435 showPSTHs=1;
1436 testFM(stimulusParameters.targetFrequency(1),experiment.name, showPSTHs)
1387 1437
1388 function popupmenuPhase_Callback(hObject, eventdata, handles) 1438 function popupmenuPhase_Callback(hObject, eventdata, handles)
1389 global stimulusParameters 1439 global stimulusParameters
1390 1440
1391 optionNo=get(handles.popupmenuPhase,'value'); 1441 optionNo=get(handles.popupmenuPhase,'value');
1397 function pushbuttonParams_Callback(hObject, eventdata, handles) 1447 function pushbuttonParams_Callback(hObject, eventdata, handles)
1398 global experiment stimulusParameters 1448 global experiment stimulusParameters
1399 aReadAndCheckParameterBoxes(handles); 1449 aReadAndCheckParameterBoxes(handles);
1400 % print model parameters using the 'name' box (e.g. CTa -> MAPparamsCTa) 1450 % print model parameters using the 'name' box (e.g. CTa -> MAPparamsCTa)
1401 showParams=1; BFlist=-1; 1451 showParams=1; BFlist=-1;
1452 paramChanges=get(handles.editparamChanges,'string');
1453 eval(paramChanges)
1454
1402 paramFunctionName=['method=MAPparams' experiment.name ... 1455 paramFunctionName=['method=MAPparams' experiment.name ...
1403 '(BFlist, stimulusParameters.sampleRate, showParams);']; 1456 '(BFlist, stimulusParameters.sampleRate, showParams,paramChanges);'];
1404 eval(paramFunctionName) % go and fetch the parameters requesting parameter printout 1457 eval(paramFunctionName) % go and fetch the parameters requesting parameter printout
1405 1458
1406 1459
1407 % --- Executes on button press in pushbuttonRP. 1460 % --- Executes on button press in pushbuttonRP.
1408 function pushbuttonRP_Callback(hObject, eventdata, handles) 1461 function pushbuttonRP_Callback(hObject, eventdata, handles)
1701 set(hObject,'BackgroundColor','white'); 1754 set(hObject,'BackgroundColor','white');
1702 end 1755 end
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