291ee33de61fc5cd44c4afa4a86ca3bc077532b8
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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;
Christoph Budziszewski killed unnecessary assignin...

Christoph Budziszewski authored 15 years ago

15)     smoothed          = inputStruct.smoothed;
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

16)     
17)     
18) elseif( nargin == 7)
19)     
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   = '';
Christoph Budziszewski killed unnecessary assignin...

Christoph Budziszewski authored 15 years ago

29)     smoothed    = '';
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

30) end
31) 
32)     f = figure;
33)     subplot(2,1,1);
34)     hold on;
35)       for voxel = 1:size(psth,2)
36)           for label = 1:size(psth{voxel},2)
37)               psthData = [];
38)               for timepoint = 1:size(psth{voxel}{label},2)
39)                   psthData = nanmean(psth{voxel}{label})+voxel/100;
40)               end
41)               plot(psthStart:psthEnd,psthData,[colorChooser(voxel), lineStyleChooser(label)]);
42)           end
43)       end
Christoph Budziszewski killed unnecessary assignin...

Christoph Budziszewski authored 15 years ago

44)     axis([psthStart psthEnd -2 5])
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

45)     hold off
46)     
47)     subplot(2,1,2)    
48)     hold on;
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

49)     
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

50)     chanceLevel = 100/nClasses;
51)     goodPredictionLevel = chanceLevel*1.5;
52)     plot([psthStart psthEnd],[chanceLevel chanceLevel],'r');
53)     plot([psthStart psthEnd],[goodPredictionLevel goodPredictionLevel],'g');
54)     axis([psthStart psthEnd 0 100])
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

55)     
56)     plot(frameStart:frameEnd, decodePerformance ,'b');
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

57) 
58)     hold off;
59) 
Christoph Budziszewski killed unnecessary assignin...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

92)         style = '-.';