daadf09bb8b68328d5df1e730878307ae52c49d7
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 SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          19) 
plotDecodePerformance.m          20)     f = figure;
Christoph Budziszewski begin SOM implementation

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  21)     subplot(2,1,1); 
Christoph Budziszewski all enabled features workin...

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  22)         plotPSTH(psth,psthStart,psthEnd);
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  24)     % plot performance timeline
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          25)     subplot(2,1,2)    
plotDecodePerformance.m          26)     hold on;
plotDecodePerformance.m          27)     chanceLevel = 100/nClasses;
plotDecodePerformance.m          28)     goodPredictionLevel = chanceLevel*1.5;
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Axel Lindner authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  35)     switch type
private/plotDecodePerformance.m  36)         case 'simple'
private/plotDecodePerformance.m  37)             plotDecodePerformanceWithSE(frameStart,frameEnd,decodePerformance)
private/plotDecodePerformance.m  38)         case 'class performance'
private/plotDecodePerformance.m  39)             plotClassPerformance(frameStart,frameEnd,decodePerformance,nClasses)
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          45)     end
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  48) %     setTitle(f,header,decode,subjectData);
private/plotDecodePerformance.m  49)     
private/plotDecodePerformance.m  50) end
private/plotDecodePerformance.m  51) 
private/plotDecodePerformance.m  52) function setTitle(f,header,decode,subjectData)
private/plotDecodePerformance.m  53) 
Christoph Budziszewski using global variables now....

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          54)     nVoxelPerSubject = size(psth,2)/size(SubjectID,2);
plotDecodePerformance.m          55)     
plotDecodePerformance.m          56)     if strcmp(smoothed,'yes')
plotDecodePerformance.m          57)         smoothedString = 'using smoothed data';
plotDecodePerformance.m          58)     else
plotDecodePerformance.m          59)         smoothedString = 'using unsmoothed data';
plotDecodePerformance.m          60)     end
plotDecodePerformance.m          61)     
plotDecodePerformance.m          62)     if nSubjects == 1
Christoph Budziszewski single subject -> svm class...

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  63)         subjectName = SubjectID{1}.name;
Christoph Budziszewski using global variables now....

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          64)         title = sprintf('Subject %s, over %g voxel, %s',subjectName,nVoxelPerSubject,smoothedString);
plotDecodePerformance.m          65)     else
plotDecodePerformance.m          66)         title = sprintf('%g Subjects, %g Voxel per Subject, %s',nSubjects,nVoxelPerSubject,smoothedString);
plotDecodePerformance.m          67)     end
plotDecodePerformance.m          68)     
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          69) 
plotDecodePerformance.m          70)     set(f,'Name',title);
plotDecodePerformance.m          71)     display(sprintf('%s',title));
Christoph Budziszewski all enabled features workin...

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  72) end
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  89) 
private/plotDecodePerformance.m  90) function plotPSTH(psth,psthStart,psthEnd)
private/plotDecodePerformance.m  91) 
private/plotDecodePerformance.m  92) PSTH_AXIS_MIN = -2;
private/plotDecodePerformance.m  93) PSTH_AXIS_MAX = 2;
private/plotDecodePerformance.m  94) 
private/plotDecodePerformance.m  95)     hold on;
private/plotDecodePerformance.m  96)     if (size(psth) > 0)
private/plotDecodePerformance.m  97)       for voxel = 1:size(psth,2)
private/plotDecodePerformance.m  98)           for label = 1:size(psth{voxel},2)
private/plotDecodePerformance.m  99)               psthData = [];
private/plotDecodePerformance.m 100)               for timepoint = 1:size(psth{voxel}{label},2)
private/plotDecodePerformance.m 101)                   psthData = nanmean(psth{voxel}{label});
private/plotDecodePerformance.m 102)               end
private/plotDecodePerformance.m 103)               plot(psthStart:psthEnd,psthData,[colorChooser(voxel), lineStyleChooser(label)]);
private/plotDecodePerformance.m 104)           end
private/plotDecodePerformance.m 105)       end
private/plotDecodePerformance.m 106)     end
private/plotDecodePerformance.m 107)     axis([psthStart psthEnd PSTH_AXIS_MIN PSTH_AXIS_MAX])
private/plotDecodePerformance.m 108)     xlabel('time [sec]');
private/plotDecodePerformance.m 109)     ylabel('fMRI-signal change [%]');
private/plotDecodePerformance.m 110)     hold off
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m         111) end
plotDecodePerformance.m         112) 
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m         113) 
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m         114) function color = colorChooser(n)
plotDecodePerformance.m         115)     switch (mod(n,8))
plotDecodePerformance.m         116)     case 0
plotDecodePerformance.m         117)         color = 'r';
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m         120)     case 2
plotDecodePerformance.m         121)         color = 'b';
plotDecodePerformance.m         122)     case 3
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m         123)         color = 'c';
plotDecodePerformance.m         124)     case 4
plotDecodePerformance.m         125)         color = 'm';
plotDecodePerformance.m         126)     case 5
plotDecodePerformance.m         127)         color = 'y';
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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