function ui_main(varargin) DEFAULT.selectedSubject = 1; DEFAULT.smoothed = 1; DEFAULT.multisubject = 'single'; DEFAULT.pststart = -15; DEFAULT.pstend = 40; DEFAULT.baselinestart = -3; DEFAULT.baselineend = -1; DEFAULT.frameshiftstart = -5; DEFAULT.frameshiftend = 35; DEFAULT.frameshiftdur = 0; DEFAULT.classdefstring = 'left,\t[9,11,13]\nright,\t[10,12,14]'; DEFAULT.voxelstring = 'SPL l + [ 0, 0, 0] \nSPL r + [ 0, 0, 0]\n'; DEFAULT.svmoptstring = '-s 0 -t 0 -v 6 -c 1'; DEFAULT.searchlightradius = 3; % Initialize and hide the GUI as it is being constructed. frameWidth=450; frameHeight=600; frame = figure('Visible','off','Position',[0,0,frameWidth,frameHeight]); movegui(frame,'west'); % get this thing visible on smaller displays. set(frame,'Name','SVMCrossVal Decode Performance 4 SPM'); set(frame,'NumberTitle','off'); set(frame,'MenuBar','none'); set(frame,'Color',get(0,'defaultUicontrolBackgroundColor')); set(frame,'Resize','off'); set(frame,'Units','normalized'); pFirstStep = uipanel(frame,'Title','Preprocessing','Position',[0 0.4 1 0.6]); set(pFirstStep,'BackgroundColor','w'); set(pFirstStep,'Units','normalized'); model = createFirstStepPanel(pFirstStep,DEFAULT); assignin('base','model',model); %Classification Step secondStepBaseColor = [0.7 0.7 0.0 ]; pSecondStep = uipanel(frame,'Title','Classification','Position',[0 0 1 0.4]); set(pSecondStep,'BackgroundColor',secondStepBaseColor); model2 = createSecondStepPanel(pSecondStep,DEFAULT,secondStepBaseColor); assignin('base','model2',model2); set(frame,'Visible','on'); end function model = createSecondStepPanel(parent,DEFAULT,basecolor) pSVM = uipanel(parent,'Units','normalized','Position',[0 0 0.5 0.9]); set(pSVM,'Title','SVM Classification'); set(pSVM,'BackgroundColor',basecolor); model.txtSVMopts = createTextField(pSVM,[0 0.9 1 0.1],DEFAULT.svmoptstring); set(model.txtSVMopts,'Enable','on'); %inactive set(model.txtSVMopts,'HorizontalAlignment','left'); pSOM = uipanel(parent,'Units','normalized','Position',[0.5 0 0.5 0.9]); set(pSOM,'Title','SVM Classification'); set(pSOM,'BackgroundColor',basecolor); end function model = createFirstStepPanel(parent,DEFAULT) x1 = 0; x2 = 0.4; x3 = 1; y1 = 1; y2 = 0.6; y3 = 0.4; y4 = 0.2; y5 = 0; %Subjects subjectList = {'Subj1','Subj2','Subj3','Subj4'}; model.subjectSelector = uicontrol(parent,'Style','listbox',... 'Min',1, 'Max',3,... 'String',subjectList,... 'UserData',subjectList,... 'Units','normalized',... 'Position',[x1 y2 x2-x1 y1-y2]); set(model.subjectSelector,'BackgroundColor','y'); %Classes pClasses = uipanel(parent,'Units','normalized','Position',[x1 y3 0.5 0.2]); set(pClasses,'Title','Class Definitions'); set(pClasses,'BackgroundColor','w'); lClassDef = uicontrol(pClasses,... 'Style','text',... 'String',sprintf('