90f42025f7bfc3246aa5cb22f8c0b702077787ed
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

1) function spm_SVMCrossVal
2) 
3) 
4) %  Initialize and hide the GUI as it is being constructed.
5)     frameWidth=450;
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

6)     frameHeight=600;
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

7)     frame = figure('Visible','off','Position',[0,0,frameWidth,frameHeight]);
8)     movegui(frame,'west'); % get this thing visible on smaller displays.
9)     
10)     set(frame,'Name','SVMCrossVal Decode Performance 4 SPM');
11)     set(frame,'NumberTitle','off');
12)     set(frame,'MenuBar','none');
13)     set(frame,'Color',get(0,'defaultUicontrolBackgroundColor'));
14)     set(frame,'Resize','off');
15)     set(frame,'Units','normalize');
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

16)     
17)     
Christoph Budziszewski kleine änderungen code move

Christoph Budziszewski authored 15 years ago

18)     savemenu = uimenu(frame,'Label','Save/Load');
19)     
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

20)     model.subjectMap = SubjectRoiMapping;
21)     nElementRows = 24;
22)     optionLineHeight = 1.0/nElementRows;
23)     controlElementHeight=optionLineHeight*(1.0/1.5)*frameHeight;
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

24)     pSubject     = uipanel(frame,'Title','Subject',          'Position',[0 optionLineHeight*19 frameWidth optionLineHeight*5]);
25)     pPSTH        = uipanel(frame,'Title','PSTH Options',     'Position',[0 optionLineHeight*14 frameWidth optionLineHeight*5]); 
26)     pCLASS       = uipanel(frame,'Title','Class Definitions','Position',[0 optionLineHeight*9  frameWidth optionLineHeight*5]); 
27)     pVOXEL       = uipanel(frame,'Title','Voxel Selector',   'Position',[0 optionLineHeight*3  frameWidth optionLineHeight*6]); 
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

28)     pSVM         = uipanel(frame,'Title','SVM Options',      'Position',[0 optionLineHeight*1  frameWidth optionLineHeight*2]); 
29)     btnRunButton = uicontrol(frame,'Tag','run','String','run decode-performance visualiser','Position',[2 optionLineHeight*0  frameWidth controlElementHeight*1.6]);
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

30) 
31) 
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

32)     % Subject
33)     firstColumn  =  5.00;
34)     firstRow     =  1.00 * controlElementHeight;
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

35)     
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

36)     model.subjectSelector = uicontrol(pSubject,'Style','listbox',...
37)                     'Min',1, 'Max',3,...
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

38)                     'String',getSubjectCellList(model.subjectMap),...
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

39)                     'Value',5,...  % default selected item
40)                     'Position',[firstColumn firstRow 0.66*frameWidth controlElementHeight*6]);
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

41)     set(model.subjectSelector,'BackgroundColor','w');
Christoph Budziszewski killed unnecessary assignin...

Christoph Budziszewski authored 15 years ago

42)     
Christoph Budziszewski kleine änderungen code move

Christoph Budziszewski authored 15 years ago

43)     model.txtSmoothed     = createTextField(pSubject,[0.68*frameWidth firstRow  0.25*frameWidth controlElementHeight],'1');
44)     model.txtMultisubject = createTextField(pSubject,[0.68*frameWidth firstRow*2  0.25*frameWidth controlElementHeight],'single');
45)     set(model.txtMultisubject,'enable','off');
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

46) 
47)     % PSTH
48)     firstColumn  = 5.00;
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

49)     secondColumn = 0.33*frameWidth;
50)     thirdColumn  = 0.66*frameWidth;
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

51) %     fourthColumn = 0.84*frameWidth;
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

52)     
53)     firstRow    = 5.5*controlElementHeight;
54)     secondRow   = 4.5*controlElementHeight;
55)     thirdRow    = 3.5*controlElementHeight;
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

56)     fourthRow   = 2.5*controlElementHeight;
57)     fifthRow    = 1.0*controlElementHeight;
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

58)     
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

59)     lStart      = createLabel(pPSTH, [secondColumn firstRow  0.33*frameWidth controlElementHeight],'Start [sec]');
60)     lEnd        = createLabel(pPSTH, [thirdColumn  firstRow  0.33*frameWidth controlElementHeight],'End [sec]');
61)     lPSTH       = createLabel(pPSTH, [firstColumn  secondRow 0.33*frameWidth controlElementHeight],'PSTH Range');
62)     lBaseline   = createLabel(pPSTH, [firstColumn  thirdRow  0.33*frameWidth controlElementHeight],'Baseline');
63)     lFrameShift = createLabel(pPSTH, [firstColumn  fourthRow 0.33*frameWidth controlElementHeight],'SVM Frame Shift');
64)     lFramsSize  = createLabel(pPSTH, [firstColumn  fifthRow  0.33*frameWidth controlElementHeight],'SVM Frame Size');
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

65)     
66)     
Axel Lindner plot optimiert. normalisier...

Axel Lindner authored 15 years ago

67)     model.txtPSTHStart       = createTextField(pPSTH,[secondColumn secondRow 0.25*frameWidth controlElementHeight],'-10.0');
68)     model.txtPSTHEnd         = createTextField(pPSTH,[thirdColumn  secondRow 0.25*frameWidth controlElementHeight],' 40.0');
Christoph Budziszewski kleine änderungen code move

Christoph Budziszewski authored 15 years ago

69)     model.txtBaselineStart   = createTextField(pPSTH,[secondColumn thirdRow  0.25*frameWidth controlElementHeight],'-3.0');
70)     model.txtBaselineEnd     = createTextField(pPSTH,[thirdColumn  thirdRow  0.25*frameWidth controlElementHeight],'-1.0');
71)     model.txtFrameShiftStart = createTextField(pPSTH,[secondColumn fourthRow 0.25*frameWidth controlElementHeight],'-5.0');
Axel Lindner plot optimiert. normalisier...

Axel Lindner authored 15 years ago

72)     model.txtFrameShiftEnd   = createTextField(pPSTH,[thirdColumn  fourthRow 0.25*frameWidth controlElementHeight],' 35.0');
Christoph Budziszewski GUI parsing halfway done.

Christoph Budziszewski authored 15 years ago

73)     model.txtFrameShiftDur   = createTextField(pPSTH,[secondColumn fifthRow  0.25*frameWidth controlElementHeight],' 0');
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

74) 
75)                 
76)     %Classes
77)     nClassRows = 6;
78)     firstColumn  = 5.00;
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

79)     
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

80)     firstRow    = (nClassRows-0.5)*controlElementHeight;
81)     secondRow   = (nClassRows-4.5)*controlElementHeight;
82) 
83)     lClassDef = createLabel(pCLASS, [firstColumn firstRow  0.66*frameWidth controlElementHeight],'<Label>,<[Event,Event,..]>,<SVM-Value>;');
Axel Lindner plot optimiert. normalisier...

Axel Lindner authored 15 years ago

84)     model.txtClassDef = createTextField(pCLASS,[firstColumn secondRow 0.98*frameWidth 4*controlElementHeight],sprintf('DRT,\t[9,10],\t-2 ;\nM2ST,\t[11,12],\t-1;'));
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

85)     set(model.txtClassDef,'HorizontalAlignment','left');
86)     set(model.txtClassDef,'Max',20);
87)     set(model.txtClassDef,'Min',0);
Christoph Budziszewski class def parsing added str...

Christoph Budziszewski authored 15 years ago

88)     set(model.txtClassDef, 'FontName', 'FixedWidth')
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

89)     
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

90)     %Voxel
91)     nVoxelRows = 8;
92)     firstColumn  = 5.00;
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

93)     
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

94)     firstRow    = (nVoxelRows-0.5)*controlElementHeight;
95)     secondRow   = (nVoxelRows-7.5)*controlElementHeight;
96) 
97)     lVoxelDef = createLabel(pVOXEL, [firstColumn firstRow  0.66*frameWidth controlElementHeight],'<ROI Name>,<ROI Modifier>;');
98)     model.txtVoxelDef = createTextField(pVOXEL,[firstColumn secondRow 0.98*frameWidth 6*controlElementHeight],...
Axel Lindner plot optimiert. normalisier...

Axel Lindner authored 15 years ago

99)         sprintf('SPL l,\t[ 0, 0, 0];\nSPL r,\t[ 0, 0, 0];\n'));
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

100)     set(model.txtVoxelDef,'HorizontalAlignment','left');
101)     set(model.txtVoxelDef,'Max',20);
102)     set(model.txtVoxelDef,'Min',0);
Christoph Budziszewski class def parsing added str...

Christoph Budziszewski authored 15 years ago

103)     set(model.txtVoxelDef, 'FontName', 'FixedWidth')
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

104)                 
105)     % SVM
106)     firstColumn  =  5.00;
107)     firstRow     =  1.00 * controlElementHeight;
108) 
Axel Lindner plot optimiert. normalisier...

Axel Lindner authored 15 years ago

109)     model.txtSVMopts = createTextField(pSVM,[firstColumn firstRow  0.66*frameWidth controlElementHeight],'-s 0 -t 0 -v 6 -c 1');
110)     %model.txtSVMopts = createTextField(pSVM,[firstColumn firstRow  0.66*frameWidth controlElementHeight],'-s 0 -t 2 -v 6 -c 10 -g .1');
Christoph Budziszewski killed unnecessary assignin...

Christoph Budziszewski authored 15 years ago

111)     set(model.txtSVMopts,'Enable','on'); %inactive
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

112)     set(model.txtSVMopts,'HorizontalAlignment','left');
113) 
114)     set(btnRunButton,'Callback',{@cbRunSVM,model}); % set here, because of model.    
Christoph Budziszewski kleine änderungen code move

Christoph Budziszewski authored 15 years ago

115)     uimenu(savemenu,'Label','Save','Callback',{@mcb_save,model});
116)     uimenu(savemenu,'Label','Load','Callback',{@mcb_load,model});
117) 
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

118)     set(frame,'Visible','on');
119) end
Christoph Budziszewski kleine änderungen code move

Christoph Budziszewski authored 15 years ago

120) 
121) function mcb_save(src,event,model)
122) display('SAVE');
123) 
124) end
125) 
126) function mcb_load(src,event,model)
127) display('LOAD');
128) end
129) 
130) function sane = isSane(model)
131) % TODO
132) sane = 1;
133) end
134) 
135) function cbRunSVM(src,evnt,model)
136)     display('RUN');
137)     if isSane(model)
138)         classify(model)
139)     else
140)         error('spmtoolbox:SVMCrossVal:paramcheck','please verify all parameters');
141)     end
142) end
143) 
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

144)