18f3b6234436a23cd7533784edfa0bc88897f75a
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

1) function ui_main(varargin)
2) 
3) %  Initialize and hide the GUI as it is being constructed.
4)     frameWidth=450;
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

6)     
7)     frame = figure('Visible','off','Position',[0,0,frameWidth,frameHeight]);
8)     movegui(frame,'west'); % get this thing visible on smaller displays.
9)     set(frame,'Name','SVMCrossVal Decode Performance 4 SPM');
10)     set(frame,'NumberTitle','off');
11)     set(frame,'MenuBar','none');
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

17) 
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

18)     model = struct;
Christoph Budziszewski save load working for most...

Christoph Budziszewski authored 15 years ago

19)     
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

20)     model.txtBaseDir = createLabel(frame,[0 0.97 0.8 0.03],'');
21)     set(model.txtBaseDir,'BackgroundColor','w');
22)     set(model.txtBaseDir,'ForegroundColor','b');
23)     
24)     model.txtStudyID = createLabel(frame,[0.8 0.97 0.2 0.03],'');
25)     set(model.txtStudyID,'BackgroundColor','w');
26)     set(model.txtStudyID,'ForegroundColor','r');    
27) 
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

28)     TASK_HEIGHT = 1-0.13;
29)     
30)     % PREPROCESSING
31)     task.preprocessing   = uipanel(frame,'Title','Preprocessing','Position',[0 0.0 1 TASK_HEIGHT]);
32)     set(task.preprocessing,'BackgroundColor','w');
33)     set(task.preprocessing,'Units','normalized');
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

36)     % CLASSIFICATION
37)     task.classification = uipanel(frame,'Title','Classification','Position',[0 0.0 1 TASK_HEIGHT]);
38)     set(task.classification,'BackgroundColor','w');
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

39)     model = createSecondStepPanel(model,task.classification);
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

40)     
Christoph Budziszewski first plot button. not work...

Christoph Budziszewski authored 15 years ago

41)     % PLOT
42)     task.plot = uipanel(frame,'Title','Plot','Position',[0 0.0 1 TASK_HEIGHT]);
43)     set(task.plot,'BackgroundColor','w');
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

44)     model = createVisualStepPanel(model,task.plot);
Christoph Budziszewski first plot button. not work...

Christoph Budziszewski authored 15 years ago

45)     
Christoph Budziszewski almost all "change study" f...

Christoph Budziszewski authored 14 years ago

46)     % TASK SWITCH BUTTONS
Christoph Budziszewski normalization features enabled

Christoph Budziszewski authored 15 years ago

47)     task.taskSwitch = uibuttongroup(frame,'Position',[0 1-0.13 1 0.10]);
48)     % controlls togglebuttons
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

49)         set(task.taskSwitch,'BackgroundColor','w');
50)         set(task.taskSwitch,'Units','normalized');
51)     
Christoph Budziszewski normalization features enabled

Christoph Budziszewski authored 15 years ago

52)         btnSwitchPreprocessing = uicontrol(task.taskSwitch,'Style','pushbutton',...
53)             'String','ImageProcessing',...
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

54)             'Units','normalized','Position',[0.0 0.0 0.33 1]);
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

55)         set(btnSwitchPreprocessing,'Callback',{@cbSwitchTask,'PRE',task}); 
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

56)         set(btnSwitchPreprocessing,'Enable','on');
57) 
Christoph Budziszewski normalization features enabled

Christoph Budziszewski authored 15 years ago

58)         btnSwitchClassify = uicontrol(task.taskSwitch,'Style','pushbutton',...
59)             'String','Decode',...
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

60)             'Units','normalized','Position',[0.33 0.0 0.33 1]);
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

61)         set(btnSwitchClassify,'Callback',{@cbSwitchTask,'CLASSIFY',task}); 
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

62)         set(btnSwitchClassify,'Enable','on');
63) 
Christoph Budziszewski normalization features enabled

Christoph Budziszewski authored 15 years ago

64)         btnSwitchPlot = uicontrol(task.taskSwitch,'Style','pushbutton',...
65)             'String','Plot',...
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

66)             'Units','normalized','Position',[0.66 0.0 0.33 1]);
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

67)         set(btnSwitchPlot,'Callback',{@cbSwitchTask,'PLOT',task}); 
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

68)         set(btnSwitchPlot,'Enable','on');
69) 
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

70) 
Christoph Budziszewski almost all "change study" f...

Christoph Budziszewski authored 14 years ago

71)     % MENUS
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

72) 
73)     savemenu = uimenu(frame,'Label','Save ...','Enable','on');
74)         uimenu(savemenu,'Label','Save All','Callback',{@mcb_save,model},'Enable','on');
Christoph Budziszewski task-models implementet.

Christoph Budziszewski authored 15 years ago

75)         
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

76)     studySelectMenu = uimenu(frame,'Label','Study ...','Enable','on');
77)         uimenu(studySelectMenu,'Label','*new Study*','Callback',{@mcb_new_study,studySelectMenu,model});
78)         fillStudyMenu(studySelectMenu,model);
79)         
Christoph Budziszewski almost all "change study" f...

Christoph Budziszewski authored 14 years ago

80)     updateMenu = uimenu(frame,'Label','update ...','Enable','on');
81)         uimenu(updateMenu,'Label','rescan subject dir','Callback',{@mcb_update_subjects,model});
82)         uimenu(updateMenu,'Label','rescan images','Callback',{@mcb_update_imagebase,model});
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

83)         
84) %     newStudyMenu = uimenu(frame,'Label','new Study','Enable','on');
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

85) 
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

86)     load_study([getPreviousStudyID '.mat'],model);
87)     cbSwitchTask(0,0,'PRE',task);
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

88)     set(frame,'Visible','on');
89) 
Christoph Budziszewski started save/load functiona...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

91) 
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

92) %%%%% ui elements
93) function model = createFirstStepPanel(model,parent)
Christoph Budziszewski studychange works. added gu...

Christoph Budziszewski authored 14 years ago

94)     norm1Model = {'none','mean','minmax'};
95)     roiGroupMethods = {'none','mean','max','median'};
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

103)     main_grid{2,1} = [0.4 0.7 0.6 0.3];
Christoph Budziszewski studychange works. added gu...

Christoph Budziszewski authored 14 years ago

104)     main_grid{2,2} = [0.5 0.1 0.5 0.6];
105) %     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

106)     
107)     %Subjects
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

108)     pSubject = uipanel(parent,'Units','normalized','Position',cell2mat(main_grid(1,1)));
109)     set(pSubject,'Title','Subjects');
110)     set(pSubject,'BackgroundColor','w');
111)     
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

112) %     subjectNames = listDirNames(getBaseDir(model));
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

113)     model.subjectSelector = uicontrol(pSubject,'Style','listbox',...
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

114)                     'Min',1, 'Max',3,...
115)                     'Units','normalized',...
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

116)                     'Position',[0 0 1 1]);
Christoph Budziszewski first plot button. not work...

Christoph Budziszewski authored 15 years ago

117)     set(model.subjectSelector, 'FontName', 'FixedWidth');
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

118)     set(model.subjectSelector,'BackgroundColor','w');
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

119) 
120)   
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

121)     %Classes
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

123)     set(pClasses,'Title','Class Definitions');
124)     set(pClasses,'BackgroundColor','w');
125)         lClassDef = uicontrol(pClasses,...
126)             'Style','text',...
127)             'String',sprintf('<Label>,\t <[Event, Event, ..]>;'),...
128)             'Units','normalized',...
129)             'Position',[0 0.8 1 0.2]);
130)         set(lClassDef,'BackgroundColor','w');
131)         set(lClassDef,'HorizontalAlignment','left');
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

133)         
134)         model.txtClassDef = uicontrol(pClasses,'Style','edit',...
135)             'Units','normalized',...
136)             'Position',[0 0 1 0.8]);
137)         set(model.txtClassDef,'HorizontalAlignment','left');
138)         set(model.txtClassDef,'Max',20);
139)         set(model.txtClassDef,'Min',0);
140)         set(model.txtClassDef, 'FontName', 'FixedWidth');
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

142) 
143) 
144)     %Timeline
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

145)     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

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

Christoph Budziszewski authored 15 years ago

151)         tl_grid = cell([3 6]);
152)         tl_grid{2,1} = [0.0 0.83 grid_w grid_h];
153)         tl_grid{2,1} = [0.4 0.83 grid_w grid_h];
154)         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

155)         
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

156)         tl_grid{1,2} = [0.0 0.66 grid_w grid_h];
157)         tl_grid{2,2} = [0.4 0.66 grid_w grid_h];
158)         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

159) 
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

160)         tl_grid{1,3} = [0.0 0.5 grid_w grid_h];
161)         tl_grid{2,3} = [0.4 0.5 grid_w grid_h];
162)         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

163)         
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

164)         tl_grid{1,4} = [0.0 0.33 grid_w grid_h];
165)         tl_grid{2,4} = [0.4 0.33 grid_w grid_h];
166)         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

167) 
Christoph Budziszewski added TR

Christoph Budziszewski authored 15 years ago

168)         tl_grid{1,5} = [0.0 0.16 grid_w grid_h];
169)         tl_grid{2,5} = [0.4 0.16 grid_w grid_h];
170)         tl_grid{3,5} = [0.7 0.16 grid_w grid_h];
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

171)         
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

172)         tl_grid{1,6} = [0.0 0.0 0.5 grid_h];
173)         tl_grid{2,6} = [0.5 0.0 grid_w grid_h];
174)         tl_grid{3,6} = [0.75 0.0 grid_w grid_h];
175) 
176)         lStart      = createLabel(pPSTH, cell2mat(tl_grid(2,1)) ,'Start [sec]');
177)         lEnd        = createLabel(pPSTH, cell2mat(tl_grid(3,1)) ,'End [sec]');
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

178)         lPSTH       = createLabel(pPSTH, cell2mat(tl_grid(1,2)) ,'PSTH Range');
179)         lBaseline   = createLabel(pPSTH, cell2mat(tl_grid(1,3)) ,'Baseline');
180)         lTRF        = createLabel(pPSTH, cell2mat(tl_grid(1,5)) ,'TR Factor');
181) 
182)         model.txtPSTHStart         = createTextField(pPSTH,cell2mat(tl_grid(2,2)),'');
183)         model.txtPSTHEnd           = createTextField(pPSTH,cell2mat(tl_grid(3,2)),'');
184)         model.txtBaselineStart     = createTextField(pPSTH,cell2mat(tl_grid(2,3)),'');
185)         model.txtBaselineEnd       = createTextField(pPSTH,cell2mat(tl_grid(3,3)),'');
186)         model.txtTrFactor          = createTextField(pPSTH,cell2mat(tl_grid(2,5)),'');
187)         model.labelTR              = createTextField(pPSTH,cell2mat(tl_grid(3,5)),'');
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

188)         
Christoph Budziszewski studychange works. added gu...

Christoph Budziszewski authored 14 years ago

189)         % OPTIONS
190)         grid_h = 0.16;
191)         grid_wl = 0.4;
192)         grid_wo = 0.6;
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

193)         
Christoph Budziszewski studychange works. added gu...

Christoph Budziszewski authored 14 years ago

194)         optGrid = cell([3 6]);
195)         optGrid{1,1} = [0.0 0.83 grid_wl grid_h];
196)         optGrid{2,1} = [0.4 0.83 grid_wo grid_h];
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

197)         
Christoph Budziszewski studychange works. added gu...

Christoph Budziszewski authored 14 years ago

198)         optGrid{1,2} = [0.0 0.66 grid_wl grid_h];
199)         optGrid{2,2} = [0.4 0.66 grid_wo grid_h];
200) 
201)         optGrid{1,3} = [0.0 0.5 grid_wl grid_h];
202)         optGrid{2,3} = [0.4 0.5 grid_wo grid_h];
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

203)         
Christoph Budziszewski studychange works. added gu...

Christoph Budziszewski authored 14 years ago

204)         optGrid{1,4} = [0.0 0.33 grid_wl grid_h];
205)         optGrid{2,4} = [0.4 0.33 grid_wo grid_h];
206) 
207)         optGrid{1,5} = [0.0 0.16 grid_wl grid_h];
208)         optGrid{2,5} = [0.4 0.16 grid_wo grid_h];
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

209)         
Christoph Budziszewski studychange works. added gu...

Christoph Budziszewski authored 14 years ago

210)         optGrid{1,6} = [0.0 0.0 grid_wl grid_h];
211)         optGrid{2,6} = [0.4 0.0 grid_wo grid_h];
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

212) 
Christoph Budziszewski studychange works. added gu...

Christoph Budziszewski authored 14 years ago

213)         % Options:Imagebase
214)         pOptions = uipanel(parent,'Title','Options','Position',cell2mat(main_grid(2,2)));
215)         set(pOptions,'BackgroundColor','w');
216) 
217)         createLabel(pOptions,cell2mat(optGrid(1,1)),'Image Base');
218)         model.imageTypeSelection = uicontrol(pOptions,'Style','popupmenu',...
219)         'Units','normalized',...
220)         'Position',cell2mat(optGrid(2,1)));
221)         set(model.imageTypeSelection,'BackgroundColor','w');
222)         
223)         %Options:normalizations
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

224)         
Christoph Budziszewski studychange works. added gu...

Christoph Budziszewski authored 14 years ago

225)         createLabel(pOptions,cell2mat(optGrid(1,2)),'psth norm4SVM');
226)         model.selNormPST = uicontrol(pOptions,'Style','popupmenu',...
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

227)             'Units','normalized',...
Christoph Budziszewski studychange works. added gu...

Christoph Budziszewski authored 14 years ago

228)             'Position',cell2mat(optGrid(2,2)),...
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

229)             'String',norm1Model,...
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

230)             'UserData',norm1Model);
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

231)          set(model.selNormPST,'BackgroundColor','w');   
232)         
Christoph Budziszewski studychange works. added gu...

Christoph Budziszewski authored 14 years ago

233)         model.chkColBias = uicontrol(pOptions,'Style','checkbox',...
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

234)             'Units','normalized',...
Christoph Budziszewski studychange works. added gu...

Christoph Budziszewski authored 14 years ago

235)             'Position',cell2mat(optGrid(2,3)),...
Christoph Budziszewski normalization features enabled

Christoph Budziszewski authored 15 years ago

236)             'String','column Bias removal',...
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

237)             'Enable','on');
Christoph Budziszewski normalization features enabled

Christoph Budziszewski authored 15 years ago

238)          set(model.chkColBias,'BackgroundColor','w');   
Christoph Budziszewski studychange works. added gu...

Christoph Budziszewski authored 14 years ago

239)          
240)          %Options:spatialGrouping
241) 
242)          createLabel(pOptions,cell2mat(optGrid(1,4)),'ROI Grouping');
243)          model.selRoiGrouping = uicontrol(pOptions,'Style','popupmenu',...
244)                 'Units','normalized',...
245)                 'Position',cell2mat(optGrid(2,4)),...
246)                 'String',roiGroupMethods,...
247)                 'UserData',roiGroupMethods);
248)          set(model.selRoiGrouping,'BackgroundColor','w');
249)          
250)         
251)         % COORD TABLE
252)         pVoxel = uipanel(parent,'Title','ROI','Position',cell2mat(main_grid(1,3)));
253)         set(pVoxel,'BackgroundColor','w');
254)         lVoxelDef = createLabel(pVoxel, [0 0.9 1 0.1],'<ROI Name> [+ radius (mm)];');
255)         model.txtVoxelDef = createTextField(pVoxel,[0 0 1 0.9],'');
256)         set(model.txtVoxelDef,'HorizontalAlignment','left');
257)         set(model.txtVoxelDef,'Max',20);
258)         set(model.txtVoxelDef,'Min',0);
259)         set(model.txtVoxelDef, 'FontName', 'FixedWidth');
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

260)         
261)         %buttons
262)         pButtons = uipanel(parent,'Position',cell2mat(main_grid(1,4)));
263)         set(pButtons,'BackgroundColor','w');
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

269)         
Christoph Budziszewski error tracking: added psth-...

Christoph Budziszewski authored 14 years ago

270)         btnRunButton2 = uicontrol(pButtons,'String',sprintf('load ROI for FBS'),...
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

271)             'Units','normalized','Position',[0.33 0 0.33 1]);
Christoph Budziszewski save load working for most...

Christoph Budziszewski authored 15 years ago

272)         set(btnRunButton2,'Callback',{@cbRunPreprocessing,model,'FBS'}); % set here, because of model.  
Christoph Budziszewski snapshot, working on fbs

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

277)         set(btnRunButton3,'Callback',{@cbRunPreprocessing,model,'ROI'}); % set here, because of model.    
278)         set(btnRunButton3,'Enable','on');
279) end
280) 
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

281) function model = createSecondStepPanel(model,parent)
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

282) basecolor = 'w';
283) 
Christoph Budziszewski studychange works. added gu...

Christoph Budziszewski authored 14 years ago

284) pTime = uipanel(parent,'Units','normalized','Position',[0.0 0.7 1 0.3]);
Christoph Budziszewski first plot button. not work...

Christoph Budziszewski authored 15 years ago

285)     set(pTime,'Title','Decode Timeframe Options');
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

286)     set(pTime,'BackgroundColor',basecolor);
Christoph Budziszewski studychange works. added gu...

Christoph Budziszewski authored 14 years ago

287)     grid_h = 0.25;
Christoph Budziszewski first plot button. not work...

Christoph Budziszewski authored 15 years ago

288)     grid_w = 0.3;
Christoph Budziszewski studychange works. added gu...

Christoph Budziszewski authored 14 years ago

289)     time_grid = cell([3 4]);
290)     time_grid{1,1} = [0.0 0.75 grid_w grid_h];
291)     time_grid{2,1} = [0.4 0.75 grid_w grid_h];
292)     time_grid{3,1} = [0.7 0.75 grid_w grid_h];
293)     time_grid{1,2} = [0.0 0.50 grid_w grid_h];
294)     time_grid{2,2} = [0.4 0.50 grid_w grid_h];
295)     time_grid{3,2} = [0.7 0.50 grid_w grid_h];
296)     time_grid{1,3} = [0.0 0.25 grid_w grid_h];
297)     time_grid{2,3} = [0.4 0.25 grid_w grid_h];
298)     time_grid{3,3} = [0.7 0.0 grid_w grid_h];
299)     time_grid{1,4} = [0.0 0.0 grid_w grid_h];
300)     time_grid{2,4} = [0.4 0.0 grid_w grid_h];
301)     time_grid{3,4} = [0.7 0.0 grid_w grid_h];
302)     
Christoph Budziszewski first plot button. not work...

Christoph Budziszewski authored 15 years ago

303)     lStart      = createLabel(pTime, cell2mat(time_grid(2,1)) ,'Start [sec]');
304)     lEnd        = createLabel(pTime, cell2mat(time_grid(3,1)) ,'End [sec]');
305)     lFrameShift = createLabel(pTime, cell2mat(time_grid(1,2)),'Frame Shift');
306)     lFramsSize  = createLabel(pTime, cell2mat(time_grid(1,3)),'Frame Size');
Christoph Budziszewski studychange works. added gu...

Christoph Budziszewski authored 14 years ago

307)     lFramegroup = createLabel(pTime, cell2mat(time_grid(1,4)),'Timeframe Grouping');
Christoph Budziszewski first plot button. not work...

Christoph Budziszewski authored 15 years ago

308)     
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

309)     model.txtFrameShiftStart   = createTextField(pTime,cell2mat(time_grid(2,2)),'');
310)     model.txtFrameShiftEnd     = createTextField(pTime,cell2mat(time_grid(3,2)),'');
311)     model.txtFrameShiftDur     = createTextField(pTime,cell2mat(time_grid(2,3)),'');
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

312)     
Christoph Budziszewski studychange works. added gu...

Christoph Budziszewski authored 14 years ago

313)     TimeframeGroupingOptions = {'none','sum','mean','max','median'};
314)     
315)     model.selTimeframeGrouping = uicontrol(pTime,'Style','popupmenu',...
316)         'Units','normalized',...
317)         'Position',cell2mat(time_grid(2,4)),...
318)         'String',TimeframeGroupingOptions,...
319)         'UserData',TimeframeGroupingOptions);
320)     set(model.selTimeframeGrouping,'Enable','off');
321)     
322) pSVM = uipanel(parent,'Units','normalized','Position',[0 0.3 0.5 0.4]);
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

323)     set(pSVM,'Title','SVM Classification');
324)     set(pSVM,'BackgroundColor',basecolor);
325) 
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

326)     model.txtSVMopts = createTextField(pSVM,[0 0.83 1 0.16],'');
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

327)     set(model.txtSVMopts,'HorizontalAlignment','left');
328)     
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

329)     model.txtSVMnfold = createTextField(pSVM,[0.0 0.66 0.5 0.16],'');
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

330)     createLabel(pSVM,[0.5 0.50 0.5 0.25 ],'-Fold CrossVal');
331)     
Christoph Budziszewski begin SOM implementation

Christoph Budziszewski authored 15 years ago

332)     model.chkSVMrnd = uicontrol(pSVM,'Style','checkbox','Units','normalized','Position',[0.1 0.50 0.9 0.16]);
Christoph Budziszewski added randomize datapoints...

Christoph Budziszewski authored 15 years ago

333)     set(model.chkSVMrnd,'String','Randomize Datapoints');
334)     set(model.chkSVMrnd,'BackgroundColor','w');
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

335) %     set(model.chkSVMrnd,'Value',StudyArgs.svmrnd);
Christoph Budziszewski added randomize datapoints...

Christoph Budziszewski authored 15 years ago

336)     
Christoph Budziszewski begin SOM implementation

Christoph Budziszewski authored 15 years ago

337)     btnRunSVM = uicontrol(pSVM,'String','run batchmode SVM Crossvalidation',...
338)         'Units','normalized',...
339)         'Position',[0 0.25 1 0.25]);
340)     set(btnRunSVM,'Enable','on');
341)     
342)     btnRunXSVM = uicontrol(pSVM,'String','run SVM X-Subject validation',...
343)         'Units','normalized',...
344)         'Position',[0 0.0 1 0.25]);
345)     set(btnRunXSVM,'Enable','on');
Christoph Budziszewski added randomize datapoints...

Christoph Budziszewski authored 15 years ago

346)     
Christoph Budziszewski studychange works. added gu...

Christoph Budziszewski authored 14 years ago

347) pSOM = uipanel(parent,'Units','normalized','Position',[0.5 0.3 0.5 0.4]);
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

348)     set(pSOM,'Title','SOM Classification');
349)     set(pSOM,'BackgroundColor',basecolor);
350) 
Christoph Budziszewski refined gui elements

Christoph Budziszewski authored 14 years ago

351)     createLabel(pSOM,[0 0.75 0.3 0.20],'Size:');
Christoph Budziszewski studychange works. added gu...

Christoph Budziszewski authored 14 years ago

352)     model.txtSomM = createTextField(pSOM,[0.3 0.75 0.25 0.16],'');
353)     somsizemal = createLabel(pSOM,[0.55 0.75 0.2 0.16],'x');
Christoph Budziszewski refined gui elements

Christoph Budziszewski authored 14 years ago

354)     set(somsizemal,'HorizontalAlignment','center');
Christoph Budziszewski studychange works. added gu...

Christoph Budziszewski authored 14 years ago

355)     model.txtSomN = createTextField(pSOM,[0.75 0.75 0.25 0.16],'');
Christoph Budziszewski refined gui elements

Christoph Budziszewski authored 14 years ago

356)     latticeModel = {'rect','hexa'};
357)     model.selSomLattice = uicontrol(pSOM,'Style','popupmenu',...
358)         'Units','normalized',...
Christoph Budziszewski studychange works. added gu...

Christoph Budziszewski authored 14 years ago

359)         'Position',[0.0 0.5 0.3 0.16],...
Christoph Budziszewski refined gui elements

Christoph Budziszewski authored 14 years ago

360)         'String',latticeModel,...
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

361)         'UserData',latticeModel);
Christoph Budziszewski refined gui elements

Christoph Budziszewski authored 14 years ago

362)     set(model.selSomLattice,'BackgroundColor','w');
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

363) 
Christoph Budziszewski studychange works. added gu...

Christoph Budziszewski authored 14 years ago

364)     model.txtSOMnfold = createTextField(pSOM,[0.5 0.50 0.25 0.16],'');
Christoph Budziszewski refined gui elements

Christoph Budziszewski authored 14 years ago

365) %     set(model.txtSOMnfold,'Enable','off');
Christoph Budziszewski studychange works. added gu...

Christoph Budziszewski authored 14 years ago

366)     createLabel(pSOM,[0.75 0.5 0.25 0.16 ],'-Fold CrossVal');
Christoph Budziszewski refined gui elements

Christoph Budziszewski authored 14 years ago

367)        
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

368) 
369)     btnRunSOM = uicontrol(pSOM,'String','run SOM Crossvalidation',...
370)         'Units','normalized',...
Christoph Budziszewski begin SOM implementation

Christoph Budziszewski authored 15 years ago

371)         'Position',[0.0 0.25 1 0.25]);
Christoph Budziszewski SOM Single run

Christoph Budziszewski authored 15 years ago

372)     set(btnRunSOM,'Enable','on');
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

373) 
374)     btnRunXSOM = uicontrol(pSOM,'String','run SOM X-Subject validation',...
375)         'Units','normalized',...
376)         'Position',[0.0 0.0 1 0.25]);
Christoph Budziszewski manual renamings, better FB...

Christoph Budziszewski authored 15 years ago

377)     set(btnRunXSOM,'Enable','on');
Christoph Budziszewski radius frontend enabled, fi...

Christoph Budziszewski authored 15 years ago

378)     
Christoph Budziszewski studychange works. added gu...

Christoph Budziszewski authored 14 years ago

379) pSearchlight = uipanel(parent,'Units','normalized','Position',[0.0 0.0 0.5 0.3]);
Christoph Budziszewski radius frontend enabled, fi...

Christoph Budziszewski authored 15 years ago

380)     set(pSearchlight,'Title','Spatiotemporal FB classification');
381)     set(pSearchlight,'BackgroundColor',basecolor);
382)     
Christoph Budziszewski almost all "change study" f...

Christoph Budziszewski authored 14 years ago

383)     lSearchligh = createLabel(pSearchlight, [0 0.6 0.5 0.3],'Searchlight Radius (mm)');
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

384)     model.txtSearchlightRadius = createTextField(pSearchlight,[0.5 0.6 0.5 0.3],'');
Christoph Budziszewski radius frontend enabled, fi...

Christoph Budziszewski authored 15 years ago

385)     
Christoph Budziszewski refined gui elements

Christoph Budziszewski authored 14 years ago

386)     lFBSTiming = createLabel(pSearchlight, [0 0.3 0.5 0.3],'Optional Timeline ( e.g. ''-5 0 5 10 15'')');
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

387)     model.txtSearchlightTimeline = createTextField(pSearchlight,[0.5 0.3 0.5 0.3],'');
Christoph Budziszewski fbs timeline mod

Christoph Budziszewski authored 14 years ago

388) 
Christoph Budziszewski radius frontend enabled, fi...

Christoph Budziszewski authored 15 years ago

389)     btnRunFBS = uicontrol(pSearchlight,'String','run Spatiotemporal FB classification',...
390)         'Units','normalized',...
391)         'Position',[0.0 0.0 1 0.3]);
Christoph Budziszewski snapshot, working on fbs

Christoph Budziszewski authored 15 years ago

392)     set(btnRunFBS,'Enable','on');
Christoph Budziszewski radius frontend enabled, fi...

Christoph Budziszewski authored 15 years ago

393)     
Christoph Budziszewski begin SOM implementation

Christoph Budziszewski authored 15 years ago

394) 
395) % button callbacks set here, because of model.
396)     set(btnRunSVM, 'Callback',{@cbRunDecode,model,'SVM'}); 
397)     set(btnRunXSVM,'Callback',{@cbRunDecode,model,'XSVM'}); 
398)     set(btnRunSOM, 'Callback',{@cbRunDecode,model,'SOM'});
Christoph Budziszewski radius frontend enabled, fi...

Christoph Budziszewski authored 15 years ago

399)     set(btnRunXSOM,'Callback',{@cbRunDecode,model,'XSOM'});
Christoph Budziszewski extracted psth-plot to extr...

Christoph Budziszewski authored 14 years ago

400)     set(btnRunFBS, 'Callback',{@cbRunDecode,model,'FBS'});
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

401) end
402) 
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

403) function model = createVisualStepPanel(model,parent)
Christoph Budziszewski extracted psth-plot to extr...

Christoph Budziszewski authored 14 years ago

404) 
405)     grid_h = 0.25;
406)     grid_w = 0.5;
407)     plot_grid = cell([3 3]);
408)     plot_grid{1,1} = [0.0 0.63 grid_w grid_h];
409)     plot_grid{1,2} = [0.0 0.33 grid_w grid_h];
410)     plot_grid{1,3} = [0.0 0.03 grid_w grid_h];
Christoph Budziszewski refined gui elements

Christoph Budziszewski authored 14 years ago

411)     plot_grid{2,1} = [0.25 0.63 grid_w grid_h];
412)     plot_grid{2,2} = [0.25 0.33 grid_w grid_h];
413)     plot_grid{2,3} = [0.25 0.03 grid_w grid_h];
Christoph Budziszewski extracted psth-plot to extr...

Christoph Budziszewski authored 14 years ago

414) 
Christoph Budziszewski all enabled features workin...

Christoph Budziszewski authored 15 years ago

415)     pButtonPane = uipanel(parent,'Units','normalized','Position',[0 0.5 1 0.5]);
Christoph Budziszewski first plot button. not work...

Christoph Budziszewski authored 15 years ago

416) %     set(pButtonPane,'Title','Plot');
417)     set(pButtonPane,'BackgroundColor','w');
Christoph Budziszewski refined gui elements

Christoph Budziszewski authored 14 years ago

418)     
419)     btnPlot03 = uicontrol(pButtonPane,'String','plot PSTH',...
420)         'Units','normalized',...
421)         'Position',cell2mat(plot_grid(2,1)));
422)     set(btnPlot03,'Callback',{@cbPlot,model,'psth'}); 
423)     set(btnPlot03,'Enable','on');
424)   
Christoph Budziszewski all enabled features workin...

Christoph Budziszewski authored 15 years ago

425)     btnPlot01 = uicontrol(pButtonPane,'String','plot performance and SE',...
Christoph Budziszewski first plot button. not work...

Christoph Budziszewski authored 15 years ago

426)         'Units','normalized',...
Christoph Budziszewski refined gui elements

Christoph Budziszewski authored 14 years ago

427)         'Position',cell2mat(plot_grid(2,2)));
Christoph Budziszewski all enabled features workin...

Christoph Budziszewski authored 15 years ago

428)     set(btnPlot01,'Callback',{@cbPlot,model,'simple'});
Christoph Budziszewski first plot button. not work...

Christoph Budziszewski authored 15 years ago

429)     set(btnPlot01,'Enable','on');
Christoph Budziszewski all enabled features workin...

Christoph Budziszewski authored 15 years ago

430)     
431)     btnPlot02 = uicontrol(pButtonPane,'String','plot subject performance and mean with SE',...
432)         'Units','normalized',...
Christoph Budziszewski extracted psth-plot to extr...

Christoph Budziszewski authored 14 years ago

433)         'Position',cell2mat(plot_grid(2,3)));
Christoph Budziszewski all enabled features workin...

Christoph Budziszewski authored 15 years ago

434)     set(btnPlot02,'Callback',{@cbPlot,model,'x-subject-val'});
435)     set(btnPlot02,'Enable','on');
436) 
437)     
Christoph Budziszewski first plot button. not work...

Christoph Budziszewski authored 15 years ago

438) end
439) 
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

440) %%%%% ui callbacks
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

441) 
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

442) function cbSwitchTask(src,evnt,task,taskpanel)
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

443) set(taskpanel.preprocessing,'Visible','off');
444) set(taskpanel.classification,'Visible','off');
Christoph Budziszewski first plot button. not work...

Christoph Budziszewski authored 15 years ago

445) set(taskpanel.plot,'Visible','off');
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

446) switch task
447)     case 'PRE'
448)         set(taskpanel.preprocessing,'Visible','on');
Christoph Budziszewski fbs timeline mod, model in...

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

450)     case 'CLASSIFY'
451)         set(taskpanel.classification,'Visible','on');
Christoph Budziszewski fbs timeline mod, model in...

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

453)     case 'PLOT'
Christoph Budziszewski first plot button. not work...

Christoph Budziszewski authored 15 years ago

454)         set(taskpanel.plot,'Visible','on');
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

455) end
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

456) % assignin('base','model',model);
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

457) end
458) 
Christoph Budziszewski started save/load functiona...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

460) main(model,'pre',task);
461) end
462) 
463) function cbRunDecode(src,evnt,model,task)
464) main(model,'decode',task);
Christoph Budziszewski started save/load functiona...

Christoph Budziszewski authored 15 years ago

465) end
466) 
Christoph Budziszewski first plot button. not work...

Christoph Budziszewski authored 15 years ago

467) function cbPlot(src,evnt,model,type)
468) main(model,'plot',type);
469) end
470) 
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

471) %%%%%%%%%% menu callbacks
Christoph Budziszewski first plot button. not work...

Christoph Budziszewski authored 15 years ago

472) 
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

473) function mcb_save(src,evnt,model)
474) studyID = get(model.txtStudyID,'String');
475) saveStudy(studyID,model);
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

476) end
477) 
Christoph Budziszewski almost all "change study" f...

Christoph Budziszewski authored 14 years ago

478) function mcb_update_subjects(src,evnt,model)
479) studyID = get(model.txtStudyID,'String');
480) baseDir = getBaseDir(model);
481) subjectNames = listDirNames(baseDir);
482) 
483) set(model.subjectSelector,'String',subjectNames);
484) set(model.subjectSelector,'UserData',subjectNames);
485) set(model.subjectSelector,'Value',1);
486) 
487) saveStudy(studyID,model);
488) end
489) 
490) function mcb_update_imagebase(src,evnt,model)
491) studyID = get(model.txtStudyID,'String');
492) 
493) subjectNames = getSubjectCellList(model);
494) imageDir = fullfile(getBaseDir(model),cell2mat(subjectNames(1)));
495) imageMask = imageMaskNames(imageDir);
496) 
497) set(model.imageTypeSelection,'String',imageMask);
498) set(model.imageTypeSelection,'UserData',imageMask);
499) set(model.imageTypeSelection,'Value',1);
500) 
501) saveStudy(studyID,model);
502) end
503) 
504) 
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

505) function mcb_new_study(src,evnt,studymenu,uimodel)
Christoph Budziszewski almost all "change study" f...

Christoph Budziszewski authored 14 years ago

506) studyID = get(uimodel.txtStudyID,'String');
507) saveStudy(studyID,uimodel);
508) 
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

509) display('CREATE STUDY');
510)     ui_createStudy(studymenu,uimodel);
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

511) end
512) 
513) 
514) 
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

515) 
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

516) 
517) 
518) 
519)