task-models implementet.
Christoph Budziszewski

Christoph Budziszewski commited on 2009-03-16 17:26:16
Zeige 4 geänderte Dateien mit 33 Einfügungen und 17 Löschungen.


git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@154 83ab2cfd-5345-466c-8aeb-2b2739fb922d
... ...
@@ -5,6 +5,8 @@ switch task
5 5
         preprocess(model,subtask);
6 6
     case 'decode'
7 7
         decode(model,subtask);
8
+    case 'plot'
9
+        decode_plot(model,subtask);
8 10
 end
9 11
 end
10 12
 % disp('all warnings OFF')
... ...
@@ -101,7 +103,11 @@ end
101 103
 % warning('on',warn);
102 104
 end
103 105
 
104
-function decode_plot()
106
+function decode_plot(model,type)
107
+switch type
108
+    case 'SIMPLE'
109
+        
110
+end
105 111
 end
106 112
 
107 113
 
... ...
@@ -8,8 +8,7 @@ function subjectData = runCoordTable(args)
8 8
     nSubjects = numel(subjects);
9 9
     sessionlist = args.sessionList;
10 10
     
11
-    disp(sprintf('we have %g subjects. Press ANY-Key to continue.\n Use Retrun if your Keyboard lacks the ANY-Key.',nSubjects));
12
-    pause
11
+    disp(sprintf('batch processing %g subjects.',nSubjects));
13 12
 
14 13
     for s = 1:nSubjects
15 14
         subjectStruct{s}.dir = fullfile(args.basedir,cell2mat(subjects(s)));
... ...
@@ -33,12 +33,12 @@ DEFAULT.wd  = fullfile('d:','Analyze','Choice','24pilot');
33 33
 
34 34
     task = struct;
35 35
     
36
-    model = struct;
37
-    model.baseDir = DEFAULT.wd;
36
+    model1 = struct;
37
+    model1.baseDir = DEFAULT.wd;
38 38
 
39
-    model.txtBaseDir = createLabel(frame,[0 0.97 1 0.03],model.baseDir);
40
-    set(model.txtBaseDir,'BackgroundColor','w');
41
-    set(model.txtBaseDir,'ForegroundColor','b');
39
+    model1.txtBaseDir = createLabel(frame,[0 0.97 1 0.03],model1.baseDir);
40
+    set(model1.txtBaseDir,'BackgroundColor','w');
41
+    set(model1.txtBaseDir,'ForegroundColor','b');
42 42
     
43 43
     TASK_HEIGHT = 1-0.13;
44 44
     
... ...
@@ -47,19 +47,24 @@ DEFAULT.wd  = fullfile('d:','Analyze','Choice','24pilot');
47 47
     set(task.preprocessing,'BackgroundColor','w');
48 48
     set(task.preprocessing,'Units','normalized');
49 49
     
50
-    model.selectedSubject = DEFAULT.selectedSubject;
51
-    model = createFirstStepPanel(model,task.preprocessing,DEFAULT);
50
+    model1.selectedSubject = DEFAULT.selectedSubject;
51
+    model1 = createFirstStepPanel(model1,task.preprocessing,DEFAULT);
52 52
     
53
+    % fill with data
54
+    model1 = scanDirs(model1);
53 55
     
54 56
     % CLASSIFICATION
57
+    model2 = struct;
58
+    
55 59
     task.classification = uipanel(frame,'Title','Classification','Position',[0 0.0 1 TASK_HEIGHT]);
56 60
     set(task.classification,'BackgroundColor','w');
57
-    model = createSecondStepPanel(model,task.classification,DEFAULT);
61
+    model2 = createSecondStepPanel(model2,task.classification,DEFAULT);
58 62
     
59 63
     % PLOT
64
+    model3 = struct;
60 65
     task.plot = uipanel(frame,'Title','Plot','Position',[0 0.0 1 TASK_HEIGHT]);
61 66
     set(task.plot,'BackgroundColor','w');
62
-    model = createVisualStepPanel(model,task.plot,DEFAULT);
67
+    model3 = createVisualStepPanel(model3,task.plot,DEFAULT);
63 68
     
64 69
     % TASK
65 70
     task.taskSwitch = uipanel(frame,'Position',[0 1-0.13 1 0.10]);
... ...
@@ -85,15 +90,18 @@ DEFAULT.wd  = fullfile('d:','Analyze','Choice','24pilot');
85 90
     % menu
86 91
     
87 92
     savemenu = uimenu(frame,'Label','Save/Load');
88
-        uimenu(savemenu,'Label','Save Preprocessing Parameter','Callback',{@mcb_save,model});
89
-        uimenu(savemenu,'Label','Load Preprocessing Parameter','Callback',{@mcb_load,model});
93
+        uimenu(savemenu,'Label','Save Preprocessing Parameter','Callback',{@mcb_save,model1});
94
+        uimenu(savemenu,'Label','Load Preprocessing Parameter','Callback',{@mcb_load,model1});
95
+        uimenu(savemenu,'Label','Save Decode Parameter','Callback',{@mcb_save,model2},'Enable','off');
96
+        uimenu(savemenu,'Label','Load Decode Parameter','Callback',{@mcb_load,model2},'Enable','off');
97
+        uimenu(savemenu,'Label','Save All','Callback',{@mcb_save,model1},'Enable','off');
98
+        uimenu(savemenu,'Label','Load All','Callback',{@mcb_load,model1},'Enable','off');
90 99
         
91
-    uimenu(frame,'Label','change Study','Callback',{@mcb_cd,model},'Enable','off');
100
+    uimenu(frame,'Label','change Study','Callback',{@mcb_cd,model1},'Enable','off');
92 101
     
93 102
     cbSwitchTask(0,0,'PRE',task);
94 103
 
95
-    % fill with data
96
-    model = scanDirs(model);
104
+
97 105
     set(frame,'Visible','on');
98 106
 
99 107
 %     assignin('base','model',model);
... ...
@@ -4,6 +4,9 @@ function decode = xsvm_subject_loop(header,subjectdata,svmopts)
4 4
 addpath 'libsvm-mat-2.88-1';
5 5
 
6 6
 nSubjects = numel(subjectdata);
7
+if(nSubjects < 2) 
8
+    error('SVMCrossVal:xsvmSubjectLoop:tooFewSubjects','You need at least 2 Subjects in this Across-Subject analysis!');
9
+end
7 10
 
8 11
 RANDOMIZE_DATAPOINTS = 0;
9 12
 
10 13