6595def85cf63a3b6c95f55f9e17cf2bb102b0e8
Christoph Budziszewski subject loop is function

Christoph Budziszewski authored 15 years ago

1) function plotDecodePerformance(timeline,inputStruct)
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) 
Christoph Budziszewski subject loop is function

Christoph Budziszewski authored 15 years ago

8)         psthStart         = timeline.psthStart;
9)         psthEnd           = timeline.psthEnd;
10)         frameStart        = timeline.frameShiftStart;
11)         frameEnd          = timeline.frameShiftEnd;
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

12) 
13)         nClasses          = inputStruct.nClasses;
14)         decodePerformance = inputStruct.decodePerformance;
15)         psth              = inputStruct.rawTimeCourse;
16)         SubjectID         = inputStruct.SubjectID;
17)         smoothed          = inputStruct.smoothed;
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

20) 
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

Axel Lindner authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

30)               end
31)               plot(psthStart:psthEnd,psthData,[colorChooser(voxel), lineStyleChooser(label)]);
32)           end
33)       end
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

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

Axel Lindner authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

41)     
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Axel Lindner authored 15 years ago

47)     xlabel('time [sec]');
48)     ylabel('decode performance [%]');
49)     
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

50)     
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

51)     
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

52)     switch PLOT_METHOD
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

55) 
56)             se = myStdErr(decodePerformance,2);
57)             plot(frameStart:frameEnd, mean(decodePerformance,2)+se ,'b:');
58)             plot(frameStart:frameEnd, mean(decodePerformance,2)-se ,'b:');
Axel Lindner labels for axis

Axel Lindner authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

60)             for c = 1:size(decodePerformance,2)
61)                 plot(frameStart:frameEnd, decodePerformance(:,c) ,[colorChooser(mod(c,nClasses)+3) '-']);
62)             end
63) 
64)             plot(frameStart:frameEnd, mean(decodePerformance,2) ,'b','LineWidth',2);
65) 
66)     end
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

67)     
68)     
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

69)     hold off;
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

71)     nSubjects = size(SubjectID,2);
72)     nVoxelPerSubject = size(psth,2)/size(SubjectID,2);
73)     
74)     if strcmp(smoothed,'yes')
75)         smoothedString = 'using smoothed data';
76)     else
77)         smoothedString = 'using unsmoothed data';
78)     end
79)     
80)     if nSubjects == 1
81)         subjectName = cell2Mat(SubjectID);
82)         title = sprintf('Subject %s, over %g voxel, %s',subjectName,nVoxelPerSubject,smoothedString);
83)     else
84)         title = sprintf('%g Subjects, %g Voxel per Subject, %s',nSubjects,nVoxelPerSubject,smoothedString);
85)     end
86)     
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

87) 
88)     set(f,'Name',title);
89)     display(sprintf('%s',title));
90) 
91) 
92) 
93) end
94) 
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

95) 
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

96) function color = colorChooser(n)
97)     switch (mod(n,8))
98)     case 0
99)         color = 'r';
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

100)     case 1
101)         color = 'g';
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

102)     case 2
103)         color = 'b';
104)     case 3
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

105)         color = 'c';
106)     case 4
107)         color = 'm';
108)     case 5
109)         color = 'y';
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

110)     otherwise
111)         color = 'k';
112)     end
113) end
114) 
115) function style = lineStyleChooser(n)
116) switch(mod(n,4))
117)     case 0
118)       style = '--';
119)     case 1
120)         style = '-';
121)     case 2 
122)         style = ':';
123)     case 3
Christoph Budziszewski killed unnecessary assignin...

Christoph Budziszewski authored 15 years ago

124)         style = '-.';