2de68580da57ab65d0ef35a9dc1e821e797d861d
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

1) function ui_main(varargin)
2) 
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

3) DEFAULT.selectedSubject = 2;
Christoph Budziszewski roi image working

Christoph Budziszewski authored 15 years ago

4) 
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

5) DEFAULT.pststart        = -15;
6) DEFAULT.pstend          = 40;
7) DEFAULT.baselinestart   = -3;
8) DEFAULT.baselineend     = -1;
9) DEFAULT.frameshiftstart = -5;
10) DEFAULT.frameshiftend   = 35;
11) DEFAULT.frameshiftdur   = 0;
12) DEFAULT.classdefstring  = 'left,\t[9,11,13]\nright,\t[10,12,14]';
13) DEFAULT.voxelstring     = 'SPL l + [ 0, 0, 0] \nSPL r + [ 0, 0, 0]\n';
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

14) DEFAULT.svmoptstring    = '-s 0 -t 0 -c 1';
15) DEFAULT.svmnfold        = '6';
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

16) DEFAULT.searchlightradius = 3;
17) 
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

18) DEFAULT.wd  = fullfile('d:','Analyze','Choice','24pilot');
19) 
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

20) %  Initialize and hide the GUI as it is being constructed.
21)     frameWidth=450;
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

22)     frameHeight=450;
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

23)     
24)     frame = figure('Visible','off','Position',[0,0,frameWidth,frameHeight]);
25)     movegui(frame,'west'); % get this thing visible on smaller displays.
26)     set(frame,'Name','SVMCrossVal Decode Performance 4 SPM');
27)     set(frame,'NumberTitle','off');
28)     set(frame,'MenuBar','none');
Christoph Budziszewski save load working for most...

Christoph Budziszewski authored 15 years ago

29) %     set(frame,'Color',get(0,'defaultUicontrolBackgroundColor'));
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

30)     set(frame,'Resize','on');
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

31)     set(frame,'Units','normalized');
Christoph Budziszewski working: SingleSubject, Coo...

Christoph Budziszewski authored 15 years ago

32)     set(frame,'Color','y');
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

33) 
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

34)     task = struct;
35)     
Christoph Budziszewski save load working for most...

Christoph Budziszewski authored 15 years ago

36)     model = struct;
37)     model.baseDir = DEFAULT.wd;
38) 
39)     model.txtBaseDir = createLabel(frame,[0 0.97 1 0.03],model.baseDir);
40)     set(model.txtBaseDir,'BackgroundColor','w');
Christoph Budziszewski enabled svm classification....

Christoph Budziszewski authored 15 years ago

41)     set(model.txtBaseDir,'ForegroundColor','b');
Christoph Budziszewski save load working for most...

Christoph Budziszewski authored 15 years ago

42)     
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

43)     TASK_HEIGHT = 1-0.13;
44)     
45)     % PREPROCESSING
46)     task.preprocessing   = uipanel(frame,'Title','Preprocessing','Position',[0 0.0 1 TASK_HEIGHT]);
47)     set(task.preprocessing,'BackgroundColor','w');
48)     set(task.preprocessing,'Units','normalized');
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

49)     
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

50)     model.selectedSubject = DEFAULT.selectedSubject;
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

51)     model = createFirstStepPanel(model,task.preprocessing,DEFAULT);
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

52)     
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

53)     
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

54)     % CLASSIFICATION
55)     task.classification = uipanel(frame,'Title','Classification','Position',[0 0.0 1 TASK_HEIGHT]);
56)     set(task.classification,'BackgroundColor','w');
57)     model = createSecondStepPanel(model,task.classification,DEFAULT);
58)     
59)     % TASK
60)     task.taskSwitch = uipanel(frame,'Position',[0 1-0.13 1 0.10]);
61) %         set(task.taskSwitch,'Title','TASK');
62)         set(task.taskSwitch,'BackgroundColor','w');
63)         set(task.taskSwitch,'Units','normalized');
64)     
65)         btnSwitchPreprocessing = uicontrol(task.taskSwitch,'String','ImageProcessing',...
66)             'Units','normalized','Position',[0.0 0.0 0.33 1]);
67)         set(btnSwitchPreprocessing,'Callback',{@cbSwitchTask,'PRE',task}); 
68)         set(btnSwitchPreprocessing,'Enable','on');
69) 
70)         btnSwitchClassify = uicontrol(task.taskSwitch,'String','Decode',...
71)             'Units','normalized','Position',[0.33 0.0 0.33 1]);
72)         set(btnSwitchClassify,'Callback',{@cbSwitchTask,'CLASSIFY',task}); 
73)         set(btnSwitchClassify,'Enable','on');
74) 
75)         btnSwitchPlot = uicontrol(task.taskSwitch,'String','Plot',...
76)             'Units','normalized','Position',[0.66 0.0 0.33 1]);
77)         set(btnSwitchPlot,'Callback',{@cbSwitchTask,'PLOT',task}); 
78)         set(btnSwitchPlot,'Enable','on');
79) 
80)     % menu
81)     
Christoph Budziszewski started save/load functiona...

Christoph Budziszewski authored 15 years ago

82)     savemenu = uimenu(frame,'Label','Save/Load');
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

83)         uimenu(savemenu,'Label','Save Preprocessing Parameter','Callback',{@mcb_save,model});
84)         uimenu(savemenu,'Label','Load Preprocessing Parameter','Callback',{@mcb_load,model});
Christoph Budziszewski save load working for most...

Christoph Budziszewski authored 15 years ago

85) 
Christoph Budziszewski zwischenspeicherung

Christoph Budziszewski authored 15 years ago

86)     uimenu(frame,'Label','change Study','Callback',{@mcb_cd,model},'Enable','off');
Christoph Budziszewski started save/load functiona...

Christoph Budziszewski authored 15 years ago

87)     
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

88)     cbSwitchTask(0,0,'PRE',task);
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

89) 
90)     % fill with data
91)     model = scanDirs(model);
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

92)     set(frame,'Visible','on');
93) 
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

94)     assignin('base','model',model);
Christoph Budziszewski started save/load functiona...

Christoph Budziszewski authored 15 years ago

95) end
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

96) 
97) function model = createFirstStepPanel(model,parent,DEFAULT)
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

98) 
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

99)     main_grid = cell(2,4);
100)     main_grid{1,1} = [0 0.7 0.4 0.3];
101)     main_grid{1,2} = [0 0.5 0.5 0.2];
102)     main_grid{1,3} = [0 0.1 0.5 0.4];
103)     main_grid{1,4} = [0 0.0 1.0 0.1];
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

104)     
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

105)     main_grid{2,1} = [0.4 0.7 0.6 0.3];
106)     main_grid{2,2} = [0.5 0.5 0.5 0.2];
107)     main_grid{2,3} = [0.5 0.1 0.5 0.4];
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

108)     
109)     %Subjects
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

110)     pSubject = uipanel(parent,'Units','normalized','Position',cell2mat(main_grid(1,1)));
111)     set(pSubject,'Title','Subjects');
112)     set(pSubject,'BackgroundColor','w');
113)     
114)     subjectList = {'DUMMY Subj1','DUMMY Subj2','DUMMY Subj3','DUMMY Subj4'};
115)     model.subjectSelector = uicontrol(pSubject,'Style','listbox',...
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

116)                     'Min',1, 'Max',3,...
117)                     'String',subjectList,...
118)                     'UserData',subjectList,...
119)                     'Units','normalized',...
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

120)                     'Position',[0 0 1 1]);
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

121)     set(model.subjectSelector,'BackgroundColor','w');
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

122)     
123)     %Classes
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

124)     pClasses = uipanel(parent,'Units','normalized','Position',cell2mat(main_grid(1,2)));
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

125)     set(pClasses,'Title','Class Definitions');
126)     set(pClasses,'BackgroundColor','w');
127)         lClassDef = uicontrol(pClasses,...
128)             'Style','text',...
129)             'String',sprintf('<Label>,\t <[Event, Event, ..]>;'),...
130)             'Units','normalized',...
131)             'Position',[0 0.8 1 0.2]);
132)         set(lClassDef,'BackgroundColor','w');
133)         set(lClassDef,'HorizontalAlignment','left');
134)         
135)         model.txtClassDef = uicontrol(pClasses,'Style','edit',...
136)             'String',sprintf(DEFAULT.classdefstring),...
137)             'Units','normalized',...
138)             'Position',[0 0 1 0.8]);
139)         set(model.txtClassDef,'HorizontalAlignment','left');
140)         set(model.txtClassDef,'Max',20);
141)         set(model.txtClassDef,'Min',0);
142)         set(model.txtClassDef, 'FontName', 'FixedWidth');
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

143)         set(model.txtClassDef, 'BackgroundColor', 'w');
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

144) 
145) 
146)     %Timeline
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

147)     pPSTH        = uipanel(parent,'Title','PSTH Options','Position',cell2mat(main_grid(2,1)));
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

148)     set(pPSTH,'BackgroundColor','w');
149)         
150)         grid_h = 0.16;
151)         grid_w = 0.3;
152)         
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

153)         tl_grid = cell([3 6]);
154)         tl_grid{2,1} = [0.0 0.83 grid_w grid_h];
155)         tl_grid{2,1} = [0.4 0.83 grid_w grid_h];
156)         tl_grid{3,1} = [0.7 0.83 grid_w grid_h];
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

157)         
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

158)         tl_grid{1,2} = [0.0 0.66 grid_w grid_h];
159)         tl_grid{2,2} = [0.4 0.66 grid_w grid_h];
160)         tl_grid{3,2} = [0.7 0.66 grid_w grid_h];
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

161) 
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

162)         tl_grid{1,3} = [0.0 0.5 grid_w grid_h];
163)         tl_grid{2,3} = [0.4 0.5 grid_w grid_h];
164)         tl_grid{3,3} = [0.7 0.5 grid_w grid_h];
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

165)         
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

166)         tl_grid{1,4} = [0.0 0.33 grid_w grid_h];
167)         tl_grid{2,4} = [0.4 0.33 grid_w grid_h];
168)         tl_grid{3,4} = [0.7 0.33 grid_w grid_h];
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

169) 
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

170)         tl_grid{1,5} = [0.0 0.16 0.5 grid_h];
171)         tl_grid{2,5} = [0.5 0.16 grid_w grid_h];
172)         tl_grid{3,5} = [0.75 0.16 grid_w grid_h];
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

173)         
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

174)         tl_grid{1,6} = [0.0 0.0 0.5 grid_h];
175)         tl_grid{2,6} = [0.5 0.0 grid_w grid_h];
176)         tl_grid{3,6} = [0.75 0.0 grid_w grid_h];
177) 
178)         lStart      = createLabel(pPSTH, cell2mat(tl_grid(2,1)) ,'Start [sec]');
179)         lEnd        = createLabel(pPSTH, cell2mat(tl_grid(3,1)) ,'End [sec]');
180)         lPSTH       = createLabel(pPSTH, cell2mat(tl_grid(1,2)),'PSTH Range');
181)         lBaseline   = createLabel(pPSTH, cell2mat(tl_grid(1,3)),'Baseline');
182)         lFrameShift = createLabel(pPSTH, cell2mat(tl_grid(1,4)),'Frame Shift');
183)         lFramsSize  = createLabel(pPSTH, cell2mat(tl_grid(1,5)),'Frame Size');
184)         lSearchligh = createLabel(pPSTH, cell2mat(tl_grid(1,6)),'Searchlight Radius');
185) 
186) 
187)         model.txtPSTHStart         = createTextField(pPSTH,cell2mat(tl_grid(2,2)),DEFAULT.pststart);
188)         model.txtPSTHEnd           = createTextField(pPSTH,cell2mat(tl_grid(3,2)),DEFAULT.pstend);
189)         model.txtBaselineStart     = createTextField(pPSTH,cell2mat(tl_grid(2,3)),DEFAULT.baselinestart);
190)         model.txtBaselineEnd       = createTextField(pPSTH,cell2mat(tl_grid(3,3)),DEFAULT.baselineend);
191)         model.txtFrameShiftStart   = createTextField(pPSTH,cell2mat(tl_grid(2,4)),DEFAULT.frameshiftstart);
192)         model.txtFrameShiftEnd     = createTextField(pPSTH,cell2mat(tl_grid(3,4)),DEFAULT.frameshiftend);
193)         model.txtFrameShiftDur     = createTextField(pPSTH,cell2mat(tl_grid(2,5)),DEFAULT.frameshiftdur);
194)         model.txtSearchlightRadius = createTextField(pPSTH,cell2mat(tl_grid(2,6)),DEFAULT.searchlightradius);
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

195)         
196)         % images
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

197)         pImage = uipanel(parent,'Title','Image Options','Position',cell2mat(main_grid(2,2)));
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

198)         set(pImage,'BackgroundColor','w');
199) 
200)         createLabel(pImage,[0.0 0.5 1 0.5],'Select Image Base');
201)         
Christoph Budziszewski schwimmen.

Christoph Budziszewski authored 15 years ago

202)         imageRegExList = {'DUMMY f*.IMG','DUMMY swrf*.IMG','DUMMY wrf*.IMG'};
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

203)         model.imageTypeSelection = uicontrol(pImage,'Style','popupmenu',...
204)         'Units','normalized',...
205)         'Position',[0.0 0.0 1 0.5],...
206)         'String',imageRegExList,...
207)         'UserData',imageRegExList,...
Christoph Budziszewski schwimmen.

Christoph Budziszewski authored 15 years ago

208)         'Value',3);
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

209)         set(model.imageTypeSelection,'BackgroundColor','w');
210)         
211)         
212)         % coordinate Table
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

213)         pVoxel = uipanel(parent,'Title','ROI','Position',cell2mat(main_grid(1,3)));
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

214)         set(pVoxel,'BackgroundColor','w');
215)         lVoxelDef = createLabel(pVoxel, [0 0.9 1 0.1],'<ROI Name>+[offset];');
216)         model.txtVoxelDef = createTextField(pVoxel,[0 0 1 0.9],...
217)             sprintf(DEFAULT.voxelstring));
218)         set(model.txtVoxelDef,'HorizontalAlignment','left');
219)         set(model.txtVoxelDef,'Max',20);
220)         set(model.txtVoxelDef,'Min',0);
221)         set(model.txtVoxelDef, 'FontName', 'FixedWidth');
222)         
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

223)         %normalizations
224)         pNorm = uipanel(parent,'Title','Normalization','Position',cell2mat(main_grid(2,3)));
225)         set(pNorm,'BackgroundColor','w');
226)         
Christoph Budziszewski coordTabel works for JZ006

Christoph Budziszewski authored 15 years ago

227)         createLabel(pNorm,[0 0.75 1 0.25],'psth norm4SVM');
228)         norm1Model = {'none','mean','minmax'};
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

229)         model.selNormPST = uicontrol(pNorm,'Style','popupmenu',...
230)             'Units','normalized',...
231)             'Position',[0.0 0.5 1 0.25],...
232)             'String',norm1Model,...
233)             'UserData',norm1Model,...
Christoph Budziszewski coordTabel works for JZ006

Christoph Budziszewski authored 15 years ago

234)             'Value',2);
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

235)          set(model.selNormPST,'BackgroundColor','w');   
236)         
Christoph Budziszewski coordTabel works for JZ006

Christoph Budziszewski authored 15 years ago

237)         createLabel(pNorm,[0 0.25 1 0.25],'Col Bias removal');
238)         norm2Model = {'on','off'};
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

239)         model.selNormClass = uicontrol(pNorm,'Style','popupmenu',...
240)             'Units','normalized',...
241)             'Position',[0.0 0.0 1 0.25],...
242)             'String',norm2Model,...
243)             'UserData',norm2Model,...
244)             'Value',1);
245)          set(model.selNormClass,'BackgroundColor','w');   
246)         
247)         %buttons
248)         pButtons = uipanel(parent,'Position',cell2mat(main_grid(1,4)));
249)         set(pButtons,'BackgroundColor','w');
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

250)         
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

251)         btnRunButton1 = uicontrol(pButtons,'String','run coord-Table',...
252)             'Units','normalized','Position',[0 0 0.33 1]);
Christoph Budziszewski save load working for most...

Christoph Budziszewski authored 15 years ago

253)         set(btnRunButton1,'Callback',{@cbRunPreprocessing,model,'COORD'}); % set here, because of model.    
254)         set(btnRunButton1,'Enable','on');
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

255)         
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

256)         btnRunButton2 = uicontrol(pButtons,'String','run full Brain Searchlight',...
257)             'Units','normalized','Position',[0.33 0 0.33 1]);
Christoph Budziszewski save load working for most...

Christoph Budziszewski authored 15 years ago

258)         set(btnRunButton2,'Callback',{@cbRunPreprocessing,model,'FBS'}); % set here, because of model.  
Christoph Budziszewski coordTabel works for JZ006

Christoph Budziszewski authored 15 years ago

259)         set(btnRunButton2,'Enable','off');
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

260)         
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

261)         btnRunButton3 = uicontrol(pButtons,'String','run ROI-Image processing',...
262)             'Units','normalized','Position',[0.66 0 0.33 1]);
Christoph Budziszewski started save/load functiona...

Christoph Budziszewski authored 15 years ago

263)         set(btnRunButton3,'Callback',{@cbRunPreprocessing,model,'ROI'}); % set here, because of model.    
264)         set(btnRunButton3,'Enable','on');
265) end
266) 
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

267) function model = createSecondStepPanel(model,parent,DEFAULT)
268) basecolor = 'w';
269) 
270) pTime = uipanel(parent,'Units','normalized','Position',[0.0 0.8 1 0.3]);
271) %     set(pTime,'Title','Frameshift Opts');
272)     set(pTime,'BackgroundColor',basecolor);
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

273)     
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

274) pSVM = uipanel(parent,'Units','normalized','Position',[0 0.0 0.5 0.7]);
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

275)     set(pSVM,'Title','SVM Classification');
276)     set(pSVM,'BackgroundColor',basecolor);
277) 
278)     model.txtSVMopts = createTextField(pSVM,[0 0.75 1 0.25],DEFAULT.svmoptstring);
279)     set(model.txtSVMopts,'HorizontalAlignment','left');
280)     
281)     model.txtSVMnfold = createTextField(pSVM,[0.0 0.50 0.5 0.25],DEFAULT.svmnfold);
282)     createLabel(pSVM,[0.5 0.50 0.5 0.25 ],'-Fold CrossVal');
283)     
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

284) pSOM = uipanel(parent,'Units','normalized','Position',[0.5 0.0 0.5 0.7]);
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

285)     set(pSOM,'Title','SOM Classification');
286)     set(pSOM,'BackgroundColor',basecolor);
287) 
288)     model.txtSOMopts = createTextField(pSOM,[0 0.75 1 0.25],'4x3 rect');
289)     set(model.txtSOMopts,'HorizontalAlignment','left');
290)         set(model.txtSOMopts,'Enable','off');
291) 
292)     model.txtSOMnfold = createTextField(pSOM,[0.0 0.50 0.5 0.25],DEFAULT.svmnfold);
293)         set(model.txtSOMnfold,'Enable','off');
294)     createLabel(pSOM,[0.5 0.50 0.5 0.25 ],'-Fold CrossVal');
295) 
296) % buttons
297)     btnRunSVM = uicontrol(pSVM,'String','run SVM Crossvalidation',...
298)         'Units','normalized',...
299)         'Position',[0 0.25 1 0.25]);
300)     set(btnRunSVM,'Callback',{@cbRunDecode,model,'SVM'}); % set here, because of model.
301)     set(btnRunSVM,'Enable','on');
302)     
303)     btnRunXSVM = uicontrol(pSVM,'String','run SVM X-Subject validation',...
304)         'Units','normalized',...
305)         'Position',[0 0.0 1 0.25]);
306)     set(btnRunXSVM,'Callback',{@cbRunDecode,model,'XSVM'}); % set here, because of model.
307)     set(btnRunXSVM,'Enable','on');
308)     
309)     btnRunSOM = uicontrol(pSOM,'String','run SOM Crossvalidation',...
310)         'Units','normalized',...
311)     'Position',[0.0 0.25 1 0.25]);
312)     set(btnRunSOM,'Callback',{@cbRunDecode,model,'SOM'}); % set here, because of model.
313)     set(btnRunSOM,'Enable','off');
314) 
315)     btnRunXSOM = uicontrol(pSOM,'String','run SOM X-Subject validation',...
316)         'Units','normalized',...
317)         'Position',[0.0 0.0 1 0.25]);
318)     set(btnRunXSOM,'Callback',{@cbRunDecode,model,'XSOM'}); % set here, because of model.
319)     set(btnRunXSOM,'Enable','off');
320) end
321) 
322) 
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

323) function cbSwitchTask(src,evnt,task,taskpanel)
324) set(taskpanel.preprocessing,'Visible','off');
325) set(taskpanel.classification,'Visible','off');
326) 
327) switch task
328)     case 'PRE'
329)         set(taskpanel.preprocessing,'Visible','on');
330)     case 'CLASSIFY'
331)         set(taskpanel.classification,'Visible','on');
332)     case 'PLOT'
333) end
334) end
335) 
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

336) 
Christoph Budziszewski started save/load functiona...

Christoph Budziszewski authored 15 years ago

337) function cbRunPreprocessing(src,evnt,model,task)
Christoph Budziszewski enabled svm classification....

Christoph Budziszewski authored 15 years ago

338) main(model,'pre',task);
339) end
340) 
341) function cbRunDecode(src,evnt,model,task)
342) main(model,'decode',task);
Christoph Budziszewski started save/load functiona...

Christoph Budziszewski authored 15 years ago

343) end
344) 
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

345) function model = mcb_cd(src,evnt,model)
346) disp('CD');
347) directory_name = uigetdir(model.baseDir,'Select Study Base Directory ...');
348) model.baseDir = directory_name;
349) model = scanDirs(model);
350) end
351) 
352) function mcb_save(src,evnt,model)
353) disp('SAVE');
354) baseDir  = model.baseDir;
355) timeLine = getTimeLineParams(model);
356) classDefString = getClassDefString(model);
357) coordDefString = getCoordDefString(model);
358) 
359) [file path] = uiputfile('*.mat','Save current Params ...',model.baseDir);
360) save( fullfile(path,file),'baseDir','timeLine','classDefString','coordDefString') ;
361) end
362) 
363) function model = mcb_load(src,evnt,model)
364) disp('LOAD');
365) [file path] = uigetfile('*.mat','Load Params ...',model.baseDir);
366) l = load(fullfile(path,file));
367) % assignin('base','l',l);
368) model = setTimeLineParams(model,l.timeLine);
369) model = setClassDefString(model,l.classDefString);
370) model = setCoordDefString(model,l.coordDefString);
371) model.baseDir = l.baseDir;
372) model = scanDirs(model);
373) 
374) end
375) 
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

376) function label = createLabel(parent,  pos, labelText)
377)     label = uicontrol(parent,'Style','text','Units','normalized','String',labelText,'Position',pos);
378)     set(label,'HorizontalAlignment','left');
379)     set(label,'BackgroundColor','w');
380) end
381) 
382) function txt = createTextField(parent,pos,model)
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

383) %     textfieldcolor = [0.9 0.9 0.0];
384)     textfieldcolor = 'w';