c73e97a6595599e91709c85a20c3893cac69a052
Christoph Budziszewski single subject -> svm class...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m           2) 
Christoph Budziszewski single subject -> svm class...

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m   3) global SVMCROSSVAL_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 single subject -> svm class...

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m   8) timeline = header.timeline;
private/plotDecodePerformance.m   9) 
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  10) psthStart         = timeline.psthStart;
private/plotDecodePerformance.m  11) psthEnd           = timeline.psthEnd;
private/plotDecodePerformance.m  12) frameStart        = timeline.frameShiftStart;
private/plotDecodePerformance.m  13) frameEnd          = timeline.frameShiftEnd;
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  20) smoothed          = 'yes';
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  22) PLOT_METHOD       = SVMCROSSVAL_CROSSVAL_METHOD_DEF.svmcrossval;
private/plotDecodePerformance.m  23) PLOT_METHOD       = SVMCROSSVAL_CROSSVAL_METHOD_DEF.classPerformance;
private/plotDecodePerformance.m  24) PLOT_METHOD       = 'x-subject-val';
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          25) 
plotDecodePerformance.m          26)     f = figure;
plotDecodePerformance.m          27)     subplot(2,1,1);
plotDecodePerformance.m          28)     hold on;
Christoph Budziszewski nSubject-fold cross validat...

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  29)     size(psth)
private/plotDecodePerformance.m  30)     if (size(psth) > 0)
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          31)       for voxel = 1:size(psth,2)
plotDecodePerformance.m          32)           for label = 1:size(psth{voxel},2)
plotDecodePerformance.m          33)               psthData = [];
plotDecodePerformance.m          34)               for timepoint = 1:size(psth{voxel}{label},2)
Axel Lindner New Normalization Methods i...

Axel Lindner authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          36)               end
plotDecodePerformance.m          37)               plot(psthStart:psthEnd,psthData,[colorChooser(voxel), lineStyleChooser(label)]);
plotDecodePerformance.m          38)           end
plotDecodePerformance.m          39)       end
Christoph Budziszewski nSubject-fold cross validat...

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  40)     end
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

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

Axel Lindner authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          48)     
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Axel Lindner authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          58)     
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          59)     switch PLOT_METHOD
Christoph Budziszewski single subject -> svm class...

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  60)         case SVMCROSSVAL_CROSSVAL_METHOD_DEF.svmcrossval
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          61)             plot(frameStart:frameEnd, mean(decodePerformance,2) ,'b','LineWidth',2);
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          62) 
plotDecodePerformance.m          63)             se = myStdErr(decodePerformance,2);
plotDecodePerformance.m          64)             plot(frameStart:frameEnd, mean(decodePerformance,2)+se ,'b:');
plotDecodePerformance.m          65)             plot(frameStart:frameEnd, mean(decodePerformance,2)-se ,'b:');
Christoph Budziszewski single subject -> svm class...

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  66)         case SVMCROSSVAL_CROSSVAL_METHOD_DEF.classPerformance
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          67)             for c = 1:size(decodePerformance,2)
plotDecodePerformance.m          68)                 plot(frameStart:frameEnd, decodePerformance(:,c) ,[colorChooser(mod(c,nClasses)+3) '-']);
plotDecodePerformance.m          69)             end
plotDecodePerformance.m          70) 
plotDecodePerformance.m          71)             plot(frameStart:frameEnd, mean(decodePerformance,2) ,'b','LineWidth',2);
Christoph Budziszewski moved stuff, fixing plotDecode

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  72)             
private/plotDecodePerformance.m  73)         case 'x-subject-val'
private/plotDecodePerformance.m  74)             nSubjects = size(decodePerformance,2);
private/plotDecodePerformance.m  75)             for c = 1:nSubjects
private/plotDecodePerformance.m  76)                 plot(frameStart:frameEnd, decodePerformance(:,c) ,[colorChooser(mod(c,nSubjects)+3) '-']);
private/plotDecodePerformance.m  77)             end
private/plotDecodePerformance.m  78) 
private/plotDecodePerformance.m  79)             plot(frameStart:frameEnd, mean(decodePerformance,2) ,'b','LineWidth',2);
private/plotDecodePerformance.m  80)             se = myStdErr(decodePerformance,2);
private/plotDecodePerformance.m  81)             plot(frameStart:frameEnd, mean(decodePerformance,2)+se ,'b:');
private/plotDecodePerformance.m  82)             plot(frameStart:frameEnd, mean(decodePerformance,2)-se ,'b:');
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          83) 
plotDecodePerformance.m          84)     end
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          85)     
plotDecodePerformance.m          86)     
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          89)     nSubjects = size(SubjectID,2);
plotDecodePerformance.m          90)     nVoxelPerSubject = size(psth,2)/size(SubjectID,2);
plotDecodePerformance.m          91)     
plotDecodePerformance.m          92)     if strcmp(smoothed,'yes')
plotDecodePerformance.m          93)         smoothedString = 'using smoothed data';
plotDecodePerformance.m          94)     else
plotDecodePerformance.m          95)         smoothedString = 'using unsmoothed data';
plotDecodePerformance.m          96)     end
plotDecodePerformance.m          97)     
plotDecodePerformance.m          98)     if nSubjects == 1
Christoph Budziszewski single subject -> svm class...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m         100)         title = sprintf('Subject %s, over %g voxel, %s',subjectName,nVoxelPerSubject,smoothedString);
plotDecodePerformance.m         101)     else
plotDecodePerformance.m         102)         title = sprintf('%g Subjects, %g Voxel per Subject, %s',nSubjects,nVoxelPerSubject,smoothedString);
plotDecodePerformance.m         103)     end
plotDecodePerformance.m         104)     
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m         105) 
plotDecodePerformance.m         106)     set(f,'Name',title);
plotDecodePerformance.m         107)     display(sprintf('%s',title));
plotDecodePerformance.m         108) 
plotDecodePerformance.m         109) 
plotDecodePerformance.m         110) 
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 = '-.';