de857369edab4a7076e0bdacae4778263ad585e0
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 new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

101)     main_grid{2,1} = [0.4 0.7 0.6 0.3];
102)     main_grid{2,2} = [0.5 0.5 0.5 0.2];
103)     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

104)     
105)     %Subjects
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 14 years ago

117) 
118)   
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

140) 
141) 
142)     %Timeline
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

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

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

Christoph Budziszewski authored 15 years ago

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

153)         
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

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

157) 
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

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

161)         
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

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

165) 
Christoph Budziszewski added TR

Christoph Budziszewski authored 15 years ago

166)         tl_grid{1,5} = [0.0 0.16 grid_w grid_h];
167)         tl_grid{2,5} = [0.4 0.16 grid_w grid_h];
168)         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

169)         
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

186)         
187)         % images
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

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

189)         set(pImage,'BackgroundColor','w');
190) 
191)         createLabel(pImage,[0.0 0.5 1 0.5],'Select Image Base');
192)         
193)         model.imageTypeSelection = uicontrol(pImage,'Style','popupmenu',...
194)         'Units','normalized',...
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

195)         'Position',[0.0 0.0 1 0.5]);
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

196)         set(model.imageTypeSelection,'BackgroundColor','w');
197)         
198)         % coordinate Table
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

200)         set(pVoxel,'BackgroundColor','w');
Christoph Budziszewski radius frontend enabled, fi...

Christoph Budziszewski authored 15 years ago

201)         lVoxelDef = createLabel(pVoxel, [0 0.9 1 0.1],'<ROI Name> [+ radius (mm)];');
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

202)         model.txtVoxelDef = createTextField(pVoxel,[0 0 1 0.9],'');
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

203)         set(model.txtVoxelDef,'HorizontalAlignment','left');
204)         set(model.txtVoxelDef,'Max',20);
205)         set(model.txtVoxelDef,'Min',0);
206)         set(model.txtVoxelDef, 'FontName', 'FixedWidth');
207)         
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

208)         %normalizations
209)         pNorm = uipanel(parent,'Title','Normalization','Position',cell2mat(main_grid(2,3)));
210)         set(pNorm,'BackgroundColor','w');
211)         
Christoph Budziszewski coordTabel works for JZ006

Christoph Budziszewski authored 15 years ago

212)         createLabel(pNorm,[0 0.75 1 0.25],'psth norm4SVM');
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

213)         
214)         
Christoph Budziszewski coordTabel works for JZ006

Christoph Budziszewski authored 15 years ago

215)         norm1Model = {'none','mean','minmax'};
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

216) 
217)         
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

218)         model.selNormPST = uicontrol(pNorm,'Style','popupmenu',...
219)             'Units','normalized',...
220)             'Position',[0.0 0.5 1 0.25],...
221)             'String',norm1Model,...
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

223)          set(model.selNormPST,'BackgroundColor','w');   
224)         
Christoph Budziszewski normalization features enabled

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

226)             'Units','normalized',...
Christoph Budziszewski normalization features enabled

Christoph Budziszewski authored 15 years ago

227)             'Position',[0.0 0.1 1 0.25],...
228)             'String','column Bias removal',...
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

230)          set(model.chkColBias,'BackgroundColor','w');   
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

231)         
232)         %buttons
233)         pButtons = uipanel(parent,'Position',cell2mat(main_grid(1,4)));
234)         set(pButtons,'BackgroundColor','w');
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

248)         set(btnRunButton3,'Callback',{@cbRunPreprocessing,model,'ROI'}); % set here, because of model.    
249)         set(btnRunButton3,'Enable','on');
250) end
251) 
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

253) basecolor = 'w';
254) 
Christoph Budziszewski first plot button. not work...

Christoph Budziszewski authored 15 years ago

255) pTime = uipanel(parent,'Units','normalized','Position',[0.0 0.8 1 0.2]);
256)     set(pTime,'Title','Decode Timeframe Options');
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

257)     set(pTime,'BackgroundColor',basecolor);
Christoph Budziszewski first plot button. not work...

Christoph Budziszewski authored 15 years ago

258)     grid_h = 0.3;
259)     grid_w = 0.3;
260)     time_grid = cell([3 3]);
261)     time_grid{1,1} = [0.0 0.63 grid_w grid_h];
262)     time_grid{2,1} = [0.4 0.63 grid_w grid_h];
263)     time_grid{3,1} = [0.7 0.63 grid_w grid_h];
264)     time_grid{1,2} = [0.0 0.33 grid_w grid_h];
265)     time_grid{2,2} = [0.4 0.33 grid_w grid_h];
266)     time_grid{3,2} = [0.7 0.33 grid_w grid_h];
267)     time_grid{1,3} = [0.0 0.03 grid_w grid_h];
268)     time_grid{2,3} = [0.4 0.03 grid_w grid_h];
269)     time_grid{3,3} = [0.7 0.03 grid_w grid_h];
270) 
271)     lStart      = createLabel(pTime, cell2mat(time_grid(2,1)) ,'Start [sec]');
272)     lEnd        = createLabel(pTime, cell2mat(time_grid(3,1)) ,'End [sec]');
273)     lFrameShift = createLabel(pTime, cell2mat(time_grid(1,2)),'Frame Shift');
274)     lFramsSize  = createLabel(pTime, cell2mat(time_grid(1,3)),'Frame Size');
275)     
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

276)     model.txtFrameShiftStart   = createTextField(pTime,cell2mat(time_grid(2,2)),'');
277)     model.txtFrameShiftEnd     = createTextField(pTime,cell2mat(time_grid(3,2)),'');
278)     model.txtFrameShiftDur     = createTextField(pTime,cell2mat(time_grid(2,3)),'');
Christoph Budziszewski first plot button. not work...

Christoph Budziszewski authored 15 years ago

279) 
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

282)     set(pSVM,'Title','SVM Classification');
283)     set(pSVM,'BackgroundColor',basecolor);
284) 
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

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

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

295)     
Christoph Budziszewski begin SOM implementation

Christoph Budziszewski authored 15 years ago

296)     btnRunSVM = uicontrol(pSVM,'String','run batchmode SVM Crossvalidation',...
297)         'Units','normalized',...
298)         'Position',[0 0.25 1 0.25]);
299)     set(btnRunSVM,'Enable','on');
300)     
301)     btnRunXSVM = uicontrol(pSVM,'String','run SVM X-Subject validation',...
302)         'Units','normalized',...
303)         'Position',[0 0.0 1 0.25]);
304)     set(btnRunXSVM,'Enable','on');
Christoph Budziszewski added randomize datapoints...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

307)     set(pSOM,'Title','SOM Classification');
308)     set(pSOM,'BackgroundColor',basecolor);
309) 
Christoph Budziszewski refined gui elements

Christoph Budziszewski authored 14 years ago

310)     createLabel(pSOM,[0 0.75 0.3 0.20],'Size:');
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

311)     model.txtSomM = createTextField(pSOM,[0.3 0.75 0.25 0.2],'');
Christoph Budziszewski refined gui elements

Christoph Budziszewski authored 14 years ago

312)     somsizemal = createLabel(pSOM,[0.55 0.75 0.2 0.20],'x');
313)     set(somsizemal,'HorizontalAlignment','center');
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 14 years ago

315)     latticeModel = {'rect','hexa'};
316)     model.selSomLattice = uicontrol(pSOM,'Style','popupmenu',...
317)         'Units','normalized',...
318)         'Position',[0.0 0.5 0.3 0.20],...
319)         'String',latticeModel,...
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

322) 
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 14 years ago

324) %     set(model.txtSOMnfold,'Enable','off');
325)     createLabel(pSOM,[0.75 0.5 0.25 0.20 ],'-Fold CrossVal');
326)        
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

327) 
328)     btnRunSOM = uicontrol(pSOM,'String','run SOM Crossvalidation',...
329)         'Units','normalized',...
Christoph Budziszewski begin SOM implementation

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

332) 
333)     btnRunXSOM = uicontrol(pSOM,'String','run SOM X-Subject validation',...
334)         'Units','normalized',...
335)         'Position',[0.0 0.0 1 0.25]);
Christoph Budziszewski manual renamings, better FB...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

337)     
Christoph Budziszewski refined gui elements

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

339)     set(pSearchlight,'Title','Spatiotemporal FB classification');
340)     set(pSearchlight,'BackgroundColor',basecolor);
341)     
Christoph Budziszewski almost all "change study" f...

Christoph Budziszewski authored 14 years ago

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

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

Christoph Budziszewski authored 15 years ago

344)     
Christoph Budziszewski refined gui elements

Christoph Budziszewski authored 14 years ago

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

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

352)     
Christoph Budziszewski begin SOM implementation

Christoph Budziszewski authored 15 years ago

353) 
354) % button callbacks set here, because of model.
355)     set(btnRunSVM, 'Callback',{@cbRunDecode,model,'SVM'}); 
356)     set(btnRunXSVM,'Callback',{@cbRunDecode,model,'XSVM'}); 
357)     set(btnRunSOM, 'Callback',{@cbRunDecode,model,'SOM'});
Christoph Budziszewski radius frontend enabled, fi...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

360) end
361) 
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

363) 
364)     grid_h = 0.25;
365)     grid_w = 0.5;
366)     plot_grid = cell([3 3]);
367)     plot_grid{1,1} = [0.0 0.63 grid_w grid_h];
368)     plot_grid{1,2} = [0.0 0.33 grid_w grid_h];
369)     plot_grid{1,3} = [0.0 0.03 grid_w grid_h];
Christoph Budziszewski refined gui elements

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

373) 
Christoph Budziszewski all enabled features workin...

Christoph Budziszewski authored 15 years ago

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

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

Christoph Budziszewski authored 14 years ago

377)     
378)     btnPlot03 = uicontrol(pButtonPane,'String','plot PSTH',...
379)         'Units','normalized',...
380)         'Position',cell2mat(plot_grid(2,1)));
381)     set(btnPlot03,'Callback',{@cbPlot,model,'psth'}); 
382)     set(btnPlot03,'Enable','on');
383)   
Christoph Budziszewski all enabled features workin...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

393)     set(btnPlot02,'Callback',{@cbPlot,model,'x-subject-val'});
394)     set(btnPlot02,'Enable','on');
395) 
396)     
Christoph Budziszewski first plot button. not work...

Christoph Budziszewski authored 15 years ago

397) end
398) 
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

400) 
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

405) switch task
406)     case 'PRE'
407)         set(taskpanel.preprocessing,'Visible','on');
Christoph Budziszewski fbs timeline mod, model in...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

416) end
417) 
Christoph Budziszewski started save/load functiona...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

419) main(model,'pre',task);
420) end
421) 
422) function cbRunDecode(src,evnt,model,task)
423) main(model,'decode',task);
Christoph Budziszewski started save/load functiona...

Christoph Budziszewski authored 15 years ago

424) end
425) 
Christoph Budziszewski first plot button. not work...

Christoph Budziszewski authored 15 years ago

426) function cbPlot(src,evnt,model,type)
427) main(model,'plot',type);
428) end
429) 
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

431) 
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

432) function mcb_save(src,evnt,model)
433) studyID = get(model.txtStudyID,'String');
434) saveStudy(studyID,model);
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

435) end
436) 
Christoph Budziszewski almost all "change study" f...

Christoph Budziszewski authored 14 years ago

437) function mcb_update_subjects(src,evnt,model)
438) studyID = get(model.txtStudyID,'String');
439) baseDir = getBaseDir(model);
440) subjectNames = listDirNames(baseDir);
441) 
442) set(model.subjectSelector,'String',subjectNames);
443) set(model.subjectSelector,'UserData',subjectNames);
444) set(model.subjectSelector,'Value',1);
445) 
446) saveStudy(studyID,model);
447) end
448) 
449) function mcb_update_imagebase(src,evnt,model)
450) studyID = get(model.txtStudyID,'String');
451) 
452) subjectNames = getSubjectCellList(model);
453) imageDir = fullfile(getBaseDir(model),cell2mat(subjectNames(1)));
454) imageMask = imageMaskNames(imageDir);
455) 
456) set(model.imageTypeSelection,'String',imageMask);
457) set(model.imageTypeSelection,'UserData',imageMask);
458) set(model.imageTypeSelection,'Value',1);
459) 
460) saveStudy(studyID,model);
461) end
462) 
463) 
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 14 years ago

465) studyID = get(uimodel.txtStudyID,'String');
466) saveStudy(studyID,uimodel);
467) 
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

470) end
471) 
472) 
473) 
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

474) 
Christoph Budziszewski first eventually working st...

Christoph Budziszewski authored 14 years ago

475) 
476) 
477) 
478)