Browse code

testing result tree

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@1167 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on24/03/2017 02:58:58
Showing1 changed files
... ...
@@ -2,10 +2,10 @@ function spm_SVMCrossVal(varargin)
2 2
 
3 3
 %Enter the base directory of your SPM installation
4 4
 global SVMCROSSVAL_SPMDIR;
5
-SVMCROSSVAL_SPMDIR = 'D:\SPM\spm2';
5
+SVMCROSSVAL_SPMDIR = '/home/chris/MATLAB/lib/SPM8';
6 6
 %Enter the SPM version string. Like 'SPM2', 'SPM5', 'SPM8'
7 7
 global SVMCROSSVAL_SPMVERSION;
8
-SVMCROSSVAL_SPMVERSION = 'SPM2';
8
+SVMCROSSVAL_SPMVERSION = 'SPM8';
9 9
 
10 10
 %external tools
11 11
 global NODALYZE_LIBSVM;
Browse code

new labels, some cleanup

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@206 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on07/08/2009 17:23:37
Showing1 changed files
... ...
@@ -7,6 +7,15 @@ SVMCROSSVAL_SPMDIR = 'D:\SPM\spm2';
7 7
 global SVMCROSSVAL_SPMVERSION;
8 8
 SVMCROSSVAL_SPMVERSION = 'SPM2';
9 9
 
10
+%external tools
11
+global NODALYZE_LIBSVM;
12
+NODALYZE_LIBSVM = 'libsvm-mat-2.88-1';
13
+global NODALYZE_SOMTOOLBOX;
14
+NODALYZE_SOMTOOLBOX = 'somtoolbox2';
15
+global NODALYZE_NIFTI;
16
+NODALYZE_NIFTI = 'NIFTI_20090325';
17
+
18
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10 19
 % No Config from here
11 20
 if strcmp(SVMCROSSVAL_SPMDIR,'') || strcmp(SVMCROSSVAL_SPMVERSION,'')
12 21
     error('spm_SVMCrossVal:main:noinstall','installation not complete!');
... ...
@@ -15,7 +24,6 @@ end
15 24
 global SVMCROSSVAL_DEBUG;
16 25
 
17 26
 defineGlobals();
18
-%reset defaults to _my_ liking ;)
19 27
 bootstrap('default');
20 28
 
21 29
 switch nargin
Browse code

almost all "change study" features implemented. needs testing.

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@199 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on30/07/2009 18:46:52
Showing1 changed files
... ...
@@ -15,6 +15,8 @@ end
15 15
 global SVMCROSSVAL_DEBUG;
16 16
 
17 17
 defineGlobals();
18
+%reset defaults to _my_ liking ;)
19
+bootstrap('default');
18 20
 
19 21
 switch nargin
20 22
     case 0
Browse code

first eventually working study switch functionality

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@198 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on29/07/2009 15:51:21
Showing1 changed files
... ...
@@ -1,16 +1,20 @@
1 1
 function spm_SVMCrossVal(varargin)
2 2
 
3
-defineGlobals();
4
-
3
+%Enter the base directory of your SPM installation
5 4
 global SVMCROSSVAL_SPMDIR;
6
-global SVMCROSSVAL_SPMVERSION;
7
-global SVMCROSSVAL_TOOLBOXPATH;
8
-global SVMCROSSVAL_DEBUG;
9
-% SPMDIR = 'D:\SPM\spm5human'
10 5
 SVMCROSSVAL_SPMDIR = 'D:\SPM\spm2';
6
+%Enter the SPM version string. Like 'SPM2', 'SPM5', 'SPM8'
7
+global SVMCROSSVAL_SPMVERSION;
11 8
 SVMCROSSVAL_SPMVERSION = 'SPM2';
12
-% SVMCROSSVAL_TOOLBOXPATH = fullfile('C:\Dokumente und Einstellungen\Christoph\Eigene Dateien\MATLAB\spmtoolbox\SVMCrossVal\','');
13
-SVMCROSSVAL_TOOLBOXPATH = fullfile(SVMCROSSVAL_SPMDIR,'toolbox','SVMCrossVal');
9
+
10
+% No Config from here
11
+if strcmp(SVMCROSSVAL_SPMDIR,'') || strcmp(SVMCROSSVAL_SPMVERSION,'')
12
+    error('spm_SVMCrossVal:main:noinstall','installation not complete!');
13
+end
14
+
15
+global SVMCROSSVAL_DEBUG;
16
+
17
+defineGlobals();
14 18
 
15 19
 switch nargin
16 20
     case 0
Browse code

works with toolbox

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@196 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on22/05/2009 11:27:08
Showing1 changed files
... ...
@@ -9,8 +9,8 @@ global SVMCROSSVAL_DEBUG;
9 9
 % SPMDIR = 'D:\SPM\spm5human'
10 10
 SVMCROSSVAL_SPMDIR = 'D:\SPM\spm2';
11 11
 SVMCROSSVAL_SPMVERSION = 'SPM2';
12
-SVMCROSSVAL_TOOLBOXPATH = fullfile('C:\Dokumente und Einstellungen\Christoph\Eigene Dateien\MATLAB\spmtoolbox\SVMCrossVal\','');
13
-% SVMCROSSVAL_TOOLBOXPATH = fullfile(SVMCROSSVAL_SPMDIR,'toolbox');
12
+% SVMCROSSVAL_TOOLBOXPATH = fullfile('C:\Dokumente und Einstellungen\Christoph\Eigene Dateien\MATLAB\spmtoolbox\SVMCrossVal\','');
13
+SVMCROSSVAL_TOOLBOXPATH = fullfile(SVMCROSSVAL_SPMDIR,'toolbox','SVMCrossVal');
14 14
 
15 15
 switch nargin
16 16
     case 0
Browse code

spm2 compatibility, start change study

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@195 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on22/05/2009 11:16:41
Showing1 changed files
... ...
@@ -2,9 +2,23 @@ function spm_SVMCrossVal(varargin)
2 2
 
3 3
 defineGlobals();
4 4
 
5
+global SVMCROSSVAL_SPMDIR;
6
+global SVMCROSSVAL_SPMVERSION;
7
+global SVMCROSSVAL_TOOLBOXPATH;
8
+global SVMCROSSVAL_DEBUG;
9
+% SPMDIR = 'D:\SPM\spm5human'
10
+SVMCROSSVAL_SPMDIR = 'D:\SPM\spm2';
11
+SVMCROSSVAL_SPMVERSION = 'SPM2';
12
+SVMCROSSVAL_TOOLBOXPATH = fullfile('C:\Dokumente und Einstellungen\Christoph\Eigene Dateien\MATLAB\spmtoolbox\SVMCrossVal\','');
13
+% SVMCROSSVAL_TOOLBOXPATH = fullfile(SVMCROSSVAL_SPMDIR,'toolbox');
14
+
5 15
 switch nargin
6
-case 0
7
-	ui_main(varargin);
16
+    case 0
17
+        SVMCROSSVAL_DEBUG = 0;
18
+        ui_main();
19
+    case 1
20
+        SVMCROSSVAL_DEBUG = varargin(1);
21
+        ui_main();
8 22
 otherwise
9 23
 error('spm_SVMCrossVal:main','wrong nargin');
10 24
 end
Browse code

new parseVoxelTxtField getImageFileList reads files according to gui-settings voxel to subject coordinate mapping missing.

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@131 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on16/02/2009 17:32:42
Showing1 changed files
... ...
@@ -1,25 +1,15 @@
1 1
 function spm_SVMCrossVal(varargin)
2 2
 
3
-SVMCROSSVAL_BASEDIR = fullfile('D:','Analyse','Choice');
4
-
5 3
 defineGlobals();
6 4
 
7 5
 switch nargin
8 6
 case 0
9
-% 	project_UI;
10
-	main_UI(varargin);
11
-case 1
12
-	main_UI(varargin);
7
+	ui_main(varargin);
13 8
 otherwise
14 9
 error('spm_SVMCrossVal:main','wrong nargin');
15 10
 end
16 11
 end
17 12
 
18
-function loadStudies(basedir)
19
-
20
-end
21
-
22
-
23 13
 
24 14
 
25 15
 
Browse code

possibly working version, coord-table approach.

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@126 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on06/02/2009 11:55:55
Showing1 changed files
... ...
@@ -1,25 +1,8 @@
1 1
 function spm_SVMCrossVal(varargin)
2 2
 
3
-%define global constants
4
-global SVMCROSSVAL_USE_DRIVE_CHECK_HACK;
5
-%enables subroutine to check if image path starts with 'D'
6
-SVMCROSSVAL_USE_DRIVE_CHECK_HACK                  = 1;  
7
-
8
-global SVMCROSSVAL_CROSSVAL_METHOD_DEF;
9
-% supported classification methods
10
-SVMCROSSVAL_CROSSVAL_METHOD_DEF.svmcrossval       = 'svm crossval';
11
-SVMCROSSVAL_CROSSVAL_METHOD_DEF.classPerformance  = 'svm class performance';
12
-SVMCROSSVAL_CROSSVAL_METHOD_DEF.crossSubject      = 'svm across subject testing';
13
-SVMCROSSVAL_CROSSVAL_METHOD_DEF.somTraining       = 'som Training';
14
-
15
-global SVMCROSSVAL_VOXEL_SELECTION_MODE_DEF;
16
-% supported voxel selection methods
17
-SVMCROSSVAL_VOXEL_SELECTION_MODE_DEF.manualGui    = 'manually defined in GUI';
18
-SVMCROSSVAL_VOXEL_SELECTION_MODE_DEF.roiImage     = 'use ROI image by pop-up image selector';
19
-
20
-global SVMCROSSVAL_SUBJECT_PREFIX;
21
-% internally used to prefix subject-ids starting with numbers.
22
-SVMCROSSVAL_SUBJECT_PREFIX                        = 'subject';
3
+SVMCROSSVAL_BASEDIR = fullfile('D:','Analyse','Choice');
4
+
5
+defineGlobals();
23 6
 
24 7
 switch nargin
25 8
 case 0
... ...
@@ -32,6 +15,9 @@ error('spm_SVMCrossVal:main','wrong nargin');
32 15
 end
33 16
 end
34 17
 
18
+function loadStudies(basedir)
19
+
20
+end
35 21
 
36 22
 
37 23
 
Browse code

heavy CrossVal Toolbox development. unusable snapshot!

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@123 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on03/02/2009 14:36:11
Showing1 changed files
... ...
@@ -1,18 +1,25 @@
1 1
 function spm_SVMCrossVal(varargin)
2 2
 
3 3
 %define global constants
4
-global USE_DRIVE_CHECK_HACK;
5
-USE_DRIVE_CHECK_HACK = 1;  %enables subroutine to check if image path starts with 'D'
6
-
7
-global CROSSVAL_METHOD_DEF;
8
-CROSSVAL_METHOD_DEF.svmcrossval       = 'svm crossval';
9
-CROSSVAL_METHOD_DEF.classPerformance  = 'svm class performance';
10
-CROSSVAL_METHOD_DEF.crossSubject      = 'svm across subject testing';
11
-CROSSVAL_METHOD_DEF.somTraining       = 'som Training';
12
-
13
-global VOXEL_SELECTION_MODE_DEF;
14
-VOXEL_SELECTION_MODE_DEF.manualGui    = 'manually defined in GUI';
15
-VOXEL_SELECTION_MODE_DEF.roiImage     = 'use ROI image and popup image selector';
4
+global SVMCROSSVAL_USE_DRIVE_CHECK_HACK;
5
+%enables subroutine to check if image path starts with 'D'
6
+SVMCROSSVAL_USE_DRIVE_CHECK_HACK                  = 1;  
7
+
8
+global SVMCROSSVAL_CROSSVAL_METHOD_DEF;
9
+% supported classification methods
10
+SVMCROSSVAL_CROSSVAL_METHOD_DEF.svmcrossval       = 'svm crossval';
11
+SVMCROSSVAL_CROSSVAL_METHOD_DEF.classPerformance  = 'svm class performance';
12
+SVMCROSSVAL_CROSSVAL_METHOD_DEF.crossSubject      = 'svm across subject testing';
13
+SVMCROSSVAL_CROSSVAL_METHOD_DEF.somTraining       = 'som Training';
14
+
15
+global SVMCROSSVAL_VOXEL_SELECTION_MODE_DEF;
16
+% supported voxel selection methods
17
+SVMCROSSVAL_VOXEL_SELECTION_MODE_DEF.manualGui    = 'manually defined in GUI';
18
+SVMCROSSVAL_VOXEL_SELECTION_MODE_DEF.roiImage     = 'use ROI image by pop-up image selector';
19
+
20
+global SVMCROSSVAL_SUBJECT_PREFIX;
21
+% internally used to prefix subject-ids starting with numbers.
22
+SVMCROSSVAL_SUBJECT_PREFIX                        = 'subject';
16 23
 
17 24
 switch nargin
18 25
 case 0
Browse code

refactored to arg-structs! (untested)

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@122 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on29/01/2009 16:25:27
Showing1 changed files
... ...
@@ -1,13 +1,19 @@
1 1
 function spm_SVMCrossVal(varargin)
2 2
 
3 3
 %define global constants
4
-global CROSSVAL_METHOD_DEF;
4
+global USE_DRIVE_CHECK_HACK;
5
+USE_DRIVE_CHECK_HACK = 1;  %enables subroutine to check if image path starts with 'D'
5 6
 
7
+global CROSSVAL_METHOD_DEF;
6 8
 CROSSVAL_METHOD_DEF.svmcrossval       = 'svm crossval';
7 9
 CROSSVAL_METHOD_DEF.classPerformance  = 'svm class performance';
8
-CROSSVAL_METHOD_DEF.crossSubject      = 'svm cross subject testing';
10
+CROSSVAL_METHOD_DEF.crossSubject      = 'svm across subject testing';
9 11
 CROSSVAL_METHOD_DEF.somTraining       = 'som Training';
10 12
 
13
+global VOXEL_SELECTION_MODE_DEF;
14
+VOXEL_SELECTION_MODE_DEF.manualGui    = 'manually defined in GUI';
15
+VOXEL_SELECTION_MODE_DEF.roiImage     = 'use ROI image and popup image selector';
16
+
11 17
 switch nargin
12 18
 case 0
13 19
 % 	project_UI;
Browse code

using global variables now. correct nVoxels in Plot title

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@120 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on28/01/2009 14:05:49
Showing1 changed files
... ...
@@ -1,4 +1,13 @@
1 1
 function spm_SVMCrossVal(varargin)
2
+
3
+%define global constants
4
+global CROSSVAL_METHOD_DEF;
5
+
6
+CROSSVAL_METHOD_DEF.svmcrossval       = 'svm crossval';
7
+CROSSVAL_METHOD_DEF.classPerformance  = 'svm class performance';
8
+CROSSVAL_METHOD_DEF.crossSubject      = 'svm cross subject testing';
9
+CROSSVAL_METHOD_DEF.somTraining       = 'som Training';
10
+
2 11
 switch nargin
3 12
 case 0
4 13
 % 	project_UI;
Browse code

moving things to private, some modifications

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@110 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on16/01/2009 02:48:58
Showing1 changed files
... ...
@@ -1,7 +1,8 @@
1 1
 function spm_SVMCrossVal(varargin)
2 2
 switch nargin
3 3
 case 0
4
-	project_UI;
4
+% 	project_UI;
5
+	main_UI(varargin);
5 6
 case 1
6 7
 	main_UI(varargin);
7 8
 otherwise
Browse code

moved UI stuff. new project structure in the making

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@108 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on12/01/2009 17:57:09
Showing1 changed files
... ...
@@ -1,217 +1,15 @@
1 1
 function spm_SVMCrossVal(varargin)
2
-
3 2
 switch nargin
4 3
 case 0
5
-	project_UI();
4
+	project_UI;
6 5
 case 1
7 6
 	main_UI(varargin);
8 7
 otherwise
9 8
 error('spm_SVMCrossVal:main','wrong nargin');
10
-
11 9
 end
12 10
 end
13 11
 
14
-function project_UI(args)
15
-    frameWidth=450;
16
-    frameHeight=200;
17
-    model.frame = figure('Visible','off','Position',[0,0,frameWidth,frameHeight]);
18
-    movegui(model.frame,'west'); % get this thing visible on smaller displays.
19
-
20
-    set(model.frame,'Name','SVM CrossVal Decode Performance 4 SPM, Projectchooser');
21
-    set(model.frame,'NumberTitle','off');
22
-    set(model.frame,'MenuBar','none');
23
-    set(model.frame,'Color',get(0,'defaultUicontrolBackgroundColor'));
24
-    set(model.frame,'Resize','off');
25
-    set(model.frame,'Units','normalize');
26
-
27
-    newProjectMenu = uimenu(model.frame,'Label','Define New Project');
28
-    set(newProjectMenu,'Enable','off');
29
-
30
-
31
-    btnSelectButton = uicontrol(model.frame,'Tag','select','String','continue','Position',[2 0  frameWidth 40]);
32
-    
33
-%    model.projectSelector = 
34
-
35
-	model.val = 1;
36
-
37
-    set(btnSelectButton,'Callback',{@cbChooseProject,model}); % set here, because of model.    
38
-    set(model.frame,'Visible','on');
39
-end
40
-
41
-function cbChooseProject(src,evnts,args)
42
-
43
-	spm_SVMCrossVal(args);
44
-	display(args);
45
-	close(args.frame)
46
-end
47
-
48
-function main_UI(args)
49
-
50
-
51
-%  Initialize and hide the GUI as it is being constructed.
52
-    frameWidth=450;
53
-    frameHeight=600;
54
-    frame = figure('Visible','off','Position',[0,0,frameWidth,frameHeight]);
55
-    movegui(frame,'west'); % get this thing visible on smaller displays.
56
-    
57
-    set(frame,'Name','SVMCrossVal Decode Performance 4 SPM');
58
-    set(frame,'NumberTitle','off');
59
-    set(frame,'MenuBar','none');
60
-    set(frame,'Color',get(0,'defaultUicontrolBackgroundColor'));
61
-    set(frame,'Resize','off');
62
-    set(frame,'Units','normalize');
63
-    
64
-    
65
-    savemenu = uimenu(frame,'Label','Save/Load');
66
-    
67
-    model.subjectMap = SubjectRoiMapping;
68
-    nElementRows = 24;
69
-    optionLineHeight = 1.0/nElementRows;
70
-    controlElementHeight=optionLineHeight*(1.0/1.5)*frameHeight;
71
-    pSubject     = uipanel(frame,'Title','Subject',          'Position',[0 optionLineHeight*19 frameWidth optionLineHeight*5]);
72
-    pPSTH        = uipanel(frame,'Title','PSTH Options',     'Position',[0 optionLineHeight*14 frameWidth optionLineHeight*5]); 
73
-    pCLASS       = uipanel(frame,'Title','Class Definitions','Position',[0 optionLineHeight*9  frameWidth optionLineHeight*5]); 
74
-    pVOXEL       = uipanel(frame,'Title','Voxel Selector',   'Position',[0 optionLineHeight*3  frameWidth optionLineHeight*6]); 
75
-    pSVM         = uipanel(frame,'Title','SVM Options',      'Position',[0 optionLineHeight*1  frameWidth optionLineHeight*2]); 
76
-    btnRunButton = uicontrol(frame,'Tag','run','String','run decode-performance visualiser','Position',[2 optionLineHeight*0  frameWidth controlElementHeight*1.6]);
77
-
78
-
79
-    % Subject
80
-    firstColumn  =  5.00;
81
-    firstRow     =  1.00 * controlElementHeight;
82
-    
83
-    model.subjectSelector = uicontrol(pSubject,'Style','listbox',...
84
-                    'Min',1, 'Max',3,...
85
-                    'String',getSubjectCellList(model.subjectMap),...
86
-                    'Value',5,...  % default selected item
87
-                    'Position',[firstColumn firstRow 0.66*frameWidth controlElementHeight*6]);
88
-    set(model.subjectSelector,'BackgroundColor','w');
89
-    
90
-    model.txtSmoothed     = createTextField(pSubject,[0.68*frameWidth firstRow  0.25*frameWidth controlElementHeight],'1');
91
-    model.txtMultisubject = createTextField(pSubject,[0.68*frameWidth firstRow*2  0.25*frameWidth controlElementHeight],'single');
92
-    set(model.txtMultisubject,'enable','off');
93
-
94
-    % PSTH
95
-    firstColumn  = 5.00;
96
-    secondColumn = 0.33*frameWidth;
97
-    thirdColumn  = 0.66*frameWidth;
98
-%     fourthColumn = 0.84*frameWidth;
99
-    
100
-    firstRow    = 5.5*controlElementHeight;
101
-    secondRow   = 4.5*controlElementHeight;
102
-    thirdRow    = 3.5*controlElementHeight;
103
-    fourthRow   = 2.5*controlElementHeight;
104
-    fifthRow    = 1.0*controlElementHeight;
105
-    
106
-    lStart      = createLabel(pPSTH, [secondColumn firstRow  0.33*frameWidth controlElementHeight],'Start [sec]');
107
-    lEnd        = createLabel(pPSTH, [thirdColumn  firstRow  0.33*frameWidth controlElementHeight],'End [sec]');
108
-    lPSTH       = createLabel(pPSTH, [firstColumn  secondRow 0.33*frameWidth controlElementHeight],'PSTH Range');
109
-    lBaseline   = createLabel(pPSTH, [firstColumn  thirdRow  0.33*frameWidth controlElementHeight],'Baseline');
110
-    lFrameShift = createLabel(pPSTH, [firstColumn  fourthRow 0.33*frameWidth controlElementHeight],'SVM Frame Shift');
111
-    lFramsSize  = createLabel(pPSTH, [firstColumn  fifthRow  0.33*frameWidth controlElementHeight],'SVM Frame Size');
112
-    
113
-    
114
-    model.txtPSTHStart       = createTextField(pPSTH,[secondColumn secondRow 0.25*frameWidth controlElementHeight],'-10.0');
115
-    model.txtPSTHEnd         = createTextField(pPSTH,[thirdColumn  secondRow 0.25*frameWidth controlElementHeight],' 40.0');
116
-    model.txtBaselineStart   = createTextField(pPSTH,[secondColumn thirdRow  0.25*frameWidth controlElementHeight],'-3.0');
117
-    model.txtBaselineEnd     = createTextField(pPSTH,[thirdColumn  thirdRow  0.25*frameWidth controlElementHeight],'-1.0');
118
-    model.txtFrameShiftStart = createTextField(pPSTH,[secondColumn fourthRow 0.25*frameWidth controlElementHeight],'-5.0');
119
-    model.txtFrameShiftEnd   = createTextField(pPSTH,[thirdColumn  fourthRow 0.25*frameWidth controlElementHeight],' 35.0');
120
-    model.txtFrameShiftDur   = createTextField(pPSTH,[secondColumn fifthRow  0.25*frameWidth controlElementHeight],' 0');
121
-
122
-                
123
-    %Classes
124
-    nClassRows = 6;
125
-    firstColumn  = 5.00;
126
-    
127
-    firstRow    = (nClassRows-0.5)*controlElementHeight;
128
-    secondRow   = (nClassRows-4.5)*controlElementHeight;
129
-
130
-    lClassDef = createLabel(pCLASS, [firstColumn firstRow  0.66*frameWidth controlElementHeight],'<Label>,<[Event,Event,..]>,<SVM-Value>;');
131
-    model.txtClassDef = createTextField(pCLASS,[firstColumn secondRow 0.98*frameWidth 4*controlElementHeight],sprintf('DRT,\t[9,10],\t-2 ;\nM2ST,\t[11,12],\t-1;'));
132
-    set(model.txtClassDef,'HorizontalAlignment','left');
133
-    set(model.txtClassDef,'Max',20);
134
-    set(model.txtClassDef,'Min',0);
135
-    set(model.txtClassDef, 'FontName', 'FixedWidth')
136
-    
137
-    %Voxel
138
-    nVoxelRows = 8;
139
-    firstColumn  = 5.00;
140
-    
141
-    firstRow    = (nVoxelRows-0.5)*controlElementHeight;
142
-    secondRow   = (nVoxelRows-7.5)*controlElementHeight;
143
-
144
-    lVoxelDef = createLabel(pVOXEL, [firstColumn firstRow  0.66*frameWidth controlElementHeight],'<ROI Name>,<ROI Modifier>;');
145
-    model.txtVoxelDef = createTextField(pVOXEL,[firstColumn secondRow 0.98*frameWidth 6*controlElementHeight],...
146
-        sprintf('SPL l,\t[ 0, 0, 0];\nSPL r,\t[ 0, 0, 0];\n'));
147
-    set(model.txtVoxelDef,'HorizontalAlignment','left');
148
-    set(model.txtVoxelDef,'Max',20);
149
-    set(model.txtVoxelDef,'Min',0);
150
-    set(model.txtVoxelDef, 'FontName', 'FixedWidth')
151
-                
152
-    % SVM
153
-    firstColumn  =  5.00;
154
-    firstRow     =  1.00 * controlElementHeight;
155 12
 
156
-    model.txtSVMopts = createTextField(pSVM,[firstColumn firstRow  0.66*frameWidth controlElementHeight],'-s 0 -t 0 -v 6 -c 1');
157
-    %model.txtSVMopts = createTextField(pSVM,[firstColumn firstRow  0.66*frameWidth controlElementHeight],'-s 0 -t 2 -v 6 -c 10 -g .1');
158
-    set(model.txtSVMopts,'Enable','on'); %inactive
159
-    set(model.txtSVMopts,'HorizontalAlignment','left');
160
-
161
-    set(btnRunButton,'Callback',{@cbRunSVM,model}); % set here, because of model.    
162
-    uimenu(savemenu,'Label','Save','Callback',{@mcb_save,model});
163
-    uimenu(savemenu,'Label','Load','Callback',{@mcb_load,model});
164
-
165
-    set(frame,'Visible','on');
166
-end
167
-
168
-function mcb_save(src,event,model)
169
-display('SAVE');
170
-
171
-end
172
-
173
-function mcb_load(src,event,model)
174
-display('LOAD');
175
-end
176
-
177
-function sane = isSane(model)
178
-% TODO
179
-sane = 1;
180
-end
181
-
182
-function cbRunSVM(src,evnt,model)
183
-    display('RUN');
184
-    if isSane(model)
185
-        classify(model)
186
-    else
187
-        error('spmtoolbox:SVMCrossVal:paramcheck','please verify all parameters');
188
-    end
189
-end
190
-
191
-    
192
-function label = createLabel(parent,  pos, labelText)
193
-    label = uicontrol(parent,'Style','text','String',labelText,'Position',pos);
194
-    set(label,'HorizontalAlignment','left');
195
-    set(label,'Units','characters');
196
-%     set(label,'BackgroundColor','r');
197
-end
198
-
199
-function btn = createButton(parent,pos,tag,labelText,cbArgs)
200
-    btn = uicontrol(parent,'Position',pos,'String',labelText,'tag',tag);
201
-     set(btn,'Callback',{@cbParseVariable,cbArgs});
202
-%     set(btn,'BackgroundColor','b');
203
-end
204
-
205
-function txt = createTextField(parent,pos,model)
206
-    txt = uicontrol(parent,'Style','edit','String',model,'Position',pos);
207
-    set(txt,'BackgroundColor','w');
208
-end
209
-
210
-function drpField = createDropDown(parent,pos,selectionModel)
211
- drpField = uicontrol(parent,'Style','popupmenu','Position',pos);
212
-  set(drpField,'String',selectionModel.Strings);
213
-  set(drpField,'BackgroundColor','w');
214
-end
215 13
 
216 14
 
217 15
 
Browse code

zwischenspeicherung

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@107 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on12/01/2009 15:26:12
Showing1 changed files
... ...
@@ -24,6 +24,10 @@ function project_UI(args)
24 24
     set(model.frame,'Resize','off');
25 25
     set(model.frame,'Units','normalize');
26 26
 
27
+    newProjectMenu = uimenu(model.frame,'Label','Define New Project');
28
+    set(newProjectMenu,'Enable','off');
29
+
30
+
27 31
     btnSelectButton = uicontrol(model.frame,'Tag','select','String','continue','Position',[2 0  frameWidth 40]);
28 32
     
29 33
 %    model.projectSelector = 
Browse code

project chooser: close window

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@106 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on12/01/2009 15:15:39
Showing1 changed files
... ...
@@ -1,4 +1,47 @@
1
-function spm_SVMCrossVal
1
+function spm_SVMCrossVal(varargin)
2
+
3
+switch nargin
4
+case 0
5
+	project_UI();
6
+case 1
7
+	main_UI(varargin);
8
+otherwise
9
+error('spm_SVMCrossVal:main','wrong nargin');
10
+
11
+end
12
+end
13
+
14
+function project_UI(args)
15
+    frameWidth=450;
16
+    frameHeight=200;
17
+    model.frame = figure('Visible','off','Position',[0,0,frameWidth,frameHeight]);
18
+    movegui(model.frame,'west'); % get this thing visible on smaller displays.
19
+
20
+    set(model.frame,'Name','SVM CrossVal Decode Performance 4 SPM, Projectchooser');
21
+    set(model.frame,'NumberTitle','off');
22
+    set(model.frame,'MenuBar','none');
23
+    set(model.frame,'Color',get(0,'defaultUicontrolBackgroundColor'));
24
+    set(model.frame,'Resize','off');
25
+    set(model.frame,'Units','normalize');
26
+
27
+    btnSelectButton = uicontrol(model.frame,'Tag','select','String','continue','Position',[2 0  frameWidth 40]);
28
+    
29
+%    model.projectSelector = 
30
+
31
+	model.val = 1;
32
+
33
+    set(btnSelectButton,'Callback',{@cbChooseProject,model}); % set here, because of model.    
34
+    set(model.frame,'Visible','on');
35
+end
36
+
37
+function cbChooseProject(src,evnts,args)
38
+
39
+	spm_SVMCrossVal(args);
40
+	display(args);
41
+	close(args.frame)
42
+end
43
+
44
+function main_UI(args)
2 45
 
3 46
 
4 47
 %  Initialize and hide the GUI as it is being constructed.
Browse code

plot optimiert. normalisierung pst, zwischenversion UI Defaults verbessert

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@103 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Axel Lindner authored on09/01/2009 15:52:07
Showing1 changed files
... ...
@@ -64,12 +64,12 @@ function spm_SVMCrossVal
64 64
     lFramsSize  = createLabel(pPSTH, [firstColumn  fifthRow  0.33*frameWidth controlElementHeight],'SVM Frame Size');
65 65
     
66 66
     
67
-    model.txtPSTHStart       = createTextField(pPSTH,[secondColumn secondRow 0.25*frameWidth controlElementHeight],'-1.0');
68
-    model.txtPSTHEnd         = createTextField(pPSTH,[thirdColumn  secondRow 0.25*frameWidth controlElementHeight],' 35.0');
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');
69 69
     model.txtBaselineStart   = createTextField(pPSTH,[secondColumn thirdRow  0.25*frameWidth controlElementHeight],'-3.0');
70 70
     model.txtBaselineEnd     = createTextField(pPSTH,[thirdColumn  thirdRow  0.25*frameWidth controlElementHeight],'-1.0');
71 71
     model.txtFrameShiftStart = createTextField(pPSTH,[secondColumn fourthRow 0.25*frameWidth controlElementHeight],'-5.0');
72
-    model.txtFrameShiftEnd   = createTextField(pPSTH,[thirdColumn  fourthRow 0.25*frameWidth controlElementHeight],' 45.0');
72
+    model.txtFrameShiftEnd   = createTextField(pPSTH,[thirdColumn  fourthRow 0.25*frameWidth controlElementHeight],' 35.0');
73 73
     model.txtFrameShiftDur   = createTextField(pPSTH,[secondColumn fifthRow  0.25*frameWidth controlElementHeight],' 0');
74 74
 
75 75
                 
... ...
@@ -81,7 +81,7 @@ function spm_SVMCrossVal
81 81
     secondRow   = (nClassRows-4.5)*controlElementHeight;
82 82
 
83 83
     lClassDef = createLabel(pCLASS, [firstColumn firstRow  0.66*frameWidth controlElementHeight],'<Label>,<[Event,Event,..]>,<SVM-Value>;');
84
-    model.txtClassDef = createTextField(pCLASS,[firstColumn secondRow 0.98*frameWidth 4*controlElementHeight],sprintf('<,\t[ 9,11,13],\t-2 ;\n>,\t[10,12,14],\t-1;'));
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;'));
85 85
     set(model.txtClassDef,'HorizontalAlignment','left');
86 86
     set(model.txtClassDef,'Max',20);
87 87
     set(model.txtClassDef,'Min',0);
... ...
@@ -96,7 +96,7 @@ function spm_SVMCrossVal
96 96
 
97 97
     lVoxelDef = createLabel(pVOXEL, [firstColumn firstRow  0.66*frameWidth controlElementHeight],'<ROI Name>,<ROI Modifier>;');
98 98
     model.txtVoxelDef = createTextField(pVOXEL,[firstColumn secondRow 0.98*frameWidth 6*controlElementHeight],...
99
-        sprintf('M1 l,\t[ 0, 0, 0];\nM1 l,\t[ 1, 0, 0];\nM1 l,\t[ 0, 1, 0];\nM1 l,\t[ 0, 0, 1];\n'));
99
+        sprintf('SPL l,\t[ 0, 0, 0];\nSPL r,\t[ 0, 0, 0];\n'));
100 100
     set(model.txtVoxelDef,'HorizontalAlignment','left');
101 101
     set(model.txtVoxelDef,'Max',20);
102 102
     set(model.txtVoxelDef,'Min',0);
... ...
@@ -106,7 +106,8 @@ function spm_SVMCrossVal
106 106
     firstColumn  =  5.00;
107 107
     firstRow     =  1.00 * controlElementHeight;
108 108
 
109
-    model.txtSVMopts = createTextField(pSVM,[firstColumn firstRow  0.66*frameWidth controlElementHeight],'-t 0 -s 0 -v 6');
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');
110 111
     set(model.txtSVMopts,'Enable','on'); %inactive
111 112
     set(model.txtSVMopts,'HorizontalAlignment','left');
112 113
 
Browse code

kleine änderungen code move

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@102 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on08/01/2009 11:44:25
Showing1 changed files
... ...
@@ -15,6 +15,8 @@ function spm_SVMCrossVal
15 15
     set(frame,'Units','normalize');
16 16
     
17 17
     
18
+    savemenu = uimenu(frame,'Label','Save/Load');
19
+    
18 20
     model.subjectMap = SubjectRoiMapping;
19 21
     nElementRows = 24;
20 22
     optionLineHeight = 1.0/nElementRows;
... ...
@@ -38,7 +40,9 @@ function spm_SVMCrossVal
38 40
                     'Position',[firstColumn firstRow 0.66*frameWidth controlElementHeight*6]);
39 41
     set(model.subjectSelector,'BackgroundColor','w');
40 42
     
41
-    model.txtSmoothed = createTextField(pSubject,[0.68*frameWidth firstRow  0.25*frameWidth controlElementHeight],'1');
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');
42 46
 
43 47
     % PSTH
44 48
     firstColumn  = 5.00;
... ...
@@ -60,12 +64,12 @@ function spm_SVMCrossVal
60 64
     lFramsSize  = createLabel(pPSTH, [firstColumn  fifthRow  0.33*frameWidth controlElementHeight],'SVM Frame Size');
61 65
     
62 66
     
63
-    model.txtBaselineStart   = createTextField(pPSTH,[secondColumn thirdRow  0.25*frameWidth controlElementHeight],'-22.0');
64
-    model.txtBaselineEnd     = createTextField(pPSTH,[thirdColumn  thirdRow  0.25*frameWidth controlElementHeight],'-20.0');
65
-    model.txtPSTHStart       = createTextField(pPSTH,[secondColumn secondRow 0.25*frameWidth controlElementHeight],'-25.0');
66
-    model.txtPSTHEnd         = createTextField(pPSTH,[thirdColumn  secondRow 0.25*frameWidth controlElementHeight],' 20.0');
67
-    model.txtFrameShiftStart = createTextField(pPSTH,[secondColumn fourthRow 0.25*frameWidth controlElementHeight],'-20.0');
68
-    model.txtFrameShiftEnd   = createTextField(pPSTH,[thirdColumn  fourthRow 0.25*frameWidth controlElementHeight],' 15.0');
67
+    model.txtPSTHStart       = createTextField(pPSTH,[secondColumn secondRow 0.25*frameWidth controlElementHeight],'-1.0');
68
+    model.txtPSTHEnd         = createTextField(pPSTH,[thirdColumn  secondRow 0.25*frameWidth controlElementHeight],' 35.0');
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');
72
+    model.txtFrameShiftEnd   = createTextField(pPSTH,[thirdColumn  fourthRow 0.25*frameWidth controlElementHeight],' 45.0');
69 73
     model.txtFrameShiftDur   = createTextField(pPSTH,[secondColumn fifthRow  0.25*frameWidth controlElementHeight],' 0');
70 74
 
71 75
                 
... ...
@@ -107,8 +111,35 @@ function spm_SVMCrossVal
107 111
     set(model.txtSVMopts,'HorizontalAlignment','left');
108 112
 
109 113
     set(btnRunButton,'Callback',{@cbRunSVM,model}); % set here, because of model.    
114
+    uimenu(savemenu,'Label','Save','Callback',{@mcb_save,model});
115
+    uimenu(savemenu,'Label','Load','Callback',{@mcb_load,model});
116
+
110 117
     set(frame,'Visible','on');
111 118
 end
119
+
120
+function mcb_save(src,event,model)
121
+display('SAVE');
122
+
123
+end
124
+
125
+function mcb_load(src,event,model)
126
+display('LOAD');
127
+end
128
+
129
+function sane = isSane(model)
130
+% TODO
131
+sane = 1;
132
+end
133
+
134
+function cbRunSVM(src,evnt,model)
135
+    display('RUN');
136
+    if isSane(model)
137
+        classify(model)
138
+    else
139
+        error('spmtoolbox:SVMCrossVal:paramcheck','please verify all parameters');
140
+    end
141
+end
142
+
112 143
     
113 144
 function label = createLabel(parent,  pos, labelText)
114 145
     label = uicontrol(parent,'Style','text','String',labelText,'Position',pos);
... ...
@@ -134,38 +165,6 @@ function drpField = createDropDown(parent,pos,selectionModel)
134 165
   set(drpField,'BackgroundColor','w');
135 166
 end
136 167
 
137
-function sane = isSane(model)
138
-    sane = 1;
139
-end
140
-
141
-
142
-function cbRunSVM(src,evnt,model)
143
-
144
-    display('RUN');
145
-
146
-    % TODO test parameter values
147
-    
148
-    if isSane(model)
149
-        set(0,'userdata',model);
150
-%         set(src,'Enable','off');
151
-%         assignin('base','guiParams',model);
152
-        classify(model)
153
-%         set(src,'Enable','on');
154
-    else
155
-        %todo error beep!
156
-        error('spmtoolbox:SVMCrossVal:paramcheck','please verify all parameters');
157
-    end
158
-                                        
159
-end
160
-
161
-
162
-function save(model)
163
-
164
-end
165
-
166
-function model = load()
167
-end
168
-
169 168
 
170 169
 
171 170
 
Browse code

new LabelMap new svm grouping method

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@100 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on07/01/2009 18:26:33
Showing1 changed files
... ...
@@ -38,7 +38,7 @@ function spm_SVMCrossVal
38 38
                     'Position',[firstColumn firstRow 0.66*frameWidth controlElementHeight*6]);
39 39
     set(model.subjectSelector,'BackgroundColor','w');
40 40
     
41
-    model.txtSmoothed = createTextField(pSubject,[0.68*frameWidth firstRow  0.25*frameWidth controlElementHeight],'0');
41
+    model.txtSmoothed = createTextField(pSubject,[0.68*frameWidth firstRow  0.25*frameWidth controlElementHeight],'1');
42 42
 
43 43
     % PSTH
44 44
     firstColumn  = 5.00;
Browse code

multi-subject support

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@96 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on05/01/2009 18:25:16
Showing1 changed files
... ...
@@ -19,10 +19,10 @@ function spm_SVMCrossVal
19 19
     nElementRows = 24;
20 20
     optionLineHeight = 1.0/nElementRows;
21 21
     controlElementHeight=optionLineHeight*(1.0/1.5)*frameHeight;
22
-    pSubject     = uipanel(frame,'Title','Subject',          'Position',[0 optionLineHeight*22 frameWidth optionLineHeight*2]);
23
-    pPSTH        = uipanel(frame,'Title','PSTH Options',     'Position',[0 optionLineHeight*17 frameWidth optionLineHeight*5]); 
24
-    pCLASS       = uipanel(frame,'Title','Class Definitions','Position',[0 optionLineHeight*11 frameWidth optionLineHeight*6]); 
25
-    pVOXEL       = uipanel(frame,'Title','Voxel Selector',   'Position',[0 optionLineHeight*3  frameWidth optionLineHeight*8]); 
22
+    pSubject     = uipanel(frame,'Title','Subject',          'Position',[0 optionLineHeight*19 frameWidth optionLineHeight*5]);
23
+    pPSTH        = uipanel(frame,'Title','PSTH Options',     'Position',[0 optionLineHeight*14 frameWidth optionLineHeight*5]); 
24
+    pCLASS       = uipanel(frame,'Title','Class Definitions','Position',[0 optionLineHeight*9  frameWidth optionLineHeight*5]); 
25
+    pVOXEL       = uipanel(frame,'Title','Voxel Selector',   'Position',[0 optionLineHeight*3  frameWidth optionLineHeight*6]); 
26 26
     pSVM         = uipanel(frame,'Title','SVM Options',      'Position',[0 optionLineHeight*1  frameWidth optionLineHeight*2]); 
27 27
     btnRunButton = uicontrol(frame,'Tag','run','String','run decode-performance visualiser','Position',[2 optionLineHeight*0  frameWidth controlElementHeight*1.6]);
28 28
 
... ...
@@ -31,10 +31,11 @@ function spm_SVMCrossVal
31 31
     firstColumn  =  5.00;
32 32
     firstRow     =  1.00 * controlElementHeight;
33 33
     
34
-    model.subjectSelector = uicontrol(pSubject,'Style','popupmenu',...
34
+    model.subjectSelector = uicontrol(pSubject,'Style','listbox',...
35
+                    'Min',1, 'Max',3,...
35 36
                     'String',getSubjectCellList(model.subjectMap),...
36
-                    'Value',5,...
37
-                    'Position',[firstColumn firstRow 0.66*frameWidth controlElementHeight]);
37
+                    'Value',5,...  % default selected item
38
+                    'Position',[firstColumn firstRow 0.66*frameWidth controlElementHeight*6]);
38 39
     set(model.subjectSelector,'BackgroundColor','w');
39 40
     
40 41
     model.txtSmoothed = createTextField(pSubject,[0.68*frameWidth firstRow  0.25*frameWidth controlElementHeight],'0');
... ...
@@ -158,6 +159,13 @@ function cbRunSVM(src,evnt,model)
158 159
 end
159 160
 
160 161
 
162
+function save(model)
163
+
164
+end
165
+
166
+function model = load()
167
+end
168
+
161 169
 
162 170
 
163 171
 
Browse code

killed unnecessary assignin raw axis fixed value added smooth option

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@95 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on18/12/2008 15:29:41
Showing1 changed files
... ...
@@ -36,6 +36,8 @@ function spm_SVMCrossVal
36 36
                     'Value',5,...
37 37
                     'Position',[firstColumn firstRow 0.66*frameWidth controlElementHeight]);
38 38
     set(model.subjectSelector,'BackgroundColor','w');
39
+    
40
+    model.txtSmoothed = createTextField(pSubject,[0.68*frameWidth firstRow  0.25*frameWidth controlElementHeight],'0');
39 41
 
40 42
     % PSTH
41 43
     firstColumn  = 5.00;
... ...
@@ -100,7 +102,7 @@ function spm_SVMCrossVal
100 102
     firstRow     =  1.00 * controlElementHeight;
101 103
 
102 104
     model.txtSVMopts = createTextField(pSVM,[firstColumn firstRow  0.66*frameWidth controlElementHeight],'-t 0 -s 0 -v 6');
103
-    set(model.txtSVMopts,'Enable','inactive');
105
+    set(model.txtSVMopts,'Enable','on'); %inactive
104 106
     set(model.txtSVMopts,'HorizontalAlignment','left');
105 107
 
106 108
     set(btnRunButton,'Callback',{@cbRunSVM,model}); % set here, because of model.    
... ...
@@ -145,7 +147,7 @@ function cbRunSVM(src,evnt,model)
145 147
     if isSane(model)
146 148
         set(0,'userdata',model);
147 149
 %         set(src,'Enable','off');
148
-        assignin('base','guiParams',model);
150
+%         assignin('base','guiParams',model);
149 151
         classify(model)
150 152
 %         set(src,'Enable','on');
151 153
     else
Browse code

class def parsing added strtrunc.m

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@94 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on17/12/2008 18:42:12
Showing1 changed files
... ...
@@ -78,6 +78,7 @@ function spm_SVMCrossVal
78 78
     set(model.txtClassDef,'HorizontalAlignment','left');
79 79
     set(model.txtClassDef,'Max',20);
80 80
     set(model.txtClassDef,'Min',0);
81
+    set(model.txtClassDef, 'FontName', 'FixedWidth')
81 82
     
82 83
     %Voxel
83 84
     nVoxelRows = 8;
... ...
@@ -88,10 +89,11 @@ function spm_SVMCrossVal
88 89
 
89 90
     lVoxelDef = createLabel(pVOXEL, [firstColumn firstRow  0.66*frameWidth controlElementHeight],'<ROI Name>,<ROI Modifier>;');
90 91
     model.txtVoxelDef = createTextField(pVOXEL,[firstColumn secondRow 0.98*frameWidth 6*controlElementHeight],...
91
-        sprintf('M1 l,\t[ 0, 0, 0];\nM1 l,\t[ 1, 0, 0];\nM1 l,\t[ 0, 1, 0];\nM1 l,\t[ 1, 0, 1];\n'));
92
+        sprintf('M1 l,\t[ 0, 0, 0];\nM1 l,\t[ 1, 0, 0];\nM1 l,\t[ 0, 1, 0];\nM1 l,\t[ 0, 0, 1];\n'));
92 93
     set(model.txtVoxelDef,'HorizontalAlignment','left');
93 94
     set(model.txtVoxelDef,'Max',20);
94 95
     set(model.txtVoxelDef,'Min',0);
96
+    set(model.txtVoxelDef, 'FontName', 'FixedWidth')
95 97
                 
96 98
     % SVM
97 99
     firstColumn  =  5.00;
Browse code

GUI parsing halfway done.

working version

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@92 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on17/12/2008 17:57:53
Showing1 changed files
... ...
@@ -61,9 +61,9 @@ function spm_SVMCrossVal
61 61
     model.txtBaselineEnd     = createTextField(pPSTH,[thirdColumn  thirdRow  0.25*frameWidth controlElementHeight],'-20.0');
62 62
     model.txtPSTHStart       = createTextField(pPSTH,[secondColumn secondRow 0.25*frameWidth controlElementHeight],'-25.0');
63 63
     model.txtPSTHEnd         = createTextField(pPSTH,[thirdColumn  secondRow 0.25*frameWidth controlElementHeight],' 20.0');
64
-    model.txtFramsShiftStart = createTextField(pPSTH,[secondColumn fourthRow 0.25*frameWidth controlElementHeight],'-20.0');
65
-    model.txtFramsShiftEnd   = createTextField(pPSTH,[thirdColumn  fourthRow 0.25*frameWidth controlElementHeight],' 15.0');
66
-    model.txtFramsShiftDur   = createTextField(pPSTH,[secondColumn fifthRow  0.25*frameWidth controlElementHeight],' 0');
64
+    model.txtFrameShiftStart = createTextField(pPSTH,[secondColumn fourthRow 0.25*frameWidth controlElementHeight],'-20.0');
65
+    model.txtFrameShiftEnd   = createTextField(pPSTH,[thirdColumn  fourthRow 0.25*frameWidth controlElementHeight],' 15.0');
66
+    model.txtFrameShiftDur   = createTextField(pPSTH,[secondColumn fifthRow  0.25*frameWidth controlElementHeight],' 0');
67 67
 
68 68
                 
69 69
     %Classes
... ...
@@ -143,6 +143,7 @@ function cbRunSVM(src,evnt,model)
143 143
     if isSane(model)
144 144
         set(0,'userdata',model);
145 145
 %         set(src,'Enable','off');
146
+        assignin('base','guiParams',model);
146 147
         classify(model)
147 148
 %         set(src,'Enable','on');
148 149
     else
Browse code

gui layout finished

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@91 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on17/12/2008 16:12:53
Showing1 changed files
... ...
@@ -3,7 +3,7 @@ function spm_SVMCrossVal
3 3
 
4 4
 %  Initialize and hide the GUI as it is being constructed.
5 5
     frameWidth=450;
6
-    frameHeight=450;
6
+    frameHeight=600;
7 7
     frame = figure('Visible','off','Position',[0,0,frameWidth,frameHeight]);
8 8
     movegui(frame,'west'); % get this thing visible on smaller displays.
9 9
     
... ...
@@ -13,143 +13,98 @@ function spm_SVMCrossVal
13 13
     set(frame,'Color',get(0,'defaultUicontrolBackgroundColor'));
14 14
     set(frame,'Resize','off');
15 15
     set(frame,'Units','normalize');
16
+    
17
+    
18
+    model.subjectMap = SubjectRoiMapping;
19
+    nElementRows = 24;
20
+    optionLineHeight = 1.0/nElementRows;
21
+    controlElementHeight=optionLineHeight*(1.0/1.5)*frameHeight;
22
+    pSubject     = uipanel(frame,'Title','Subject',          'Position',[0 optionLineHeight*22 frameWidth optionLineHeight*2]);
23
+    pPSTH        = uipanel(frame,'Title','PSTH Options',     'Position',[0 optionLineHeight*17 frameWidth optionLineHeight*5]); 
24
+    pCLASS       = uipanel(frame,'Title','Class Definitions','Position',[0 optionLineHeight*11 frameWidth optionLineHeight*6]); 
25
+    pVOXEL       = uipanel(frame,'Title','Voxel Selector',   'Position',[0 optionLineHeight*3  frameWidth optionLineHeight*8]); 
26
+    pSVM         = uipanel(frame,'Title','SVM Options',      'Position',[0 optionLineHeight*1  frameWidth optionLineHeight*2]); 
27
+    btnRunButton = uicontrol(frame,'Tag','run','String','run decode-performance visualiser','Position',[2 optionLineHeight*0  frameWidth controlElementHeight*1.6]);
16 28
 
17 29
 
18
-    optionLineHeight = 1.0/16.0;
19
-    controlElementHeight=optionLineHeight*(1.0/1.5)*frameHeight;
20
-    pMain        = uipanel(frame,'Title','Main Panel',             'Position',[0 optionLineHeight*10 frameWidth optionLineHeight*6]); 
21
-    pAdvanced    = uipanel(frame,'Title','Advanced Options',       'Position',[0 optionLineHeight*5  frameWidth optionLineHeight*5]); 
22
-    pDisplay     = uipanel(frame,'Title','Display Options',        'Position',[0 optionLineHeight*1  frameWidth optionLineHeight*4]); 
23
-    btnRunButton = uicontrol(frame,'Tag','run','String','Run PSTH','Position',[0 optionLineHeight*0  frameWidth frameHeight/16]);
30
+    % Subject
31
+    firstColumn  =  5.00;
32
+    firstRow     =  1.00 * controlElementHeight;
24 33
     
25
-    %Main
26
-     firstColumn  = 0.00*frameWidth;
27
-     secondColumn = 0.33*frameWidth;
28
-     thirdColumn  = 0.66*frameWidth;
29
-     
30
-     firstRow  = 6.3*controlElementHeight;
31
-     secondRow = 5.3*controlElementHeight;
32
-     thirdRow  = 4.3*controlElementHeight;
33
-     fourthRow = 3.3*controlElementHeight;
34
-     fifthRow  = 2.3*controlElementHeight;
35
-     sixthRow  = 1.0*controlElementHeight;
36
-     
37
-     createLabel(pMain, [firstColumn firstRow  0.33*frameWidth controlElementHeight],'Position'); %     lPosition 
38
-     createLabel(pMain, [firstColumn secondRow 0.33*frameWidth controlElementHeight],'Voxel Sphere Radius' );%lRadius
39
-     lEvents            = createLabel(pMain, [firstColumn thirdRow  0.33*frameWidth controlElementHeight],'Event List' );
40
-     lSessions          = createLabel(pMain, [firstColumn fourthRow 0.33*frameWidth controlElementHeight],'Session List'  );
41
-     lNormalize         = createLabel(pMain, [firstColumn fifthRow  0.33*frameWidth controlElementHeight],'Normalization Method' );
42
-     lParametric        = createLabel(pMain, [firstColumn sixthRow  0.25*frameWidth controlElementHeight],'Parametric Modulation');
43
-     lParametricFactor  = createLabel(pMain, [(secondColumn+0.33*frameWidth*0.2) sixthRow 0.33*frameWidth*0.8 controlElementHeight],'Modulation Factor');
44
-
45
-     model.txtPosition  = createTextField(pMain, [secondColumn firstRow  0.33*frameWidth controlElementHeight],'0 0 0');
46
-     btnParseHReg       = createButton(pMain,    [thirdColumn  firstRow  0.33*frameWidth controlElementHeight],'hReg', 'parse hReg',model.txtPosition);
47
-
48
-     model.txtRadius    = createTextField(pMain, [secondColumn secondRow 0.33*frameWidth controlElementHeight],'3');
49
-
50
-     model.txtEvents    = createTextField(pMain, [secondColumn thirdRow  0.33*frameWidth controlElementHeight],'');
51
-     btnEvents          = createButton(pMain,    [thirdColumn  thirdRow  0.33*frameWidth controlElementHeight],'events', 'show Event List',model.txtEvents);
52
-        set(btnEvents,'Enable','off');
53
-
54
-     model.txtSessions  = createTextField(pMain, [secondColumn fourthRow 0.33*frameWidth controlElementHeight],'');
55
-
56
-     model.normalization = createDropDown(pMain, [secondColumn fifthRow  0.33*frameWidth controlElementHeight],...
57
-                           defaults.tools.psth4spm.normalizeSelectionModel);
58
-
59
-     model.chkParametric = uicontrol(pMain,'Position',[secondColumn sixthRow 0.33*frameWidth*0.2 controlElementHeight],'Style','checkbox');
60
-     model.txtParametricMappingFactor = createTextField(pMain,     [thirdColumn  sixthRow 0.33*frameWidth controlElementHeight],'1.0');
61
-        set(model.txtParametricMappingFactor,'Enable','off');
62
-        set(model.chkParametric,'Callback',{@cbToggleEnableTarget,model.txtParametricMappingFactor});
63
-
64
-     %Advanced
65
-    firstColumn  = 0.00*frameWidth;
34
+    model.subjectSelector = uicontrol(pSubject,'Style','popupmenu',...
35
+                    'String',getSubjectCellList(model.subjectMap),...
36
+                    'Value',5,...
37
+                    'Position',[firstColumn firstRow 0.66*frameWidth controlElementHeight]);
38
+    set(model.subjectSelector,'BackgroundColor','w');
39
+
40
+    % PSTH
41
+    firstColumn  = 5.00;
66 42
     secondColumn = 0.33*frameWidth;
67 43
     thirdColumn  = 0.66*frameWidth;
68
-    fourthColumn = 0.84*frameWidth;
44
+%     fourthColumn = 0.84*frameWidth;
69 45
     
70 46
     firstRow    = 5.5*controlElementHeight;
71 47
     secondRow   = 4.5*controlElementHeight;
72 48
     thirdRow    = 3.5*controlElementHeight;
73
-    fourthRow   = 2*controlElementHeight;
74
-    
75
-    lStart  = createLabel(pAdvanced, [secondColumn firstRow 0.33*frameWidth controlElementHeight],'Start [sec]');
76
-    lEnd    = createLabel(pAdvanced, [thirdColumn  firstRow 0.33*frameWidth controlElementHeight],'End [sec]');
77
-    lBaseline = createLabel(pAdvanced,[firstColumn secondRow 0.33*frameWidth controlElementHeight],'Baseline');
78
-    lTimeRange = createLabel(pAdvanced,[firstColumn thirdRow 0.33*frameWidth controlElementHeight],'Time Range (X-Axis)');
79
-    lTemporalResolutionMultiplyer = createLabel(pAdvanced, [firstColumn fourthRow 0.33*frameWidth controlElementHeight],'TR Factor');
80
-    
49
+    fourthRow   = 2.5*controlElementHeight;
50
+    fifthRow    = 1.0*controlElementHeight;
81 51
     
82
-    model.txtBaselineStart = createTextField(pAdvanced,[secondColumn secondRow 0.25*frameWidth controlElementHeight],'-3.0');
83
-    model.txtBaselineEnd = createTextField(pAdvanced,[thirdColumn secondRow 0.25*frameWidth controlElementHeight],'-1.0');
84
-    model.txtTimeRangeStart = createTextField(pAdvanced,[secondColumn thirdRow 0.25*frameWidth controlElementHeight],'-5.0');
85
-    model.txtTimeRangeEnd = createTextField(pAdvanced,[thirdColumn thirdRow 0.25*frameWidth controlElementHeight],'45.0');
52
+    lStart      = createLabel(pPSTH, [secondColumn firstRow  0.33*frameWidth controlElementHeight],'Start [sec]');
53
+    lEnd        = createLabel(pPSTH, [thirdColumn  firstRow  0.33*frameWidth controlElementHeight],'End [sec]');
54
+    lPSTH       = createLabel(pPSTH, [firstColumn  secondRow 0.33*frameWidth controlElementHeight],'PSTH Range');
55
+    lBaseline   = createLabel(pPSTH, [firstColumn  thirdRow  0.33*frameWidth controlElementHeight],'Baseline');
56
+    lFrameShift = createLabel(pPSTH, [firstColumn  fourthRow 0.33*frameWidth controlElementHeight],'SVM Frame Shift');
57
+    lFramsSize  = createLabel(pPSTH, [firstColumn  fifthRow  0.33*frameWidth controlElementHeight],'SVM Frame Size');
86 58
     
87
-
88
-    model.txtTemporalResolution = createTextField(pAdvanced,[thirdColumn fourthRow 0.18*frameWidth controlElementHeight],'');
89
-        set(model.txtTemporalResolution,'Enable','inactive');
90
-    try
91
-        tr = evalin('base','SPM.xsDes.Interscan_interval(1:end-3)');
92
-        set(model.txtTemporalResolution,'String',tr);
93
-    catch
94
-        btnParseTemporalResolution = createButton(pAdvanced,[fourthColumn fourthRow 0.15*frameWidth controlElementHeight],'TR','parse TR',model.txtTemporalResolution);
95
-    end
96
-    model.txtTemporalResolutionFactor = createTextField(pAdvanced,[secondColumn fourthRow 0.25*frameWidth controlElementHeight],'0.5');
97
-   
98
-    %Display
99
-    firstColumn  = 0.00*frameWidth;
100
-    secondColumn = 0.33*frameWidth;
101
-    thirdColumn  = 0.66*frameWidth;
102
-    
103
-    firstRow    = 4*controlElementHeight;
104
-    secondRow   = 3*controlElementHeight;
105
-    thirdRow    = 2*controlElementHeight;
106
-    fourthRow   = 0.5*controlElementHeight;
107 59
     
108
-    lAxisUpper      = createLabel(pDisplay, [firstColumn firstRow 0.33*frameWidth controlElementHeight],'Y-Axis Upper Bound');
109
-    lAxisLower      = createLabel(pDisplay, [firstColumn secondRow 0.33*frameWidth controlElementHeight],'Y-Axis Lower Bound');
110
-    lColorScheme    = createLabel(pDisplay, [firstColumn thirdRow 0.33*frameWidth controlElementHeight],'Color Scheme');
111
-    lShowLegend     = createLabel(pDisplay, [secondColumn+0.33*frameWidth*0.2 fourthRow 0.33*frameWidth controlElementHeight],'Show Legend');
112
-    lShowFiltered   = createLabel(pDisplay, [thirdColumn+0.33*frameWidth*0.2 fourthRow 0.33*frameWidth controlElementHeight],'Show Filtered');
60
+    model.txtBaselineStart   = createTextField(pPSTH,[secondColumn thirdRow  0.25*frameWidth controlElementHeight],'-22.0');
61
+    model.txtBaselineEnd     = createTextField(pPSTH,[thirdColumn  thirdRow  0.25*frameWidth controlElementHeight],'-20.0');
62
+    model.txtPSTHStart       = createTextField(pPSTH,[secondColumn secondRow 0.25*frameWidth controlElementHeight],'-25.0');
63
+    model.txtPSTHEnd         = createTextField(pPSTH,[thirdColumn  secondRow 0.25*frameWidth controlElementHeight],' 20.0');
64
+    model.txtFramsShiftStart = createTextField(pPSTH,[secondColumn fourthRow 0.25*frameWidth controlElementHeight],'-20.0');
65
+    model.txtFramsShiftEnd   = createTextField(pPSTH,[thirdColumn  fourthRow 0.25*frameWidth controlElementHeight],' 15.0');
66
+    model.txtFramsShiftDur   = createTextField(pPSTH,[secondColumn fifthRow  0.25*frameWidth controlElementHeight],' 0');
67
+
68
+                
69
+    %Classes
70
+    nClassRows = 6;
71
+    firstColumn  = 5.00;
113 72
     
114
-    model.txtYAxisUpper = createTextField(pDisplay,[secondColumn firstRow 0.33*frameWidth controlElementHeight],'0');
115
-    model.txtYAxisLower = createTextField(pDisplay,[secondColumn secondRow 0.33*frameWidth controlElementHeight],'0');
73
+    firstRow    = (nClassRows-0.5)*controlElementHeight;
74
+    secondRow   = (nClassRows-4.5)*controlElementHeight;
75
+
76
+    lClassDef = createLabel(pCLASS, [firstColumn firstRow  0.66*frameWidth controlElementHeight],'<Label>,<[Event,Event,..]>,<SVM-Value>;');
77
+    model.txtClassDef = createTextField(pCLASS,[firstColumn secondRow 0.98*frameWidth 4*controlElementHeight],sprintf('<,\t[ 9,11,13],\t-2 ;\n>,\t[10,12,14],\t-1;'));
78
+    set(model.txtClassDef,'HorizontalAlignment','left');
79
+    set(model.txtClassDef,'Max',20);
80
+    set(model.txtClassDef,'Min',0);
116 81
     
117
-    model.colorScheme = createDropDown(pDisplay,[secondColumn thirdRow 0.33*frameWidth controlElementHeight],defaults.tools.psth4spm.colorschemeSelectionModel);
82
+    %Voxel
83
+    nVoxelRows = 8;
84
+    firstColumn  = 5.00;
118 85
     
119
-    model.chkShowLegend = uicontrol(pDisplay,'Position',[secondColumn fourthRow 0.33*frameWidth*0.1 controlElementHeight],'Style','checkbox','Value',1);
120
-    model.chkShowUnfiltered = uicontrol(pDisplay,'Position',[thirdColumn fourthRow 0.33*frameWidth*0.1 controlElementHeight],'Style','checkbox','Value',1);
121
-
122
-    set(btnRunButton,'Callback',{@cbRunPSTH,model});
86
+    firstRow    = (nVoxelRows-0.5)*controlElementHeight;
87
+    secondRow   = (nVoxelRows-7.5)*controlElementHeight;
88
+
89
+    lVoxelDef = createLabel(pVOXEL, [firstColumn firstRow  0.66*frameWidth controlElementHeight],'<ROI Name>,<ROI Modifier>;');
90
+    model.txtVoxelDef = createTextField(pVOXEL,[firstColumn secondRow 0.98*frameWidth 6*controlElementHeight],...
91
+        sprintf('M1 l,\t[ 0, 0, 0];\nM1 l,\t[ 1, 0, 0];\nM1 l,\t[ 0, 1, 0];\nM1 l,\t[ 1, 0, 1];\n'));
92
+    set(model.txtVoxelDef,'HorizontalAlignment','left');
93
+    set(model.txtVoxelDef,'Max',20);
94
+    set(model.txtVoxelDef,'Min',0);
95
+                
96
+    % SVM
97
+    firstColumn  =  5.00;
98
+    firstRow     =  1.00 * controlElementHeight;
99
+
100
+    model.txtSVMopts = createTextField(pSVM,[firstColumn firstRow  0.66*frameWidth controlElementHeight],'-t 0 -s 0 -v 6');
101
+    set(model.txtSVMopts,'Enable','inactive');
102
+    set(model.txtSVMopts,'HorizontalAlignment','left');
103
+
104
+    set(btnRunButton,'Callback',{@cbRunSVM,model}); % set here, because of model.    
123 105
     set(frame,'Visible','on');
124 106
 end
125
-
126
-% this is a function callback
127
-function cbToggleEnableTarget(src,eventData,target)
128
-    if(strcmp(get(target,'Enable'),'off'))
129
-%         display('is off. set on');
130
-        set(target,'Enable','on');
131
-    else
132
-%         display('is on, set off');
133
-        set(target,'Enable','off');
134
-    end
135
-end
136
-
137
-function cbParseVariable(src,evnt,target)
138
-% display('button pressed');
139
-    switch(get(src,'Tag'))
140
-        case 'hReg'
141
-            pos = num2str(evalin('base','spm_XYZreg(''GetCoords'',hReg)')');
142
-            set(target,'String',pos);
143
-        case 'TR'
144
-            tr = evalin('base','SPM.xsDes.Interscan_interval(1:end-3)');
145
-            set(target,'String',tr);
146
-%             set(src,'Enable','off');
147
-            set(target,'Visible','on');
148
-        otherwise 
149
-            display(['no parse Rule for Button Tagged' get(src,'Tag')]);
150
-    end
151
-end
152
-
107
+    
153 108
 function label = createLabel(parent,  pos, labelText)
154 109
     label = uicontrol(parent,'Style','text','String',labelText,'Position',pos);
155 110
     set(label,'HorizontalAlignment','left');
... ...
@@ -174,15 +129,21 @@ function drpField = createDropDown(parent,pos,selectionModel)
174 129
   set(drpField,'BackgroundColor','w');
175 130
 end
176 131
 
132
+function sane = isSane(model)
133
+    sane = 1;
134
+end
135
+
136
+
137
+function cbRunSVM(src,evnt,model)
177 138
 
178
-function cbRunPSTH(src,evnt,model)
139
+    display('RUN');
179 140
 
180 141
     % TODO test parameter values
181 142
     
182 143
     if isSane(model)
183 144
         set(0,'userdata',model);
184 145
 %         set(src,'Enable','off');
185
-        evalin('base','runPSTH4SPM(SPM)');
146
+        classify(model)
186 147
 %         set(src,'Enable','on');
187 148
     else
188 149
         %todo error beep!
Browse code

SVMCrossVal toolbox init

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@90 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on17/12/2008 13:45:29
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,197 @@
1
+function spm_SVMCrossVal
2
+
3
+
4
+%  Initialize and hide the GUI as it is being constructed.
5
+    frameWidth=450;
6
+    frameHeight=450;
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');
16
+
17
+
18
+    optionLineHeight = 1.0/16.0;
19
+    controlElementHeight=optionLineHeight*(1.0/1.5)*frameHeight;
20
+    pMain        = uipanel(frame,'Title','Main Panel',             'Position',[0 optionLineHeight*10 frameWidth optionLineHeight*6]); 
21
+    pAdvanced    = uipanel(frame,'Title','Advanced Options',       'Position',[0 optionLineHeight*5  frameWidth optionLineHeight*5]); 
22
+    pDisplay     = uipanel(frame,'Title','Display Options',        'Position',[0 optionLineHeight*1  frameWidth optionLineHeight*4]); 
23
+    btnRunButton = uicontrol(frame,'Tag','run','String','Run PSTH','Position',[0 optionLineHeight*0  frameWidth frameHeight/16]);
24
+    
25
+    %Main
26
+     firstColumn  = 0.00*frameWidth;
27
+     secondColumn = 0.33*frameWidth;
28
+     thirdColumn  = 0.66*frameWidth;
29
+     
30
+     firstRow  = 6.3*controlElementHeight;
31
+     secondRow = 5.3*controlElementHeight;
32
+     thirdRow  = 4.3*controlElementHeight;
33
+     fourthRow = 3.3*controlElementHeight;
34
+     fifthRow  = 2.3*controlElementHeight;
35
+     sixthRow  = 1.0*controlElementHeight;
36
+     
37
+     createLabel(pMain, [firstColumn firstRow  0.33*frameWidth controlElementHeight],'Position'); %     lPosition 
38
+     createLabel(pMain, [firstColumn secondRow 0.33*frameWidth controlElementHeight],'Voxel Sphere Radius' );%lRadius
39
+     lEvents            = createLabel(pMain, [firstColumn thirdRow  0.33*frameWidth controlElementHeight],'Event List' );
40
+     lSessions          = createLabel(pMain, [firstColumn fourthRow 0.33*frameWidth controlElementHeight],'Session List'  );
41
+     lNormalize         = createLabel(pMain, [firstColumn fifthRow  0.33*frameWidth controlElementHeight],'Normalization Method' );
42
+     lParametric        = createLabel(pMain, [firstColumn sixthRow  0.25*frameWidth controlElementHeight],'Parametric Modulation');
43
+     lParametricFactor  = createLabel(pMain, [(secondColumn+0.33*frameWidth*0.2) sixthRow 0.33*frameWidth*0.8 controlElementHeight],'Modulation Factor');
44
+
45
+     model.txtPosition  = createTextField(pMain, [secondColumn firstRow  0.33*frameWidth controlElementHeight],'0 0 0');
46
+     btnParseHReg       = createButton(pMain,    [thirdColumn  firstRow  0.33*frameWidth controlElementHeight],'hReg', 'parse hReg',model.txtPosition);
47
+
48
+     model.txtRadius    = createTextField(pMain, [secondColumn secondRow 0.33*frameWidth controlElementHeight],'3');
49
+
50
+     model.txtEvents    = createTextField(pMain, [secondColumn thirdRow  0.33*frameWidth controlElementHeight],'');
51
+     btnEvents          = createButton(pMain,    [thirdColumn  thirdRow  0.33*frameWidth controlElementHeight],'events', 'show Event List',model.txtEvents);
52
+        set(btnEvents,'Enable','off');
53
+
54
+     model.txtSessions  = createTextField(pMain, [secondColumn fourthRow 0.33*frameWidth controlElementHeight],'');
55
+
56
+     model.normalization = createDropDown(pMain, [secondColumn fifthRow  0.33*frameWidth controlElementHeight],...
57
+                           defaults.tools.psth4spm.normalizeSelectionModel);
58
+
59
+     model.chkParametric = uicontrol(pMain,'Position',[secondColumn sixthRow 0.33*frameWidth*0.2 controlElementHeight],'Style','checkbox');
60
+     model.txtParametricMappingFactor = createTextField(pMain,     [thirdColumn  sixthRow 0.33*frameWidth controlElementHeight],'1.0');
61
+        set(model.txtParametricMappingFactor,'Enable','off');
62
+        set(model.chkParametric,'Callback',{@cbToggleEnableTarget,model.txtParametricMappingFactor});
63
+
64
+     %Advanced
65
+    firstColumn  = 0.00*frameWidth;
66
+    secondColumn = 0.33*frameWidth;
67
+    thirdColumn  = 0.66*frameWidth;
68
+    fourthColumn = 0.84*frameWidth;
69
+    
70
+    firstRow    = 5.5*controlElementHeight;
71
+    secondRow   = 4.5*controlElementHeight;
72
+    thirdRow    = 3.5*controlElementHeight;
73
+    fourthRow   = 2*controlElementHeight;
74
+    
75
+    lStart  = createLabel(pAdvanced, [secondColumn firstRow 0.33*frameWidth controlElementHeight],'Start [sec]');
76
+    lEnd    = createLabel(pAdvanced, [thirdColumn  firstRow 0.33*frameWidth controlElementHeight],'End [sec]');
77
+    lBaseline = createLabel(pAdvanced,[firstColumn secondRow 0.33*frameWidth controlElementHeight],'Baseline');
78
+    lTimeRange = createLabel(pAdvanced,[firstColumn thirdRow 0.33*frameWidth controlElementHeight],'Time Range (X-Axis)');
79
+    lTemporalResolutionMultiplyer = createLabel(pAdvanced, [firstColumn fourthRow 0.33*frameWidth controlElementHeight],'TR Factor');
80
+    
81
+    
82
+    model.txtBaselineStart = createTextField(pAdvanced,[secondColumn secondRow 0.25*frameWidth controlElementHeight],'-3.0');
83
+    model.txtBaselineEnd = createTextField(pAdvanced,[thirdColumn secondRow 0.25*frameWidth controlElementHeight],'-1.0');
84
+    model.txtTimeRangeStart = createTextField(pAdvanced,[secondColumn thirdRow 0.25*frameWidth controlElementHeight],'-5.0');
85
+    model.txtTimeRangeEnd = createTextField(pAdvanced,[thirdColumn thirdRow 0.25*frameWidth controlElementHeight],'45.0');
86
+    
87
+
88
+    model.txtTemporalResolution = createTextField(pAdvanced,[thirdColumn fourthRow 0.18*frameWidth controlElementHeight],'');
89
+        set(model.txtTemporalResolution,'Enable','inactive');
90
+    try
91
+        tr = evalin('base','SPM.xsDes.Interscan_interval(1:end-3)');
92
+        set(model.txtTemporalResolution,'String',tr);
93
+    catch
94
+        btnParseTemporalResolution = createButton(pAdvanced,[fourthColumn fourthRow 0.15*frameWidth controlElementHeight],'TR','parse TR',model.txtTemporalResolution);
95
+    end
96
+    model.txtTemporalResolutionFactor = createTextField(pAdvanced,[secondColumn fourthRow 0.25*frameWidth controlElementHeight],'0.5');
97
+   
98
+    %Display
99
+    firstColumn  = 0.00*frameWidth;
100
+    secondColumn = 0.33*frameWidth;
101
+    thirdColumn  = 0.66*frameWidth;
102
+    
103
+    firstRow    = 4*controlElementHeight;
104
+    secondRow   = 3*controlElementHeight;
105
+    thirdRow    = 2*controlElementHeight;
106
+    fourthRow   = 0.5*controlElementHeight;
107
+    
108
+    lAxisUpper      = createLabel(pDisplay, [firstColumn firstRow 0.33*frameWidth controlElementHeight],'Y-Axis Upper Bound');
109
+    lAxisLower      = createLabel(pDisplay, [firstColumn secondRow 0.33*frameWidth controlElementHeight],'Y-Axis Lower Bound');
110
+    lColorScheme    = createLabel(pDisplay, [firstColumn thirdRow 0.33*frameWidth controlElementHeight],'Color Scheme');
111
+    lShowLegend     = createLabel(pDisplay, [secondColumn+0.33*frameWidth*0.2 fourthRow 0.33*frameWidth controlElementHeight],'Show Legend');
112
+    lShowFiltered   = createLabel(pDisplay, [thirdColumn+0.33*frameWidth*0.2 fourthRow 0.33*frameWidth controlElementHeight],'Show Filtered');
113
+    
114
+    model.txtYAxisUpper = createTextField(pDisplay,[secondColumn firstRow 0.33*frameWidth controlElementHeight],'0');
115
+    model.txtYAxisLower = createTextField(pDisplay,[secondColumn secondRow 0.33*frameWidth controlElementHeight],'0');
116
+    
117
+    model.colorScheme = createDropDown(pDisplay,[secondColumn thirdRow 0.33*frameWidth controlElementHeight],defaults.tools.psth4spm.colorschemeSelectionModel);
118
+    
119
+    model.chkShowLegend = uicontrol(pDisplay,'Position',[secondColumn fourthRow 0.33*frameWidth*0.1 controlElementHeight],'Style','checkbox','Value',1);
120
+    model.chkShowUnfiltered = uicontrol(pDisplay,'Position',[thirdColumn fourthRow 0.33*frameWidth*0.1 controlElementHeight],'Style','checkbox','Value',1);
121
+
122
+    set(btnRunButton,'Callback',{@cbRunPSTH,model});
123
+    set(frame,'Visible','on');
124
+end
125
+
126
+% this is a function callback
127
+function cbToggleEnableTarget(src,eventData,target)
128
+    if(strcmp(get(target,'Enable'),'off'))
129
+%         display('is off. set on');
130
+        set(target,'Enable','on');
131
+    else
132
+%         display('is on, set off');
133
+        set(target,'Enable','off');
134
+    end
135
+end
136
+
137
+function cbParseVariable(src,evnt,target)
138
+% display('button pressed');
139
+    switch(get(src,'Tag'))
140
+        case 'hReg'
141
+            pos = num2str(evalin('base','spm_XYZreg(''GetCoords'',hReg)')');
142
+            set(target,'String',pos);
143
+        case 'TR'
144
+            tr = evalin('base','SPM.xsDes.Interscan_interval(1:end-3)');
145
+            set(target,'String',tr);
146
+%             set(src,'Enable','off');
147
+            set(target,'Visible','on');
148
+        otherwise 
149
+            display(['no parse Rule for Button Tagged' get(src,'Tag')]);
150
+    end
151
+end
152
+
153
+function label = createLabel(parent,  pos, labelText)
154
+    label = uicontrol(parent,'Style','text','String',labelText,'Position',pos);
155
+    set(label,'HorizontalAlignment','left');
156
+    set(label,'Units','characters');
157
+%     set(label,'BackgroundColor','r');
158
+end
159
+
160
+function btn = createButton(parent,pos,tag,labelText,cbArgs)
161
+    btn = uicontrol(parent,'Position',pos,'String',labelText,'tag',tag);
162
+     set(btn,'Callback',{@cbParseVariable,cbArgs});
163
+%     set(btn,'BackgroundColor','b');
164
+end
165
+
166
+function txt = createTextField(parent,pos,model)
167
+    txt = uicontrol(parent,'Style','edit','String',model,'Position',pos);
168
+    set(txt,'BackgroundColor','w');
169
+end
170
+
171
+function drpField = createDropDown(parent,pos,selectionModel)
172
+ drpField = uicontrol(parent,'Style','popupmenu','Position',pos);
173
+  set(drpField,'String',selectionModel.Strings);
174
+  set(drpField,'BackgroundColor','w');
175
+end
176
+
177
+
178
+function cbRunPSTH(src,evnt,model)
179
+
180
+    % TODO test parameter values
181
+    
182
+    if isSane(model)
183
+        set(0,'userdata',model);
184
+%         set(src,'Enable','off');
185
+        evalin('base','runPSTH4SPM(SPM)');
186
+%         set(src,'Enable','on');
187
+    else
188
+        %todo error beep!
189
+        error('spmtoolbox:SVMCrossVal:paramcheck','please verify all parameters');
190
+    end
191
+                                        
192
+end
193
+
194
+
195
+
196
+
197
+