4dbef1858372b668d2a258115f0637851cd92312
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

1) function plotDecodePerformance(varargin)
2) % plotDecodePerformance(timeline,decodePerformance,nClasses,rawData)
3) 
Axel Lindner plot optimiert. normalisier...

Axel Lindner authored 15 years ago

4) PSTH_AXIS_MIN = -1;
5) PSTH_AXIS_MAX = 1;
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

6) 
7) switch nargin
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

8)     
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

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');
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

24) end
25) 
26)     f = figure;
27)     subplot(2,1,1);
28)     hold on;
29)       for voxel = 1:size(psth,2)
30)           for label = 1:size(psth{voxel},2)
31)               psthData = [];
32)               for timepoint = 1:size(psth{voxel}{label},2)
Axel Lindner New Normalization Methods i...

Axel Lindner authored 15 years ago

33)                   psthData = nanmean(psth{voxel}{label});
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

34)               end
35)               plot(psthStart:psthEnd,psthData,[colorChooser(voxel), lineStyleChooser(label)]);
36)           end
37)       end
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

38)     axis([psthStart psthEnd PSTH_AXIS_MIN PSTH_AXIS_MAX])
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

39)     hold off
40)     
41)     subplot(2,1,2)    
42)     hold on;
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

43)     
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

44)     chanceLevel = 100/nClasses;
45)     goodPredictionLevel = chanceLevel*1.5;
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

46)     plot([psthStart psthEnd],[chanceLevel chanceLevel],'k:');
47)     plot([psthStart psthEnd],[goodPredictionLevel goodPredictionLevel],'k:');
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

48)     axis([psthStart psthEnd 0 100])
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

49)     
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

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
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

68)     
69)     
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

70)     hold off;
71) 
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

72)     title = sprintf('Subject %s, over %g voxel, smoothed %s',SubjectID,size(psth,2),smoothed);
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

73)     set(f,'Name',title);
74)     display(sprintf('%s',title));
75) 
76) 
77) 
78) end
79) 
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

80) 
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

81) function color = colorChooser(n)
82)     switch (mod(n,8))
83)     case 0
84)         color = 'r';
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

85)     case 1
86)         color = 'g';
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

87)     case 2
88)         color = 'b';
89)     case 3
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

90)         color = 'c';
91)     case 4
92)         color = 'm';
93)     case 5
94)         color = 'y';
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

95)     otherwise
96)         color = 'k';
97)     end
98) end
99) 
100) function style = lineStyleChooser(n)
101) switch(mod(n,4))
102)     case 0
103)       style = '--';
104)     case 1
105)         style = '-';
106)     case 2 
107)         style = ':';
108)     case 3
Christoph Budziszewski killed unnecessary assignin...

Christoph Budziszewski authored 15 years ago

109)         style = '-.';