4ac11e20dcd3c2e8e24a430db99b4a5bcf711293
Christoph Budziszewski moved UI stuff. new project...

Christoph Budziszewski authored 15 years ago

1) function main_UI(args)
2) 
Christoph Budziszewski refactored to arg-structs!...

Christoph Budziszewski authored 15 years ago

3) global CROSSVAL_METHOD_DEF;
4) 
Christoph Budziszewski variable DEFAULTS

Christoph Budziszewski authored 15 years ago

5) DEFAULT.selectedSubject = 1;
6) DEFAULT.smoothed        = 1;
7) DEFAULT.multisubject    = 'single';
8) DEFAULT.pststart        = -15;
9) DEFAULT.pstend          = 40;
10) DEFAULT.baselinestart   = -3;
11) DEFAULT.baselineend     = -1;
12) DEFAULT.frameshiftstart = -5;
13) DEFAULT.frameshiftend   = 35;
14) DEFAULT.frameshiftdur   = 0;
15) DEFAULT.classdefstring  = 'left,\t[9,11,13],\t -2 ;\nright,\t[10,12,14],\t -1;';
16) DEFAULT.voxelstring     = 'SPL l,\t[ 0, 0, 0];\nSPL r,\t[ 0, 0, 0];\n';
17) DEFAULT.svmoptstring    = '-s 0 -t 0 -v 6 -c 1';
Christoph Budziszewski moved UI stuff. new project...

Christoph Budziszewski authored 15 years ago

18) 
19) %  Initialize and hide the GUI as it is being constructed.
20)     frameWidth=450;
21)     frameHeight=600;
22)     frame = figure('Visible','off','Position',[0,0,frameWidth,frameHeight]);
23)     movegui(frame,'west'); % get this thing visible on smaller displays.
24)     
25)     set(frame,'Name','SVMCrossVal Decode Performance 4 SPM');
26)     set(frame,'NumberTitle','off');
27)     set(frame,'MenuBar','none');
28)     set(frame,'Color',get(0,'defaultUicontrolBackgroundColor'));
29)     set(frame,'Resize','off');
30)     set(frame,'Units','normalize');
31)     
32)     
33)     savemenu = uimenu(frame,'Label','Save/Load');
34)     
Christoph Budziszewski variable DEFAULTS

Christoph Budziszewski authored 15 years ago

35) %     model.subjectMap = SubjectRoiMapping(project);
Christoph Budziszewski moved UI stuff. new project...

Christoph Budziszewski authored 15 years ago

36)     model.subjectMap = SubjectRoiMapping;
Christoph Budziszewski variable DEFAULTS

Christoph Budziszewski authored 15 years ago

37)     
Christoph Budziszewski moved UI stuff. new project...

Christoph Budziszewski authored 15 years ago

38)     nElementRows = 24;
39)     optionLineHeight = 1.0/nElementRows;
40)     controlElementHeight=optionLineHeight*(1.0/1.5)*frameHeight;
41)     pSubject     = uipanel(frame,'Title','Subject',          'Position',[0 optionLineHeight*19 frameWidth optionLineHeight*5]);
42)     pPSTH        = uipanel(frame,'Title','PSTH Options',     'Position',[0 optionLineHeight*14 frameWidth optionLineHeight*5]); 
43)     pCLASS       = uipanel(frame,'Title','Class Definitions','Position',[0 optionLineHeight*9  frameWidth optionLineHeight*5]); 
44)     pVOXEL       = uipanel(frame,'Title','Voxel Selector',   'Position',[0 optionLineHeight*3  frameWidth optionLineHeight*6]); 
45)     pSVM         = uipanel(frame,'Title','SVM Options',      'Position',[0 optionLineHeight*1  frameWidth optionLineHeight*2]); 
Christoph Budziszewski git-svn-id: https://svn.dis...

Christoph Budziszewski authored 15 years ago

46)     btnRunButton1 = uicontrol(frame,'Tag','Coord-Table','String','run coord-Table','Position',[2 optionLineHeight*0  (frameWidth/2) controlElementHeight*1.6]);
47)     btnRunButton2 = uicontrol(frame,'Tag','ROI-Image','String','run ROI-Image processing','Position',[2+(frameWidth/2) optionLineHeight*0  (frameWidth/2) controlElementHeight*1.6]);
Christoph Budziszewski moved UI stuff. new project...

Christoph Budziszewski authored 15 years ago

48) 
49) 
50)     % Subject
51)     firstColumn  =  5.00;
52)     firstRow     =  1.00 * controlElementHeight;
53)     
54)     model.subjectSelector = uicontrol(pSubject,'Style','listbox',...
55)                     'Min',1, 'Max',3,...
56)                     'String',getSubjectCellList(model.subjectMap),...
Christoph Budziszewski variable DEFAULTS

Christoph Budziszewski authored 15 years ago

57)                     'Value',DEFAULT.selectedSubject,...  % default selected item
Christoph Budziszewski moved UI stuff. new project...

Christoph Budziszewski authored 15 years ago

58)                     'Position',[firstColumn firstRow 0.66*frameWidth controlElementHeight*6]);
59)     set(model.subjectSelector,'BackgroundColor','w');
60)     
Christoph Budziszewski added 2nd classification me...

Christoph Budziszewski authored 15 years ago

61)     model.chkSmoothed     = uicontrol(pSubject,'Style','checkbox','Position',[0.68*frameWidth firstRow  0.25*frameWidth controlElementHeight],'Value',DEFAULT.smoothed);
Christoph Budziszewski refactored to arg-structs!...

Christoph Budziszewski authored 15 years ago

62)     createLabel(pSubject,[0.75*frameWidth firstRow  0.25*frameWidth controlElementHeight],'Smooth Data?');
Christoph Budziszewski variable DEFAULTS

Christoph Budziszewski authored 15 years ago

63) 
Christoph Budziszewski refactored to arg-structs!...

Christoph Budziszewski authored 15 years ago

64)     createLabel(pSubject,[0.68*frameWidth firstRow*4  0.25*frameWidth controlElementHeight],'Analysis Method');
65)     
66)     model.analysisMethodSelector = uicontrol(pSubject,'Style','popupmenu',...
67)         'Position',[0.68*frameWidth firstRow*3  0.25*frameWidth controlElementHeight],...
68)         'String',{CROSSVAL_METHOD_DEF.svmcrossval, CROSSVAL_METHOD_DEF.classPerformance},...
69)         'Value',1);
70)     set(model.analysisMethodSelector,'BackgroundColor','w');
71) %     set(model.analysisMethodSelector,'enable','off');
Christoph Budziszewski moved UI stuff. new project...

Christoph Budziszewski authored 15 years ago

72) 
73)     % PSTH
74)     firstColumn  = 5.00;
75)     secondColumn = 0.33*frameWidth;
76)     thirdColumn  = 0.66*frameWidth;
77) %     fourthColumn = 0.84*frameWidth;
78)     
79)     firstRow    = 5.5*controlElementHeight;
80)     secondRow   = 4.5*controlElementHeight;
81)     thirdRow    = 3.5*controlElementHeight;
82)     fourthRow   = 2.5*controlElementHeight;
83)     fifthRow    = 1.0*controlElementHeight;
84)     
85)     lStart      = createLabel(pPSTH, [secondColumn firstRow  0.33*frameWidth controlElementHeight],'Start [sec]');
86)     lEnd        = createLabel(pPSTH, [thirdColumn  firstRow  0.33*frameWidth controlElementHeight],'End [sec]');
87)     lPSTH       = createLabel(pPSTH, [firstColumn  secondRow 0.33*frameWidth controlElementHeight],'PSTH Range');
88)     lBaseline   = createLabel(pPSTH, [firstColumn  thirdRow  0.33*frameWidth controlElementHeight],'Baseline');
89)     lFrameShift = createLabel(pPSTH, [firstColumn  fourthRow 0.33*frameWidth controlElementHeight],'SVM Frame Shift');
90)     lFramsSize  = createLabel(pPSTH, [firstColumn  fifthRow  0.33*frameWidth controlElementHeight],'SVM Frame Size');
91)     
92)     
Christoph Budziszewski variable DEFAULTS

Christoph Budziszewski authored 15 years ago

93)     model.txtPSTHStart       = createTextField(pPSTH,[secondColumn secondRow 0.25*frameWidth controlElementHeight],DEFAULT.pststart);
94)     model.txtPSTHEnd         = createTextField(pPSTH,[thirdColumn  secondRow 0.25*frameWidth controlElementHeight],DEFAULT.pstend);
95)     model.txtBaselineStart   = createTextField(pPSTH,[secondColumn thirdRow  0.25*frameWidth controlElementHeight],DEFAULT.baselinestart);
96)     model.txtBaselineEnd     = createTextField(pPSTH,[thirdColumn  thirdRow  0.25*frameWidth controlElementHeight],DEFAULT.baselineend);
97)     model.txtFrameShiftStart = createTextField(pPSTH,[secondColumn fourthRow 0.25*frameWidth controlElementHeight],DEFAULT.frameshiftstart);
98)     model.txtFrameShiftEnd   = createTextField(pPSTH,[thirdColumn  fourthRow 0.25*frameWidth controlElementHeight],DEFAULT.frameshiftend);
99)     model.txtFrameShiftDur   = createTextField(pPSTH,[secondColumn fifthRow  0.25*frameWidth controlElementHeight],DEFAULT.frameshiftdur);
Christoph Budziszewski moved UI stuff. new project...

Christoph Budziszewski authored 15 years ago

100) 
101)                 
102)     %Classes
103)     nClassRows = 6;
104)     firstColumn  = 5.00;
105)     
106)     firstRow    = (nClassRows-0.5)*controlElementHeight;
107)     secondRow   = (nClassRows-4.5)*controlElementHeight;
108) 
109)     lClassDef = createLabel(pCLASS, [firstColumn firstRow  0.66*frameWidth controlElementHeight],'<Label>,<[Event,Event,..]>,<SVM-Value>;');
Christoph Budziszewski variable DEFAULTS

Christoph Budziszewski authored 15 years ago

110)     model.txtClassDef = createTextField(pCLASS,[firstColumn secondRow 0.98*frameWidth 4*controlElementHeight],sprintf(DEFAULT.classdefstring));
Christoph Budziszewski moved UI stuff. new project...

Christoph Budziszewski authored 15 years ago

111)     set(model.txtClassDef,'HorizontalAlignment','left');
112)     set(model.txtClassDef,'Max',20);
113)     set(model.txtClassDef,'Min',0);
114)     set(model.txtClassDef, 'FontName', 'FixedWidth')
115)     
116)     %Voxel
117)     nVoxelRows = 8;
118)     firstColumn  = 5.00;
119)     
120)     firstRow    = (nVoxelRows-0.5)*controlElementHeight;
121)     secondRow   = (nVoxelRows-7.5)*controlElementHeight;
122) 
123)     lVoxelDef = createLabel(pVOXEL, [firstColumn firstRow  0.66*frameWidth controlElementHeight],'<ROI Name>,<ROI Modifier>;');
124)     model.txtVoxelDef = createTextField(pVOXEL,[firstColumn secondRow 0.98*frameWidth 6*controlElementHeight],...
Christoph Budziszewski variable DEFAULTS

Christoph Budziszewski authored 15 years ago

125)         sprintf(DEFAULT.voxelstring));
Christoph Budziszewski moved UI stuff. new project...

Christoph Budziszewski authored 15 years ago

126)     set(model.txtVoxelDef,'HorizontalAlignment','left');
127)     set(model.txtVoxelDef,'Max',20);
128)     set(model.txtVoxelDef,'Min',0);
129)     set(model.txtVoxelDef, 'FontName', 'FixedWidth')
130)                 
131)     % SVM
132)     firstColumn  =  5.00;
133)     firstRow     =  1.00 * controlElementHeight;
134) 
Christoph Budziszewski variable DEFAULTS

Christoph Budziszewski authored 15 years ago

135)     model.txtSVMopts = createTextField(pSVM,[firstColumn firstRow  0.66*frameWidth controlElementHeight],DEFAULT.svmoptstring);
Christoph Budziszewski moved UI stuff. new project...

Christoph Budziszewski authored 15 years ago

136)     %model.txtSVMopts = createTextField(pSVM,[firstColumn firstRow  0.66*frameWidth controlElementHeight],'-s 0 -t 2 -v 6 -c 10 -g .1');
137)     set(model.txtSVMopts,'Enable','on'); %inactive
138)     set(model.txtSVMopts,'HorizontalAlignment','left');
139) 
Christoph Budziszewski git-svn-id: https://svn.dis...

Christoph Budziszewski authored 15 years ago

140)     set(btnRunButton1,'Callback',{@cbRunCoordTable,model}); % set here, because of model.    
141)     set(btnRunButton2,'Callback',{@cbRunROIImage,model}); % set here, because of model.    
Christoph Budziszewski moved things

Christoph Budziszewski authored 15 years ago

142) %     set(btnRunButton2,'Enable','off');
Christoph Budziszewski moved UI stuff. new project...

Christoph Budziszewski authored 15 years ago

143)     uimenu(savemenu,'Label','Save','Callback',{@mcb_save,model});
144)     uimenu(savemenu,'Label','Load','Callback',{@mcb_load,model});
145) 
146)     set(frame,'Visible','on');
147) end
148) 
149) function mcb_save(src,event,model)
150) display('SAVE');
151) 
152) end
153) 
154) function mcb_load(src,event,model)
155) display('LOAD');
156) end
157) 
Christoph Budziszewski git-svn-id: https://svn.dis...

Christoph Budziszewski authored 15 years ago

158) function cbRunCoordTable(src,evnt,model)
159)     display('RUN Coord-Table Mode');
160)     main('COORD-LOOKUP-TABLE',model);
Christoph Budziszewski moved UI stuff. new project...

Christoph Budziszewski authored 15 years ago

161) end
Christoph Budziszewski git-svn-id: https://svn.dis...

Christoph Budziszewski authored 15 years ago

162) function cbRunROIImage(src,evnt,model)
163)     display('RUN Image-Mask Mode');
164)     main('ROI-IMAGE-MASK', model);