843767743284585643d14019ffb949a0fa84952e
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

1) function plotDecodePerformance(varargin)
2) % plotDecodePerformance(timeline,decodePerformance,nClasses,rawData)
3) 
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

4) PSTH_AXIS_MIN = -2;
5) PSTH_AXIS_MAX = 5;
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)
33)                   psthData = nanmean(psth{voxel}{label})+voxel/100;
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;
46)     plot([psthStart psthEnd],[chanceLevel chanceLevel],'r');
47)     plot([psthStart psthEnd],[goodPredictionLevel goodPredictionLevel],'g');
48)     axis([psthStart psthEnd 0 100])
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

49)     
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

56)     hold off;
57) 
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

58)     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

59)     set(f,'Name',title);
60)     display(sprintf('%s',title));
61) 
62) 
63) 
64) end
65) 
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

66) 
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

67) function color = colorChooser(n)
68)     switch (mod(n,8))
69)     case 0
70)         color = 'y';
71)     case 1
72)         color = 'r';
73)     case 2
74)         color = 'b';
75)     case 3
76)         color = 'g';
77)     otherwise
78)         color = 'k';
79)     end
80) end
81) 
82) function style = lineStyleChooser(n)
83) switch(mod(n,4))
84)     case 0
85)       style = '--';
86)     case 1
87)         style = '-';
88)     case 2 
89)         style = ':';
90)     case 3
Christoph Budziszewski killed unnecessary assignin...

Christoph Budziszewski authored 15 years ago

91)         style = '-.';