4b81e19c3cdee2ad9373c3c35a92544646b31471
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 save load working for most...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

17)     task = struct;
18)     
Christoph Budziszewski spm2 compatibility, start c...

Christoph Budziszewski authored 14 years ago

19)     DEFAULT = mcb_load_study(0,0,'study/stimolos.mat');
20)     
Christoph Budziszewski task-models implementet.

Christoph Budziszewski authored 15 years ago

21)     model1 = struct;
22)     model1.baseDir = DEFAULT.wd;
Christoph Budziszewski save load working for most...

Christoph Budziszewski authored 15 years ago

23) 
Christoph Budziszewski task-models implementet.

Christoph Budziszewski authored 15 years ago

24)     model1.txtBaseDir = createLabel(frame,[0 0.97 1 0.03],model1.baseDir);
25)     set(model1.txtBaseDir,'BackgroundColor','w');
26)     set(model1.txtBaseDir,'ForegroundColor','b');
Christoph Budziszewski save load working for most...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

34)     
Christoph Budziszewski task-models implementet.

Christoph Budziszewski authored 15 years ago

35)     model1.selectedSubject = DEFAULT.selectedSubject;
36)     model1 = createFirstStepPanel(model1,task.preprocessing,DEFAULT);
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

37)     
Christoph Budziszewski task-models implementet.

Christoph Budziszewski authored 15 years ago

38)     % fill with data
39)     model1 = scanDirs(model1);
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

41)     % CLASSIFICATION
Christoph Budziszewski task-models implementet.

Christoph Budziszewski authored 15 years ago

42)     model2 = struct;
43)     
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

44)     task.classification = uipanel(frame,'Title','Classification','Position',[0 0.0 1 TASK_HEIGHT]);
45)     set(task.classification,'BackgroundColor','w');
Christoph Budziszewski task-models implementet.

Christoph Budziszewski authored 15 years ago

46)     model2 = createSecondStepPanel(model2,task.classification,DEFAULT);
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

48)     % PLOT
Christoph Budziszewski task-models implementet.

Christoph Budziszewski authored 15 years ago

49)     model3 = struct;
Christoph Budziszewski first plot button. not work...

Christoph Budziszewski authored 15 years ago

50)     task.plot = uipanel(frame,'Title','Plot','Position',[0 0.0 1 TASK_HEIGHT]);
51)     set(task.plot,'BackgroundColor','w');
Christoph Budziszewski task-models implementet.

Christoph Budziszewski authored 15 years ago

52)     model3 = createVisualStepPanel(model3,task.plot,DEFAULT);
Christoph Budziszewski first plot button. not work...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

54)     % TASK
Christoph Budziszewski normalization features enabled

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

57) %         set(task.taskSwitch,'Title','TASK');
58)         set(task.taskSwitch,'BackgroundColor','w');
59)         set(task.taskSwitch,'Units','normalized');
60)     
Christoph Budziszewski normalization features enabled

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

63)             'Units','normalized','Position',[0.0 0.0 0.33 1]);
Christoph Budziszewski fbs timeline mod, model in...

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

65)         set(btnSwitchPreprocessing,'Enable','on');
66) 
Christoph Budziszewski normalization features enabled

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

69)             'Units','normalized','Position',[0.33 0.0 0.33 1]);
Christoph Budziszewski fbs timeline mod, model in...

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

71)         set(btnSwitchClassify,'Enable','on');
72) 
Christoph Budziszewski normalization features enabled

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

75)             'Units','normalized','Position',[0.66 0.0 0.33 1]);
Christoph Budziszewski fbs timeline mod, model in...

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

77)         set(btnSwitchPlot,'Enable','on');
78) 
79)     % menu
80)     
Christoph Budziszewski stable version for conference.

Christoph Budziszewski authored 15 years ago

81)     savemenu = uimenu(frame,'Label','Save/Load','Enable','off');
Christoph Budziszewski disabled save-menu

Christoph Budziszewski authored 15 years ago

82)         uimenu(savemenu,'Label','Save Preprocessing Parameter','Callback',{@mcb_save,model1},'Enable','off');
83)         uimenu(savemenu,'Label','Load Preprocessing Parameter','Callback',{@mcb_load,model1},'Enable','off');
Christoph Budziszewski task-models implementet.

Christoph Budziszewski authored 15 years ago

84)         uimenu(savemenu,'Label','Save Decode Parameter','Callback',{@mcb_save,model2},'Enable','off');
85)         uimenu(savemenu,'Label','Load Decode Parameter','Callback',{@mcb_load,model2},'Enable','off');
86)         uimenu(savemenu,'Label','Save All','Callback',{@mcb_save,model1},'Enable','off');
87)         uimenu(savemenu,'Label','Load All','Callback',{@mcb_load,model1},'Enable','off');
88)         
Christoph Budziszewski spm2 compatibility, start c...

Christoph Budziszewski authored 14 years ago

89)     studymenu = uimenu(frame,'Label','change Study','Enable','on');
90)         fillStudyMenu(studymenu);
Christoph Budziszewski started save/load functiona...

Christoph Budziszewski authored 15 years ago

91)     
Christoph Budziszewski fbs timeline mod, model in...

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

97) 
Christoph Budziszewski spm2 compatibility, start c...

Christoph Budziszewski authored 14 years ago

98) function fillStudyMenu(studymenu)
99)     studydir = fullfile(getTbxPath,'study');
100)     files = dir(studydir);
101)     for fileidx = 1: numel(files)
102)         if ~files(fileidx).isdir
103)             uimenu(studymenu,'Label',files(fileidx).name,'Callback',{@mcb_load_study,fullfile(studydir,files(fileidx).name)});
104)         end
105)     end
106) end
107) 
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

110)     main_grid = cell(2,4);
111)     main_grid{1,1} = [0 0.7 0.4 0.3];
112)     main_grid{1,2} = [0 0.5 0.5 0.2];
113)     main_grid{1,3} = [0 0.1 0.5 0.4];
114)     main_grid{1,4} = [0 0.0 1.0 0.1];
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

119)     
120)     %Subjects
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

121)     pSubject = uipanel(parent,'Units','normalized','Position',cell2mat(main_grid(1,1)));
122)     set(pSubject,'Title','Subjects');
123)     set(pSubject,'BackgroundColor','w');
124)     
125)     subjectList = {'DUMMY Subj1','DUMMY Subj2','DUMMY Subj3','DUMMY Subj4'};
126)     model.subjectSelector = uicontrol(pSubject,'Style','listbox',...
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

127)                     'Min',1, 'Max',3,...
128)                     'String',subjectList,...
129)                     'UserData',subjectList,...
130)                     'Units','normalized',...
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

134)     
135)     %Classes
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

137)     set(pClasses,'Title','Class Definitions');
138)     set(pClasses,'BackgroundColor','w');
139)         lClassDef = uicontrol(pClasses,...
140)             'Style','text',...
141)             'String',sprintf('<Label>,\t <[Event, Event, ..]>;'),...
142)             'Units','normalized',...
143)             'Position',[0 0.8 1 0.2]);
144)         set(lClassDef,'BackgroundColor','w');
145)         set(lClassDef,'HorizontalAlignment','left');
146)         
147)         model.txtClassDef = uicontrol(pClasses,'Style','edit',...
148)             'String',sprintf(DEFAULT.classdefstring),...
149)             'Units','normalized',...
150)             'Position',[0 0 1 0.8]);
151)         set(model.txtClassDef,'HorizontalAlignment','left');
152)         set(model.txtClassDef,'Max',20);
153)         set(model.txtClassDef,'Min',0);
154)         set(model.txtClassDef, 'FontName', 'FixedWidth');
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

156) 
157) 
158)     %Timeline
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

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

160)     set(pPSTH,'BackgroundColor','w');
161)         
162)         grid_h = 0.16;
163)         grid_w = 0.3;
164)         
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

165)         tl_grid = cell([3 6]);
166)         tl_grid{2,1} = [0.0 0.83 grid_w grid_h];
167)         tl_grid{2,1} = [0.4 0.83 grid_w grid_h];
168)         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

169)         
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

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

173) 
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

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

177)         
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

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

181) 
Christoph Budziszewski added TR

Christoph Budziszewski authored 15 years ago

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

185)         
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

186)         tl_grid{1,6} = [0.0 0.0 0.5 grid_h];
187)         tl_grid{2,6} = [0.5 0.0 grid_w grid_h];
188)         tl_grid{3,6} = [0.75 0.0 grid_w grid_h];
189) 
190)         lStart      = createLabel(pPSTH, cell2mat(tl_grid(2,1)) ,'Start [sec]');
191)         lEnd        = createLabel(pPSTH, cell2mat(tl_grid(3,1)) ,'End [sec]');
192)         lPSTH       = createLabel(pPSTH, cell2mat(tl_grid(1,2)),'PSTH Range');
193)         lBaseline   = createLabel(pPSTH, cell2mat(tl_grid(1,3)),'Baseline');
Christoph Budziszewski added TR

Christoph Budziszewski authored 15 years ago

194)         lTRF        = createLabel(pPSTH, cell2mat(tl_grid(1,5)),'TR Factor');
Christoph Budziszewski first plot button. not work...

Christoph Budziszewski authored 15 years ago

195) 
Christoph Budziszewski subject list from filesyste...

Christoph Budziszewski authored 15 years ago

196)         model.txtPSTHStart         = createTextField(pPSTH,cell2mat(tl_grid(2,2)),DEFAULT.pststart);
197)         model.txtPSTHEnd           = createTextField(pPSTH,cell2mat(tl_grid(3,2)),DEFAULT.pstend);
198)         model.txtBaselineStart     = createTextField(pPSTH,cell2mat(tl_grid(2,3)),DEFAULT.baselinestart);
199)         model.txtBaselineEnd       = createTextField(pPSTH,cell2mat(tl_grid(3,3)),DEFAULT.baselineend);
Christoph Budziszewski added TR

Christoph Budziszewski authored 15 years ago

200)         model.txtTrFactor          = createTextField(pPSTH,cell2mat(tl_grid(2,5)),DEFAULT.trfactor);
201)         model.labelTR              = createTextField(pPSTH, cell2mat(tl_grid(3,5)),'');
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

202)         
203)         % images
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

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

205)         set(pImage,'BackgroundColor','w');
206) 
207)         createLabel(pImage,[0.0 0.5 1 0.5],'Select Image Base');
208)         
Christoph Budziszewski schwimmen.

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

210)         model.imageTypeSelection = uicontrol(pImage,'Style','popupmenu',...
211)         'Units','normalized',...
212)         'Position',[0.0 0.0 1 0.5],...
213)         'String',imageRegExList,...
214)         'UserData',imageRegExList,...
Christoph Budziszewski SPM2 compatibilität begonnen

Christoph Budziszewski authored 14 years ago

215)         'Value',1);
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

216)         set(model.imageTypeSelection,'BackgroundColor','w');
217)         
218)         
219)         % coordinate Table
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

222)         lVoxelDef = createLabel(pVoxel, [0 0.9 1 0.1],'<ROI Name> [+ radius (mm)];');
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

223)         model.txtVoxelDef = createTextField(pVoxel,[0 0 1 0.9],...
224)             sprintf(DEFAULT.voxelstring));
225)         set(model.txtVoxelDef,'HorizontalAlignment','left');
226)         set(model.txtVoxelDef,'Max',20);
227)         set(model.txtVoxelDef,'Min',0);
228)         set(model.txtVoxelDef, 'FontName', 'FixedWidth');
229)         
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

230)         %normalizations
231)         pNorm = uipanel(parent,'Title','Normalization','Position',cell2mat(main_grid(2,3)));
232)         set(pNorm,'BackgroundColor','w');
233)         
Christoph Budziszewski coordTabel works for JZ006

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

236)         model.selNormPST = uicontrol(pNorm,'Style','popupmenu',...
237)             'Units','normalized',...
238)             'Position',[0.0 0.5 1 0.25],...
239)             'String',norm1Model,...
240)             'UserData',norm1Model,...
Christoph Budziszewski coordTabel works for JZ006

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

244) %         createLabel(pNorm,[0 0.25 1 0.25],'Col Bias removal');
245) %         norm2Model = {'on','off'};
246)         model.chkColBias = uicontrol(pNorm,'Style','checkbox',...
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

248)             'Position',[0.0 0.1 1 0.25],...
249)             'String','column Bias removal',...
250)             'Enable','on',...
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

251)             'Value',1);
Christoph Budziszewski normalization features enabled

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

253)         
254)         %buttons
255)         pButtons = uipanel(parent,'Position',cell2mat(main_grid(1,4)));
256)         set(pButtons,'BackgroundColor','w');
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

270)         set(btnRunButton3,'Callback',{@cbRunPreprocessing,model,'ROI'}); % set here, because of model.    
271)         set(btnRunButton3,'Enable','on');
272) end
273) 
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

274) function model = createSecondStepPanel(model,parent,DEFAULT)
275) basecolor = 'w';
276) 
Christoph Budziszewski first plot button. not work...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

280)     grid_h = 0.3;
281)     grid_w = 0.3;
282)     time_grid = cell([3 3]);
283)     time_grid{1,1} = [0.0 0.63 grid_w grid_h];
284)     time_grid{2,1} = [0.4 0.63 grid_w grid_h];
285)     time_grid{3,1} = [0.7 0.63 grid_w grid_h];
286)     time_grid{1,2} = [0.0 0.33 grid_w grid_h];
287)     time_grid{2,2} = [0.4 0.33 grid_w grid_h];
288)     time_grid{3,2} = [0.7 0.33 grid_w grid_h];
289)     time_grid{1,3} = [0.0 0.03 grid_w grid_h];
290)     time_grid{2,3} = [0.4 0.03 grid_w grid_h];
291)     time_grid{3,3} = [0.7 0.03 grid_w grid_h];
292) 
293)     lStart      = createLabel(pTime, cell2mat(time_grid(2,1)) ,'Start [sec]');
294)     lEnd        = createLabel(pTime, cell2mat(time_grid(3,1)) ,'End [sec]');
295)     lFrameShift = createLabel(pTime, cell2mat(time_grid(1,2)),'Frame Shift');
296)     lFramsSize  = createLabel(pTime, cell2mat(time_grid(1,3)),'Frame Size');
297)     
298)     model.txtFrameShiftStart   = createTextField(pTime,cell2mat(time_grid(2,2)),DEFAULT.frameshiftstart);
299)     model.txtFrameShiftEnd     = createTextField(pTime,cell2mat(time_grid(3,2)),DEFAULT.frameshiftend);
300)     model.txtFrameShiftDur     = createTextField(pTime,cell2mat(time_grid(2,3)),DEFAULT.frameshiftdur);
301) 
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

304)     set(pSVM,'Title','SVM Classification');
305)     set(pSVM,'BackgroundColor',basecolor);
306) 
Christoph Budziszewski added randomize datapoints...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

308)     set(model.txtSVMopts,'HorizontalAlignment','left');
309)     
Christoph Budziszewski added randomize datapoints...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

314)     set(model.chkSVMrnd,'String','Randomize Datapoints');
315)     set(model.chkSVMrnd,'BackgroundColor','w');
316)     set(model.chkSVMrnd,'Value',DEFAULT.svmrnd);
317)     
Christoph Budziszewski begin SOM implementation

Christoph Budziszewski authored 15 years ago

318)     btnRunSVM = uicontrol(pSVM,'String','run batchmode SVM Crossvalidation',...
319)         'Units','normalized',...
320)         'Position',[0 0.25 1 0.25]);
321)     set(btnRunSVM,'Enable','on');
322)     
323)     btnRunXSVM = uicontrol(pSVM,'String','run SVM X-Subject validation',...
324)         'Units','normalized',...
325)         'Position',[0 0.0 1 0.25]);
326)     set(btnRunXSVM,'Enable','on');
Christoph Budziszewski added randomize datapoints...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

329)     set(pSOM,'Title','SOM Classification');
330)     set(pSOM,'BackgroundColor',basecolor);
331) 
Christoph Budziszewski refined gui elements

Christoph Budziszewski authored 14 years ago

332)     createLabel(pSOM,[0 0.75 0.3 0.20],'Size:');
333)     model.txtSomM = createTextField(pSOM,[0.3 0.75 0.25 0.2],DEFAULT.somM);
334)     somsizemal = createLabel(pSOM,[0.55 0.75 0.2 0.20],'x');
335)     set(somsizemal,'HorizontalAlignment','center');
336)     model.txtSomN = createTextField(pSOM,[0.75 0.75 0.25 0.20],DEFAULT.somN);
337)  
338)     latticeModel = {'rect','hexa'};
339)     model.selSomLattice = uicontrol(pSOM,'Style','popupmenu',...
340)         'Units','normalized',...
341)         'Position',[0.0 0.5 0.3 0.20],...
342)         'String',latticeModel,...
343)         'UserData',latticeModel,...
344)         'Value',1);
345)     set(model.selSomLattice,'BackgroundColor','w');
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

346) 
Christoph Budziszewski refined gui elements

Christoph Budziszewski authored 14 years ago

347)     model.txtSOMnfold = createTextField(pSOM,[0.5 0.50 0.25 0.20],DEFAULT.svmnfold);
348) %     set(model.txtSOMnfold,'Enable','off');
349)     createLabel(pSOM,[0.75 0.5 0.25 0.20 ],'-Fold CrossVal');
350)        
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

351) 
352)     btnRunSOM = uicontrol(pSOM,'String','run SOM Crossvalidation',...
353)         'Units','normalized',...
Christoph Budziszewski begin SOM implementation

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

356) 
357)     btnRunXSOM = uicontrol(pSOM,'String','run SOM X-Subject validation',...
358)         'Units','normalized',...
359)         'Position',[0.0 0.0 1 0.25]);
Christoph Budziszewski manual renamings, better FB...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

361)     
Christoph Budziszewski refined gui elements

Christoph Budziszewski authored 14 years ago

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

363)     set(pSearchlight,'Title','Spatiotemporal FB classification');
364)     set(pSearchlight,'BackgroundColor',basecolor);
365)     
366)     lSearchligh = createLabel(pSearchlight, [0 0.6 0.5 0.3],'Searchlight Radius');
367)     model.txtSearchlightRadius = createTextField(pSearchlight,[0.5 0.6 0.5 0.3],DEFAULT.searchlightradius);
368)     
Christoph Budziszewski refined gui elements

Christoph Budziszewski authored 14 years ago

369)     lFBSTiming = createLabel(pSearchlight, [0 0.3 0.5 0.3],'Optional Timeline ( e.g. ''-5 0 5 10 15'')');
Christoph Budziszewski fbs timeline mod

Christoph Budziszewski authored 14 years ago

370)     model.txtSearchlightTimeline = createTextField(pSearchlight,[0.5 0.3 0.5 0.3],DEFAULT.searchlightTimeline);
371) 
Christoph Budziszewski radius frontend enabled, fi...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

376)     
Christoph Budziszewski begin SOM implementation

Christoph Budziszewski authored 15 years ago

377) 
378) % button callbacks set here, because of model.
379)     set(btnRunSVM, 'Callback',{@cbRunDecode,model,'SVM'}); 
380)     set(btnRunXSVM,'Callback',{@cbRunDecode,model,'XSVM'}); 
381)     set(btnRunSOM, 'Callback',{@cbRunDecode,model,'SOM'});
Christoph Budziszewski radius frontend enabled, fi...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

384) end
385) 
Christoph Budziszewski first plot button. not work...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

387) 
388)     grid_h = 0.25;
389)     grid_w = 0.5;
390)     plot_grid = cell([3 3]);
391)     plot_grid{1,1} = [0.0 0.63 grid_w grid_h];
392)     plot_grid{1,2} = [0.0 0.33 grid_w grid_h];
393)     plot_grid{1,3} = [0.0 0.03 grid_w grid_h];
Christoph Budziszewski refined gui elements

Christoph Budziszewski authored 14 years ago

394)     plot_grid{2,1} = [0.25 0.63 grid_w grid_h];
395)     plot_grid{2,2} = [0.25 0.33 grid_w grid_h];
396)     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

397) 
Christoph Budziszewski all enabled features workin...

Christoph Budziszewski authored 15 years ago

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

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

Christoph Budziszewski authored 14 years ago

401)     
402)     btnPlot03 = uicontrol(pButtonPane,'String','plot PSTH',...
403)         'Units','normalized',...
404)         'Position',cell2mat(plot_grid(2,1)));
405)     set(btnPlot03,'Callback',{@cbPlot,model,'psth'}); 
406)     set(btnPlot03,'Enable','on');
407)   
Christoph Budziszewski all enabled features workin...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

417)     set(btnPlot02,'Callback',{@cbPlot,model,'x-subject-val'});
418)     set(btnPlot02,'Enable','on');
419) 
420)     
Christoph Budziszewski first plot button. not work...

Christoph Budziszewski authored 15 years ago

421) end
422) 
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

423) 
Christoph Budziszewski fbs timeline mod, model in...

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

428) 
429) switch task
430)     case 'PRE'
431)         set(taskpanel.preprocessing,'Visible','on');
Christoph Budziszewski fbs timeline mod, model in...

Christoph Budziszewski authored 14 years ago

432) 
433) 
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

438)         set(taskpanel.plot,'Visible','on');
Christoph Budziszewski fbs timeline mod, model in...

Christoph Budziszewski authored 14 years ago

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

Christoph Budziszewski authored 15 years ago

440) end
Christoph Budziszewski fbs timeline mod, model in...

Christoph Budziszewski authored 14 years ago

441) 
442) assignin('base','model',model);
443) 
Christoph Budziszewski GUI Task Switch: selfmade T...

Christoph Budziszewski authored 15 years ago

444) end
445) 
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

448) main(model,'pre',task);
449) end
450) 
451) function cbRunDecode(src,evnt,model,task)
452) main(model,'decode',task);
Christoph Budziszewski started save/load functiona...

Christoph Budziszewski authored 15 years ago

453) end
454) 
Christoph Budziszewski first plot button. not work...

Christoph Budziszewski authored 15 years ago

455) function cbPlot(src,evnt,model,type)
456) main(model,'plot',type);
457) end
458) 
Christoph Budziszewski spm2 compatibility, start c...

Christoph Budziszewski authored 14 years ago

459) function default = mcb_load_study(src,evnt,studyfile)
460)     default = load(studyfile);
461) end
Christoph Budziszewski first plot button. not work...

Christoph Budziszewski authored 15 years ago

462) 
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

463) function model = mcb_cd(src,evnt,model)
464) disp('CD');
465) directory_name = uigetdir(model.baseDir,'Select Study Base Directory ...');
466) model.baseDir = directory_name;
467) model = scanDirs(model);
468) end
469) 
470) function mcb_save(src,evnt,model)
471) disp('SAVE');
472) baseDir  = model.baseDir;
473) timeLine = getTimeLineParams(model);
474) classDefString = getClassDefString(model);
475) coordDefString = getCoordDefString(model);
476) 
477) [file path] = uiputfile('*.mat','Save current Params ...',model.baseDir);
478) save( fullfile(path,file),'baseDir','timeLine','classDefString','coordDefString') ;
479) end
480) 
481) function model = mcb_load(src,evnt,model)
482) disp('LOAD');
483) [file path] = uigetfile('*.mat','Load Params ...',model.baseDir);
484) l = load(fullfile(path,file));
485) % assignin('base','l',l);
486) model = setTimeLineParams(model,l.timeLine);
487) model = setClassDefString(model,l.classDefString);
488) model = setCoordDefString(model,l.coordDefString);
489) model.baseDir = l.baseDir;
490) model = scanDirs(model);
491) 
492) end
493) 
Christoph Budziszewski new GUI. Only Layout. Backe...

Christoph Budziszewski authored 15 years ago

494) function label = createLabel(parent,  pos, labelText)
495)     label = uicontrol(parent,'Style','text','Units','normalized','String',labelText,'Position',pos);
496)     set(label,'HorizontalAlignment','left');
497)     set(label,'BackgroundColor','w');
498) end
499) 
500) function txt = createTextField(parent,pos,model)
Christoph Budziszewski gui finished. callbacks sti...

Christoph Budziszewski authored 15 years ago

501) %     textfieldcolor = [0.9 0.9 0.0];
502)     textfieldcolor = 'w';