c0e4506ebc5e6ce51d3f08033557de0abaf8a002
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 subject loop is function

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

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;
private/plotDecodePerformance.m  19) 
private/plotDecodePerformance.m  20)         smoothed          = 'yes';
private/plotDecodePerformance.m  21)         
private/plotDecodePerformance.m  22)         PLOT_METHOD       = SVMCROSSVAL_CROSSVAL_METHOD_DEF.svmcrossval;
Christoph Budziszewski nSubject-fold cross validat...

Christoph Budziszewski authored 15 years ago

private/plotDecodePerformance.m  23)         PLOT_METHOD       = SVMCROSSVAL_CROSSVAL_METHOD_DEF.classPerformance;
Christoph Budziszewski using global variables now....

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          25) 
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Axel Lindner authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Axel Lindner authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          49)     
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Axel Lindner authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          59)     
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          68)             for c = 1:size(decodePerformance,2)
plotDecodePerformance.m          69)                 plot(frameStart:frameEnd, decodePerformance(:,c) ,[colorChooser(mod(c,nClasses)+3) '-']);
plotDecodePerformance.m          70)             end
plotDecodePerformance.m          71) 
plotDecodePerformance.m          72)             plot(frameStart:frameEnd, mean(decodePerformance,2) ,'b','LineWidth',2);
plotDecodePerformance.m          73) 
plotDecodePerformance.m          74)     end
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          75)     
plotDecodePerformance.m          76)     
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          79)     nSubjects = size(SubjectID,2);
plotDecodePerformance.m          80)     nVoxelPerSubject = size(psth,2)/size(SubjectID,2);
plotDecodePerformance.m          81)     
plotDecodePerformance.m          82)     if strcmp(smoothed,'yes')
plotDecodePerformance.m          83)         smoothedString = 'using smoothed data';
plotDecodePerformance.m          84)     else
plotDecodePerformance.m          85)         smoothedString = 'using unsmoothed data';
plotDecodePerformance.m          86)     end
plotDecodePerformance.m          87)     
plotDecodePerformance.m          88)     if nSubjects == 1
Christoph Budziszewski single subject -> svm class...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          90)         title = sprintf('Subject %s, over %g voxel, %s',subjectName,nVoxelPerSubject,smoothedString);
plotDecodePerformance.m          91)     else
plotDecodePerformance.m          92)         title = sprintf('%g Subjects, %g Voxel per Subject, %s',nSubjects,nVoxelPerSubject,smoothedString);
plotDecodePerformance.m          93)     end
plotDecodePerformance.m          94)     
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m          95) 
plotDecodePerformance.m          96)     set(f,'Name',title);
plotDecodePerformance.m          97)     display(sprintf('%s',title));
plotDecodePerformance.m          98) 
plotDecodePerformance.m          99) 
plotDecodePerformance.m         100) 
plotDecodePerformance.m         101) end
plotDecodePerformance.m         102) 
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m         103) 
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m         104) function color = colorChooser(n)
plotDecodePerformance.m         105)     switch (mod(n,8))
plotDecodePerformance.m         106)     case 0
plotDecodePerformance.m         107)         color = 'r';
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m         110)     case 2
plotDecodePerformance.m         111)         color = 'b';
plotDecodePerformance.m         112)     case 3
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m         113)         color = 'c';
plotDecodePerformance.m         114)     case 4
plotDecodePerformance.m         115)         color = 'm';
plotDecodePerformance.m         116)     case 5
plotDecodePerformance.m         117)         color = 'y';
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

plotDecodePerformance.m         118)     otherwise
plotDecodePerformance.m         119)         color = 'k';
plotDecodePerformance.m         120)     end
plotDecodePerformance.m         121) end
plotDecodePerformance.m         122) 
plotDecodePerformance.m         123) function style = lineStyleChooser(n)
plotDecodePerformance.m         124) switch(mod(n,4))
plotDecodePerformance.m         125)     case 0
plotDecodePerformance.m         126)       style = '--';
plotDecodePerformance.m         127)     case 1
plotDecodePerformance.m         128)         style = '-';
plotDecodePerformance.m         129)     case 2 
plotDecodePerformance.m         130)         style = ':';
plotDecodePerformance.m         131)     case 3
Christoph Budziszewski killed unnecessary assignin...

Christoph Budziszewski authored 15 years ago

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