afa4573056fc74ba9038557cb44244670df282e6
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;
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

21)         PLOT_METHOD       = inputStruct.CROSSVAL_METHOD;
22)         CROSSVAL_METHOD_DEF = inputStruct.CROSSVAL_METHOD_DEF;
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

23) 
24)     otherwise
25)         error('spmtoolbox:SVMCrossVal:plotDecodePerformance:WrongArgument','Wrong Arguments');
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

Axel Lindner authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

45)     
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

51)     
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

52)     
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

53)     switch PLOT_METHOD
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

54)         case CROSSVAL_METHOD_DEF.svmcrossval
55)             plot(frameStart:frameEnd, mean(decodePerformance,2) ,'b','LineWidth',2);
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

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;
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

71)     
72)     nvoxel = size(psth,2);
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

73) 
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

74)     title = sprintf('Subject %s, over %g voxel, smoothed %s',SubjectID,nvoxel,smoothed);
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

82) 
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

87)     case 1
88)         color = 'g';
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

111)         style = '-.';