4ac11e20dcd3c2e8e24a430db99b4a5bcf711293
Christoph Budziszewski subject loop is function

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m   1) function plotDecodePerformance(timeline,inputStruct)
Christoph Budziszewski using global variables now....

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m   2) 
plotDecodePerformance.m   3) global CROSSVAL_METHOD_DEF;
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m   4) 
Axel Lindner plot optimiert. normalisier...

Axel Lindner authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m   7) 
Christoph Budziszewski subject loop is function

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m  20) 
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

Axel Lindner authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Axel Lindner authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m  41)     
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Axel Lindner authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m  50)     
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m  51)     
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m  52)     switch PLOT_METHOD
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Axel Lindner authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m  67)     
plotDecodePerformance.m  68)     
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m  69)     hold off;
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m  95) 
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m 124)         style = '-.';