Browse code

moved things

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

Christoph Budziszewski authored on09/02/2009 16:44:50
Showing1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,127 +0,0 @@
1
-function plotDecodePerformance(timeline,inputStruct)
2
-
3
-global CROSSVAL_METHOD_DEF;
4
-
5
-PSTH_AXIS_MIN = -1;
6
-PSTH_AXIS_MAX = 1;
7
-
8
-        psthStart         = timeline.psthStart;
9
-        psthEnd           = timeline.psthEnd;
10
-        frameStart        = timeline.frameShiftStart;
11
-        frameEnd          = timeline.frameShiftEnd;
12
-
13
-        nClasses          = inputStruct.nClasses;
14
-        decodePerformance = inputStruct.decodePerformance;
15
-        psth              = inputStruct.rawTimeCourse;
16
-        SubjectID         = inputStruct.SubjectID;
17
-        smoothed          = inputStruct.smoothed;
18
-        PLOT_METHOD       = inputStruct.CROSSVAL_METHOD;
19
-%         CROSSVAL_METHOD_DEF = inputStruct.CROSSVAL_METHOD_DEF;
20
-
21
-
22
-    f = figure;
23
-    subplot(2,1,1);
24
-    hold on;
25
-      for voxel = 1:size(psth,2)
26
-          for label = 1:size(psth{voxel},2)
27
-              psthData = [];
28
-              for timepoint = 1:size(psth{voxel}{label},2)
29
-                  psthData = nanmean(psth{voxel}{label});
30
-              end
31
-              plot(psthStart:psthEnd,psthData,[colorChooser(voxel), lineStyleChooser(label)]);
32
-          end
33
-      end
34
-    axis([psthStart psthEnd PSTH_AXIS_MIN PSTH_AXIS_MAX])
35
-    xlabel('time [sec]');
36
-    ylabel('fMRI-signal change [%]');
37
-    hold off
38
-    
39
-    subplot(2,1,2)    
40
-    hold on;
41
-    
42
-    chanceLevel = 100/nClasses;
43
-    goodPredictionLevel = chanceLevel*1.5;
44
-    plot([psthStart psthEnd],[chanceLevel chanceLevel],'k:');
45
-    plot([psthStart psthEnd],[goodPredictionLevel goodPredictionLevel],'k:');
46
-    axis([psthStart psthEnd 0 100])
47
-    xlabel('time [sec]');
48
-    ylabel('decode performance [%]');
49
-    
50
-    
51
-    
52
-    switch PLOT_METHOD
53
-        case CROSSVAL_METHOD_DEF.svmcrossval
54
-            plot(frameStart:frameEnd, mean(decodePerformance,2) ,'b','LineWidth',2);
55
-
56
-            se = myStdErr(decodePerformance,2);
57
-            plot(frameStart:frameEnd, mean(decodePerformance,2)+se ,'b:');
58
-            plot(frameStart:frameEnd, mean(decodePerformance,2)-se ,'b:');
59
-        case CROSSVAL_METHOD_DEF.classPerformance
60
-            for c = 1:size(decodePerformance,2)
61
-                plot(frameStart:frameEnd, decodePerformance(:,c) ,[colorChooser(mod(c,nClasses)+3) '-']);
62
-            end
63
-
64
-            plot(frameStart:frameEnd, mean(decodePerformance,2) ,'b','LineWidth',2);
65
-
66
-    end
67
-    
68
-    
69
-    hold off;
70
-    
71
-    nSubjects = size(SubjectID,2);
72
-    nVoxelPerSubject = size(psth,2)/size(SubjectID,2);
73
-    
74
-    if strcmp(smoothed,'yes')
75
-        smoothedString = 'using smoothed data';
76
-    else
77
-        smoothedString = 'using unsmoothed data';
78
-    end
79
-    
80
-    if nSubjects == 1
81
-        subjectName = cell2Mat(SubjectID);
82
-        title = sprintf('Subject %s, over %g voxel, %s',subjectName,nVoxelPerSubject,smoothedString);
83
-    else
84
-        title = sprintf('%g Subjects, %g Voxel per Subject, %s',nSubjects,nVoxelPerSubject,smoothedString);
85
-    end
86
-    
87
-
88
-    set(f,'Name',title);
89
-    display(sprintf('%s',title));
90
-
91
-
92
-
93
-end
94
-
95
-
96
-function color = colorChooser(n)
97
-    switch (mod(n,8))
98
-    case 0
99
-        color = 'r';
100
-    case 1
101
-        color = 'g';
102
-    case 2
103
-        color = 'b';
104
-    case 3
105
-        color = 'c';
106
-    case 4
107
-        color = 'm';
108
-    case 5
109
-        color = 'y';
110
-    otherwise
111
-        color = 'k';
112
-    end
113
-end
114
-
115
-function style = lineStyleChooser(n)
116
-switch(mod(n,4))
117
-    case 0
118
-      style = '--';
119
-    case 1
120
-        style = '-';
121
-    case 2 
122
-        style = ':';
123
-    case 3
124
-        style = '-.';
125
-end
126
-end
127
-
Browse code

subject loop is function

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

Christoph Budziszewski authored on28/01/2009 14:52:30
Showing1 changed files
... ...
@@ -1,30 +1,23 @@
1
-function plotDecodePerformance(varargin)
1
+function plotDecodePerformance(timeline,inputStruct)
2 2
 
3 3
 global CROSSVAL_METHOD_DEF;
4 4
 
5 5
 PSTH_AXIS_MIN = -1;
6 6
 PSTH_AXIS_MAX = 1;
7 7
 
8
-switch nargin
9
-    
10
-    case 1
11
-        inputStruct       = cell2mat(varargin(1));
8
+        psthStart         = timeline.psthStart;
9
+        psthEnd           = timeline.psthEnd;
10
+        frameStart        = timeline.frameShiftStart;
11
+        frameEnd          = timeline.frameShiftEnd;
12 12
 
13
-        psthStart         = inputStruct.psthStart;
14
-        psthEnd           = inputStruct.psthEnd;
15 13
         nClasses          = inputStruct.nClasses;
16 14
         decodePerformance = inputStruct.decodePerformance;
17
-        frameStart        = inputStruct.frameShiftStart;
18
-        frameEnd          = inputStruct.frameShiftEnd;
19 15
         psth              = inputStruct.rawTimeCourse;
20 16
         SubjectID         = inputStruct.SubjectID;
21 17
         smoothed          = inputStruct.smoothed;
22 18
         PLOT_METHOD       = inputStruct.CROSSVAL_METHOD;
23 19
 %         CROSSVAL_METHOD_DEF = inputStruct.CROSSVAL_METHOD_DEF;
24 20
 
25
-    otherwise
26
-        error('spmtoolbox:SVMCrossVal:plotDecodePerformance:WrongArgument','Wrong Arguments');
27
-end
28 21
 
29 22
     f = figure;
30 23
     subplot(2,1,1);
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,5 +1,6 @@
1 1
 function plotDecodePerformance(varargin)
2
-% plotDecodePerformance(timeline,decodePerformance,nClasses,rawData)
2
+
3
+global CROSSVAL_METHOD_DEF;
3 4
 
4 5
 PSTH_AXIS_MIN = -1;
5 6
 PSTH_AXIS_MAX = 1;
... ...
@@ -19,7 +20,7 @@ switch nargin
19 20
         SubjectID         = inputStruct.SubjectID;
20 21
         smoothed          = inputStruct.smoothed;
21 22
         PLOT_METHOD       = inputStruct.CROSSVAL_METHOD;
22
-        CROSSVAL_METHOD_DEF = inputStruct.CROSSVAL_METHOD_DEF;
23
+%         CROSSVAL_METHOD_DEF = inputStruct.CROSSVAL_METHOD_DEF;
23 24
 
24 25
     otherwise
25 26
         error('spmtoolbox:SVMCrossVal:plotDecodePerformance:WrongArgument','Wrong Arguments');
... ...
@@ -74,9 +75,23 @@ end
74 75
     
75 76
     hold off;
76 77
     
77
-    nvoxel = size(psth,2);
78
+    nSubjects = size(SubjectID,2);
79
+    nVoxelPerSubject = size(psth,2)/size(SubjectID,2);
80
+    
81
+    if strcmp(smoothed,'yes')
82
+        smoothedString = 'using smoothed data';
83
+    else
84
+        smoothedString = 'using unsmoothed data';
85
+    end
86
+    
87
+    if nSubjects == 1
88
+        subjectName = cell2Mat(SubjectID);
89
+        title = sprintf('Subject %s, over %g voxel, %s',subjectName,nVoxelPerSubject,smoothedString);
90
+    else
91
+        title = sprintf('%g Subjects, %g Voxel per Subject, %s',nSubjects,nVoxelPerSubject,smoothedString);
92
+    end
93
+    
78 94
 
79
-    title = sprintf('Subject %s, over %g voxel, smoothed %s',SubjectID,nvoxel,smoothed);
80 95
     set(f,'Name',title);
81 96
     display(sprintf('%s',title));
82 97
 
Browse code

labels for axis

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

Axel Lindner authored on26/01/2009 18:36:09
Showing1 changed files
... ...
@@ -38,6 +38,8 @@ end
38 38
           end
39 39
       end
40 40
     axis([psthStart psthEnd PSTH_AXIS_MIN PSTH_AXIS_MAX])
41
+    xlabel('time [sec]');
42
+    ylabel('fMRI-signal change [%]');
41 43
     hold off
42 44
     
43 45
     subplot(2,1,2)    
... ...
@@ -48,6 +50,9 @@ end
48 50
     plot([psthStart psthEnd],[chanceLevel chanceLevel],'k:');
49 51
     plot([psthStart psthEnd],[goodPredictionLevel goodPredictionLevel],'k:');
50 52
     axis([psthStart psthEnd 0 100])
53
+    xlabel('time [sec]');
54
+    ylabel('decode performance [%]');
55
+    
51 56
     
52 57
     
53 58
     switch PLOT_METHOD
... ...
@@ -57,7 +62,7 @@ end
57 62
             se = myStdErr(decodePerformance,2);
58 63
             plot(frameStart:frameEnd, mean(decodePerformance,2)+se ,'b:');
59 64
             plot(frameStart:frameEnd, mean(decodePerformance,2)-se ,'b:');
60
-        case 'class performance'
65
+        case CROSSVAL_METHOD_DEF.classPerformance
61 66
             for c = 1:size(decodePerformance,2)
62 67
                 plot(frameStart:frameEnd, decodePerformance(:,c) ,[colorChooser(mod(c,nClasses)+3) '-']);
63 68
             end
Browse code

transport changes

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

Christoph Budziszewski authored on25/01/2009 23:35:38
Showing1 changed files
... ...
@@ -51,8 +51,8 @@ end
51 51
     
52 52
     
53 53
     switch PLOT_METHOD
54
-        case 'stderr' || CROSSVAL_METHOD_DEF.svmcrossval
55
-            plot(frameStart:frameEnd, mean(decodePerformance,2) ,'b');
54
+        case CROSSVAL_METHOD_DEF.svmcrossval
55
+            plot(frameStart:frameEnd, mean(decodePerformance,2) ,'b','LineWidth',2);
56 56
 
57 57
             se = myStdErr(decodePerformance,2);
58 58
             plot(frameStart:frameEnd, mean(decodePerformance,2)+se ,'b:');
Browse code

transport changes

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

Christoph Budziszewski authored on25/01/2009 23:31:24
Showing1 changed files
... ...
@@ -18,6 +18,8 @@ switch nargin
18 18
         psth              = inputStruct.rawTimeCourse;
19 19
         SubjectID         = inputStruct.SubjectID;
20 20
         smoothed          = inputStruct.smoothed;
21
+        PLOT_METHOD       = inputStruct.CROSSVAL_METHOD;
22
+        CROSSVAL_METHOD_DEF = inputStruct.CROSSVAL_METHOD_DEF;
21 23
 
22 24
     otherwise
23 25
         error('spmtoolbox:SVMCrossVal:plotDecodePerformance:WrongArgument','Wrong Arguments');
... ...
@@ -48,10 +50,8 @@ end
48 50
     axis([psthStart psthEnd 0 100])
49 51
     
50 52
     
51
-    PLOT_EXTRAS = 'class performance'
52
-    
53
-    switch PLOT_EXTRAS
54
-        case 'stderr'
53
+    switch PLOT_METHOD
54
+        case 'stderr' || CROSSVAL_METHOD_DEF.svmcrossval
55 55
             plot(frameStart:frameEnd, mean(decodePerformance,2) ,'b');
56 56
 
57 57
             se = myStdErr(decodePerformance,2);
... ...
@@ -68,8 +68,10 @@ end
68 68
     
69 69
     
70 70
     hold off;
71
+    
72
+    nvoxel = size(psth,2);
71 73
 
72
-    title = sprintf('Subject %s, over %g voxel, smoothed %s',SubjectID,size(psth,2),smoothed);
74
+    title = sprintf('Subject %s, over %g voxel, smoothed %s',SubjectID,nvoxel,smoothed);
73 75
     set(f,'Name',title);
74 76
     display(sprintf('%s',title));
75 77
 
Browse code

starting som prediction fine-tuned class-performance visualisation

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

Christoph Budziszewski authored on21/01/2009 16:34:25
Showing1 changed files
... ...
@@ -43,14 +43,28 @@ end
43 43
     
44 44
     chanceLevel = 100/nClasses;
45 45
     goodPredictionLevel = chanceLevel*1.5;
46
-    plot([psthStart psthEnd],[chanceLevel chanceLevel],'r');
47
-    plot([psthStart psthEnd],[goodPredictionLevel goodPredictionLevel],'g');
46
+    plot([psthStart psthEnd],[chanceLevel chanceLevel],'k:');
47
+    plot([psthStart psthEnd],[goodPredictionLevel goodPredictionLevel],'k:');
48 48
     axis([psthStart psthEnd 0 100])
49 49
     
50
-    plot(frameStart:frameEnd, mean(decodePerformance,2) ,'b');
51
-    se = myStdErr(decodePerformance,2);
52
-    plot(frameStart:frameEnd, mean(decodePerformance,2)+se ,'b:');
53
-    plot(frameStart:frameEnd, mean(decodePerformance,2)-se ,'b:');
50
+    
51
+    PLOT_EXTRAS = 'class performance'
52
+    
53
+    switch PLOT_EXTRAS
54
+        case 'stderr'
55
+            plot(frameStart:frameEnd, mean(decodePerformance,2) ,'b');
56
+
57
+            se = myStdErr(decodePerformance,2);
58
+            plot(frameStart:frameEnd, mean(decodePerformance,2)+se ,'b:');
59
+            plot(frameStart:frameEnd, mean(decodePerformance,2)-se ,'b:');
60
+        case 'class performance'
61
+            for c = 1:size(decodePerformance,2)
62
+                plot(frameStart:frameEnd, decodePerformance(:,c) ,[colorChooser(mod(c,nClasses)+3) '-']);
63
+            end
64
+
65
+            plot(frameStart:frameEnd, mean(decodePerformance,2) ,'b','LineWidth',2);
66
+
67
+    end
54 68
     
55 69
     
56 70
     hold off;
... ...
@@ -67,13 +81,17 @@ end
67 81
 function color = colorChooser(n)
68 82
     switch (mod(n,8))
69 83
     case 0
70
-        color = 'y';
71
-    case 1
72 84
         color = 'r';
85
+    case 1
86
+        color = 'g';
73 87
     case 2
74 88
         color = 'b';
75 89
     case 3
76
-        color = 'g';
90
+        color = 'c';
91
+    case 4
92
+        color = 'm';
93
+    case 5
94
+        color = 'y';
77 95
     otherwise
78 96
         color = 'k';
79 97
     end
Browse code

New Normalization Methods in CalculatePST

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

Axel Lindner authored on09/01/2009 16:47:12
Showing1 changed files
... ...
@@ -30,7 +30,7 @@ end
30 30
           for label = 1:size(psth{voxel},2)
31 31
               psthData = [];
32 32
               for timepoint = 1:size(psth{voxel}{label},2)
33
-                  psthData = nanmean(psth{voxel}{label}); % +voxel/100; % ???????????
33
+                  psthData = nanmean(psth{voxel}{label});
34 34
               end
35 35
               plot(psthStart:psthEnd,psthData,[colorChooser(voxel), lineStyleChooser(label)]);
36 36
           end
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
... ...
@@ -1,8 +1,8 @@
1 1
 function plotDecodePerformance(varargin)
2 2
 % plotDecodePerformance(timeline,decodePerformance,nClasses,rawData)
3 3
 
4
-PSTH_AXIS_MIN = -2;
5
-PSTH_AXIS_MAX = 5;
4
+PSTH_AXIS_MIN = -1;
5
+PSTH_AXIS_MAX = 1;
6 6
 
7 7
 switch nargin
8 8
     
... ...
@@ -30,7 +30,7 @@ end
30 30
           for label = 1:size(psth{voxel},2)
31 31
               psthData = [];
32 32
               for timepoint = 1:size(psth{voxel}{label},2)
33
-                  psthData = nanmean(psth{voxel}{label})+voxel/100;
33
+                  psthData = nanmean(psth{voxel}{label}); % +voxel/100; % ???????????
34 34
               end
35 35
               plot(psthStart:psthEnd,psthData,[colorChooser(voxel), lineStyleChooser(label)]);
36 36
           end
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
... ...
@@ -1,32 +1,26 @@
1 1
 function plotDecodePerformance(varargin)
2 2
 % plotDecodePerformance(timeline,decodePerformance,nClasses,rawData)
3 3
 
4
-if(nargin==1)
5
-    inputStruct       = cell2mat(varargin(1));
6
-    
7
-    psthStart         = inputStruct.psthStart;
8
-    psthEnd           = inputStruct.psthEnd;
9
-    nClasses          = inputStruct.nClasses;
10
-    decodePerformance = inputStruct.decodePerformance;
11
-    frameStart        = inputStruct.frameShiftStart;
12
-    frameEnd          = inputStruct.frameShiftEnd;
13
-    psth              = inputStruct.rawTimeCourse;
14
-    SubjectID         = inputStruct.SubjectID;
15
-    smoothed          = inputStruct.smoothed;
16
-    
17
-    
18
-elseif( nargin == 7)
4
+PSTH_AXIS_MIN = -2;
5
+PSTH_AXIS_MAX = 5;
6
+
7
+switch nargin
19 8
     
20
-    psthStart   = cell2mat(varargin(1));
21
-    psthEnd     = cell2mat(varargin(2));
22
-    nClasses    = cell2mat(varargin(3));
23
-    decodePerformance = cell2mat(varargin(4));
24
-    frameStart  = cell2mat(varargin(5));
25
-    frameEnd    = cell2mat(varargin(6));
26
-    psth        = varargin(7);
27
-    psth        = psth{1};
28
-    SubjectID   = '';
29
-    smoothed    = '';
9
+    case 1
10
+        inputStruct       = cell2mat(varargin(1));
11
+
12
+        psthStart         = inputStruct.psthStart;
13
+        psthEnd           = inputStruct.psthEnd;
14
+        nClasses          = inputStruct.nClasses;
15
+        decodePerformance = inputStruct.decodePerformance;
16
+        frameStart        = inputStruct.frameShiftStart;
17
+        frameEnd          = inputStruct.frameShiftEnd;
18
+        psth              = inputStruct.rawTimeCourse;
19
+        SubjectID         = inputStruct.SubjectID;
20
+        smoothed          = inputStruct.smoothed;
21
+
22
+    otherwise
23
+        error('spmtoolbox:SVMCrossVal:plotDecodePerformance:WrongArgument','Wrong Arguments');
30 24
 end
31 25
 
32 26
     f = figure;
... ...
@@ -41,7 +35,7 @@ end
41 35
               plot(psthStart:psthEnd,psthData,[colorChooser(voxel), lineStyleChooser(label)]);
42 36
           end
43 37
       end
44
-    axis([psthStart psthEnd -2 5])
38
+    axis([psthStart psthEnd PSTH_AXIS_MIN PSTH_AXIS_MAX])
45 39
     hold off
46 40
     
47 41
     subplot(2,1,2)    
... ...
@@ -53,11 +47,15 @@ end
53 47
     plot([psthStart psthEnd],[goodPredictionLevel goodPredictionLevel],'g');
54 48
     axis([psthStart psthEnd 0 100])
55 49
     
56
-    plot(frameStart:frameEnd, decodePerformance ,'b');
57
-
50
+    plot(frameStart:frameEnd, mean(decodePerformance,2) ,'b');
51
+    se = myStdErr(decodePerformance,2);
52
+    plot(frameStart:frameEnd, mean(decodePerformance,2)+se ,'b:');
53
+    plot(frameStart:frameEnd, mean(decodePerformance,2)-se ,'b:');
54
+    
55
+    
58 56
     hold off;
59 57
 
60
-    title = sprintf('Subject %s, over %g voxel, smoothed %g',SubjectID,size(psth,2),smoothed);
58
+    title = sprintf('Subject %s, over %g voxel, smoothed %s',SubjectID,size(psth,2),smoothed);
61 59
     set(f,'Name',title);
62 60
     display(sprintf('%s',title));
63 61
 
... ...
@@ -65,6 +63,7 @@ end
65 63
 
66 64
 end
67 65
 
66
+
68 67
 function color = colorChooser(n)
69 68
     switch (mod(n,8))
70 69
     case 0
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
... ...
@@ -12,6 +12,7 @@ if(nargin==1)
12 12
     frameEnd          = inputStruct.frameShiftEnd;
13 13
     psth              = inputStruct.rawTimeCourse;
14 14
     SubjectID         = inputStruct.SubjectID;
15
+    smoothed          = inputStruct.smoothed;
15 16
     
16 17
     
17 18
 elseif( nargin == 7)
... ...
@@ -25,6 +26,7 @@ elseif( nargin == 7)
25 26
     psth        = varargin(7);
26 27
     psth        = psth{1};
27 28
     SubjectID   = '';
29
+    smoothed    = '';
28 30
 end
29 31
 
30 32
     f = figure;
... ...
@@ -39,7 +41,7 @@ end
39 41
               plot(psthStart:psthEnd,psthData,[colorChooser(voxel), lineStyleChooser(label)]);
40 42
           end
41 43
       end
42
-%     axis([psthStart psthEnd 0 0])
44
+    axis([psthStart psthEnd -2 5])
43 45
     hold off
44 46
     
45 47
     subplot(2,1,2)    
... ...
@@ -55,7 +57,7 @@ end
55 57
 
56 58
     hold off;
57 59
 
58
-    title = sprintf('Subject %s, over %g voxel',SubjectID,size(psth,2));
60
+    title = sprintf('Subject %s, over %g voxel, smoothed %g',SubjectID,size(psth,2),smoothed);
59 61
     set(f,'Name',title);
60 62
     display(sprintf('%s',title));
61 63
 
... ...
@@ -87,7 +89,7 @@ switch(mod(n,4))
87 89
     case 2 
88 90
         style = ':';
89 91
     case 3
90
-        style = ':-';
92
+        style = '-.';
91 93
 end
92 94
 end
93 95
 
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
... ...
@@ -44,12 +44,14 @@ end
44 44
     
45 45
     subplot(2,1,2)    
46 46
     hold on;
47
-    plot(frameStart:frameEnd, decodePerformance ,'b');
47
+    
48 48
     chanceLevel = 100/nClasses;
49 49
     goodPredictionLevel = chanceLevel*1.5;
50 50
     plot([psthStart psthEnd],[chanceLevel chanceLevel],'r');
51 51
     plot([psthStart psthEnd],[goodPredictionLevel goodPredictionLevel],'g');
52 52
     axis([psthStart psthEnd 0 100])
53
+    
54
+    plot(frameStart:frameEnd, decodePerformance ,'b');
53 55
 
54 56
     hold off;
55 57
 
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,91 @@
1
+function plotDecodePerformance(varargin)
2
+% plotDecodePerformance(timeline,decodePerformance,nClasses,rawData)
3
+
4
+if(nargin==1)
5
+    inputStruct       = cell2mat(varargin(1));
6
+    
7
+    psthStart         = inputStruct.psthStart;
8
+    psthEnd           = inputStruct.psthEnd;
9
+    nClasses          = inputStruct.nClasses;
10
+    decodePerformance = inputStruct.decodePerformance;
11
+    frameStart        = inputStruct.frameShiftStart;
12
+    frameEnd          = inputStruct.frameShiftEnd;
13
+    psth              = inputStruct.rawTimeCourse;
14
+    SubjectID         = inputStruct.SubjectID;
15
+    
16
+    
17
+elseif( nargin == 7)
18
+    
19
+    psthStart   = cell2mat(varargin(1));
20
+    psthEnd     = cell2mat(varargin(2));
21
+    nClasses    = cell2mat(varargin(3));
22
+    decodePerformance = cell2mat(varargin(4));
23
+    frameStart  = cell2mat(varargin(5));
24
+    frameEnd    = cell2mat(varargin(6));
25
+    psth        = varargin(7);
26
+    psth        = psth{1};
27
+    SubjectID   = '';
28
+end
29
+
30
+    f = figure;
31
+    subplot(2,1,1);
32
+    hold on;
33
+      for voxel = 1:size(psth,2)
34
+          for label = 1:size(psth{voxel},2)
35
+              psthData = [];
36
+              for timepoint = 1:size(psth{voxel}{label},2)
37
+                  psthData = nanmean(psth{voxel}{label})+voxel/100;
38
+              end
39
+              plot(psthStart:psthEnd,psthData,[colorChooser(voxel), lineStyleChooser(label)]);
40
+          end
41
+      end
42
+%     axis([psthStart psthEnd 0 0])
43
+    hold off
44
+    
45
+    subplot(2,1,2)    
46
+    hold on;
47
+    plot(frameStart:frameEnd, decodePerformance ,'b');
48
+    chanceLevel = 100/nClasses;
49
+    goodPredictionLevel = chanceLevel*1.5;
50
+    plot([psthStart psthEnd],[chanceLevel chanceLevel],'r');
51
+    plot([psthStart psthEnd],[goodPredictionLevel goodPredictionLevel],'g');
52
+    axis([psthStart psthEnd 0 100])
53
+
54
+    hold off;
55
+
56
+    title = sprintf('Subject %s, over %g voxel',SubjectID,size(psth,2));
57
+    set(f,'Name',title);
58
+    display(sprintf('%s',title));
59
+
60
+
61
+
62
+end
63
+
64
+function color = colorChooser(n)
65
+    switch (mod(n,8))
66
+    case 0
67
+        color = 'y';
68
+    case 1
69
+        color = 'r';
70
+    case 2
71
+        color = 'b';
72
+    case 3
73
+        color = 'g';
74
+    otherwise
75
+        color = 'k';
76
+    end
77
+end
78
+
79
+function style = lineStyleChooser(n)
80
+switch(mod(n,4))
81
+    case 0
82
+      style = '--';
83
+    case 1
84
+        style = '-';
85
+    case 2 
86
+        style = ':';
87
+    case 3
88
+        style = ':-';
89
+end
90
+end
91
+