625fdcd690b9e2771e3bb9a289a74d75e5a0404d
Christoph Budziszewski all enabled features workin...

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m   1) function plotDecodePerformance(type,decode,subjectData)
Christoph Budziszewski using global variables now....

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m           2) 
Christoph Budziszewski all enabled features workin...

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m   3) header = decode.header;
Christoph Budziszewski single subject -> svm class...

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m   4) timeline = header.timeline;
Christoph Budziszewski all enabled features workin...

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m   5) frameshift = header.frameShift;
Christoph Budziszewski single subject -> svm class...

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m   6) 
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m   7) psthStart         = timeline.psthStart;
private/plotDecodePerformance.m   8) psthEnd           = timeline.psthEnd;
Christoph Budziszewski all enabled features workin...

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m   9) frameStart        = frameshift.frameShiftStart;
private/plotDecodePerformance.m  10) frameEnd          = frameshift.frameShiftEnd;
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          11) 
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  12) nClasses          = numel(header.classDef.labelCells);
private/plotDecodePerformance.m  13) decodePerformance = decode.decodePerformance;
private/plotDecodePerformance.m  14) psth              = decode.rawTimeCourse;
private/plotDecodePerformance.m  15) SubjectID         = subjectData;
Christoph Budziszewski single subject -> svm class...

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  16) 
Christoph Budziszewski all enabled features workin...

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  17) nSubjects         = size(SubjectID,2);
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          18) 
Christoph Budziszewski preliminary confidence inte...

Christoph Budziszewski authored 14 years ago

private/plotDecodePerformance.m  19) nTrials           = getNTrials(psth);
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          20) 
plotDecodePerformance.m          21)     f = figure;
Christoph Budziszewski extracted psth-plot to extr...

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  22)   
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          23)     hold on;
plotDecodePerformance.m          24)     chanceLevel = 100/nClasses;
Christoph Budziszewski preliminary confidence inte...

Christoph Budziszewski authored 14 years ago

private/plotDecodePerformance.m  25) 
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

Axel Lindner authored 15 years ago

plotDecodePerformance.m          27)     xlabel('time [sec]');
plotDecodePerformance.m          28)     ylabel('decode performance [%]');
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          29) 
Christoph Budziszewski all enabled features workin...

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  30)     switch type
Christoph Budziszewski extracted psth-plot to extr...

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  31)         case 'psth'
private/plotDecodePerformance.m  32)             plotPSTH(psth,psthStart,psthEnd);  
Christoph Budziszewski all enabled features workin...

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  33)         case 'simple'
private/plotDecodePerformance.m  34)             plotDecodePerformanceWithSE(frameStart,frameEnd,decodePerformance)
private/plotDecodePerformance.m  35)         case 'class performance'
private/plotDecodePerformance.m  36)             plotClassPerformance(frameStart,frameEnd,decodePerformance,nClasses)
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  37)         case 'x-subject-val'
private/plotDecodePerformance.m  38)             for c = 1:nSubjects
private/plotDecodePerformance.m  39)                 plot(frameStart:frameEnd, decodePerformance(:,c) ,[colorChooser(mod(c,nSubjects)+3) '-']);
private/plotDecodePerformance.m  40)             end
Christoph Budziszewski all enabled features workin...

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  41)             plotDecodePerformanceWithSE(frameStart,frameEnd,decodePerformance)
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          42)     end
Christoph Budziszewski preliminary confidence inte...

Christoph Budziszewski authored 14 years ago

private/plotDecodePerformance.m  43)     
private/plotDecodePerformance.m  44)     plot([psthStart psthEnd],[chanceLevel chanceLevel],'k:');
private/plotDecodePerformance.m  45) 
private/plotDecodePerformance.m  46)     plotBinConfidenceIntervall(psthStart,psthEnd,nTrials,0.05,chanceLevel/100,'r');
private/plotDecodePerformance.m  47)     plotBinConfidenceIntervall(psthStart,psthEnd,nTrials,0.01,chanceLevel/100,'g');
private/plotDecodePerformance.m  48)     
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          50)     
Christoph Budziszewski all enabled features workin...

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  51) %     setTitle(f,header,decode,subjectData);
private/plotDecodePerformance.m  52)     
private/plotDecodePerformance.m  53) end
private/plotDecodePerformance.m  54) 
Christoph Budziszewski preliminary confidence inte...

Christoph Budziszewski authored 14 years ago

private/plotDecodePerformance.m  55) function plotBinConfidenceIntervall(pStart,pEnd,nTrials,alpha,limit,color)
private/plotDecodePerformance.m  56)     [pLevel Z] = rev_ki_bin(nTrials,alpha,limit);
private/plotDecodePerformance.m  57)     [lower upper proz] = ki_bin(Z,nTrials,alpha);
private/plotDecodePerformance.m  58) 
private/plotDecodePerformance.m  59)     plot([pStart pEnd],[pLevel*100 pLevel*100],[color ':']);
private/plotDecodePerformance.m  60) 
private/plotDecodePerformance.m  61)     plot([pStart pEnd],[lower*100 lower*100],[color '-.']);
private/plotDecodePerformance.m  62)     plot([pStart pEnd],[upper*100 upper*100],[color '-.']);
private/plotDecodePerformance.m  63) end
private/plotDecodePerformance.m  64) 
private/plotDecodePerformance.m  65) function n = getNTrials(psth)
private/plotDecodePerformance.m  66) nSubjects = size(psth,2);
private/plotDecodePerformance.m  67) 
private/plotDecodePerformance.m  68) n = 0;
private/plotDecodePerformance.m  69) for ns = 1:nSubjects
private/plotDecodePerformance.m  70)     nClasses = size(psth{ns},2);
private/plotDecodePerformance.m  71)     for nc = 1:nClasses
private/plotDecodePerformance.m  72)         n = n + size(psth{ns}{nc},1);
private/plotDecodePerformance.m  73)     end
private/plotDecodePerformance.m  74) end
private/plotDecodePerformance.m  75) end
private/plotDecodePerformance.m  76) 
Christoph Budziszewski all enabled features workin...

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  77) function plotClassPerformance(frameStart,frameEnd,decodePerformance,nClasses)
private/plotDecodePerformance.m  78) for c = 1:size(decodePerformance,2)
private/plotDecodePerformance.m  79)     plot(frameStart:frameEnd, decodePerformance(:,c) ,[colorChooser(mod(c,nClasses)+3) '-']);
private/plotDecodePerformance.m  80) end
private/plotDecodePerformance.m  81) plot(frameStart:frameEnd, mean(decodePerformance,2) ,'b','LineWidth',2);
private/plotDecodePerformance.m  82) end
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          83) 
Christoph Budziszewski all enabled features workin...

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  84) function plotDecodePerformanceWithSE(frameStart,frameEnd,decodePerformance)
private/plotDecodePerformance.m  85) plot(frameStart:frameEnd, mean(decodePerformance,2) ,'b','LineWidth',2);
private/plotDecodePerformance.m  86) 
private/plotDecodePerformance.m  87) se = myStdErr(decodePerformance,2);
private/plotDecodePerformance.m  88) plot(frameStart:frameEnd, mean(decodePerformance,2)+se ,'b:');
private/plotDecodePerformance.m  89) plot(frameStart:frameEnd, mean(decodePerformance,2)-se ,'b:');
private/plotDecodePerformance.m  90) end
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          91) 
Christoph Budziszewski all enabled features workin...

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  92) 
private/plotDecodePerformance.m  93) function plotPSTH(psth,psthStart,psthEnd)
private/plotDecodePerformance.m  94) 
private/plotDecodePerformance.m  95) PSTH_AXIS_MIN = -2;
private/plotDecodePerformance.m  96) PSTH_AXIS_MAX = 2;
private/plotDecodePerformance.m  97) 
private/plotDecodePerformance.m  98)     hold on;
private/plotDecodePerformance.m  99)     if (size(psth) > 0)
private/plotDecodePerformance.m 100)       for voxel = 1:size(psth,2)
private/plotDecodePerformance.m 101)           for label = 1:size(psth{voxel},2)
private/plotDecodePerformance.m 102)               psthData = [];
private/plotDecodePerformance.m 103)               for timepoint = 1:size(psth{voxel}{label},2)
private/plotDecodePerformance.m 104)                   psthData = nanmean(psth{voxel}{label});
private/plotDecodePerformance.m 105)               end
Christoph Budziszewski preliminary confidence inte...

Christoph Budziszewski authored 14 years ago

private/plotDecodePerformance.m 106)               PSTH_AXIS_MAX = max(PSTH_AXIS_MAX,nanmax(psthData));
Christoph Budziszewski all enabled features workin...

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m 107)               plot(psthStart:psthEnd,psthData,[colorChooser(voxel), lineStyleChooser(label)]);
private/plotDecodePerformance.m 108)           end
private/plotDecodePerformance.m 109)       end
private/plotDecodePerformance.m 110)     end
private/plotDecodePerformance.m 111)     axis([psthStart psthEnd PSTH_AXIS_MIN PSTH_AXIS_MAX])
private/plotDecodePerformance.m 112)     xlabel('time [sec]');
private/plotDecodePerformance.m 113)     ylabel('fMRI-signal change [%]');
private/plotDecodePerformance.m 114)     hold off
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m         115) end
plotDecodePerformance.m         116) 
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m         117) 
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m         118) function color = colorChooser(n)
plotDecodePerformance.m         119)     switch (mod(n,8))
plotDecodePerformance.m         120)     case 0
plotDecodePerformance.m         121)         color = 'r';
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m         124)     case 2
plotDecodePerformance.m         125)         color = 'b';
plotDecodePerformance.m         126)     case 3
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m         127)         color = 'c';
plotDecodePerformance.m         128)     case 4
plotDecodePerformance.m         129)         color = 'm';
plotDecodePerformance.m         130)     case 5
plotDecodePerformance.m         131)         color = 'y';
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m         132)     otherwise
plotDecodePerformance.m         133)         color = 'k';
plotDecodePerformance.m         134)     end
plotDecodePerformance.m         135) end
plotDecodePerformance.m         136) 
plotDecodePerformance.m         137) function style = lineStyleChooser(n)
plotDecodePerformance.m         138) switch(mod(n,4))
plotDecodePerformance.m         139)     case 0
plotDecodePerformance.m         140)       style = '--';
plotDecodePerformance.m         141)     case 1
plotDecodePerformance.m         142)         style = '-';
plotDecodePerformance.m         143)     case 2 
plotDecodePerformance.m         144)         style = ':';
plotDecodePerformance.m         145)     case 3
Christoph Budziszewski killed unnecessary assignin...

Christoph Budziszewski authored 15 years ago

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