e370a50993425a495c9f7a27a1f1cffa87dcfc09
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

1) function plotDecodePerformance(varargin)
Christoph Budziszewski using global variables now....

Christoph Budziszewski authored 15 years ago

2) 
3) global CROSSVAL_METHOD_DEF;
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

4) 
Axel Lindner plot optimiert. normalisier...

Axel Lindner authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

7) 
8) switch nargin
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

9)     
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

10)     case 1
11)         inputStruct       = cell2mat(varargin(1));
12) 
13)         psthStart         = inputStruct.psthStart;
14)         psthEnd           = inputStruct.psthEnd;
15)         nClasses          = inputStruct.nClasses;
16)         decodePerformance = inputStruct.decodePerformance;
17)         frameStart        = inputStruct.frameShiftStart;
18)         frameEnd          = inputStruct.frameShiftEnd;
19)         psth              = inputStruct.rawTimeCourse;
20)         SubjectID         = inputStruct.SubjectID;
21)         smoothed          = inputStruct.smoothed;
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

22)         PLOT_METHOD       = inputStruct.CROSSVAL_METHOD;
Christoph Budziszewski using global variables now....

Christoph Budziszewski authored 15 years ago

23) %         CROSSVAL_METHOD_DEF = inputStruct.CROSSVAL_METHOD_DEF;
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Axel Lindner authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

41)     axis([psthStart psthEnd PSTH_AXIS_MIN PSTH_AXIS_MAX])
Axel Lindner labels for axis

Axel Lindner authored 15 years ago

42)     xlabel('time [sec]');
43)     ylabel('fMRI-signal change [%]');
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

48)     
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

53)     axis([psthStart psthEnd 0 100])
Axel Lindner labels for axis

Axel Lindner authored 15 years ago

54)     xlabel('time [sec]');
55)     ylabel('decode performance [%]');
56)     
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

57)     
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

58)     
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

59)     switch PLOT_METHOD
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

62) 
63)             se = myStdErr(decodePerformance,2);
64)             plot(frameStart:frameEnd, mean(decodePerformance,2)+se ,'b:');
65)             plot(frameStart:frameEnd, mean(decodePerformance,2)-se ,'b:');
Axel Lindner labels for axis

Axel Lindner authored 15 years ago

66)         case CROSSVAL_METHOD_DEF.classPerformance
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

67)             for c = 1:size(decodePerformance,2)
68)                 plot(frameStart:frameEnd, decodePerformance(:,c) ,[colorChooser(mod(c,nClasses)+3) '-']);
69)             end
70) 
71)             plot(frameStart:frameEnd, mean(decodePerformance,2) ,'b','LineWidth',2);
72) 
73)     end
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

74)     
75)     
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

76)     hold off;
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

77)     
Christoph Budziszewski using global variables now....

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

94) 
95)     set(f,'Name',title);
96)     display(sprintf('%s',title));
97) 
98) 
99) 
100) end
101) 
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

102) 
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

103) function color = colorChooser(n)
104)     switch (mod(n,8))
105)     case 0
106)         color = 'r';
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

107)     case 1
108)         color = 'g';
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

109)     case 2
110)         color = 'b';
111)     case 3
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

112)         color = 'c';
113)     case 4
114)         color = 'm';
115)     case 5
116)         color = 'y';
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

117)     otherwise
118)         color = 'k';
119)     end
120) end
121) 
122) function style = lineStyleChooser(n)
123) switch(mod(n,4))
124)     case 0
125)       style = '--';
126)     case 1
127)         style = '-';
128)     case 2 
129)         style = ':';
130)     case 3
Christoph Budziszewski killed unnecessary assignin...

Christoph Budziszewski authored 15 years ago

131)         style = '-.';