8f723b0876c0d085d4257c15fa73fa31c8c70ca3
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

calculateDecodePerformance.m           1) % function [decodePerformance rawTimecourse ] = calculateDecodePerformance(des,timeLineStart, timeLineEnd, decodeDuration, svmargs, conditionList, sessionList, voxelList, classList, labelMap,normalize)
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

calculateDecodePerformance.m           2) function outputStruct = calculateDecodePerformance(inputStruct,SubjectID)
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

calculateDecodePerformance.m           3) 
calculateDecodePerformance.m           4) addpath 'libsvm-mat-2.88-1';
calculateDecodePerformance.m           5) 
Christoph Budziszewski added 2nd classification me...

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m   6) METHOD = 'single subject SVM';
private/calculateDecodePerformance.m   7) % METHOD = 'cross subject SVM';
private/calculateDecodePerformance.m   8) % METHOD = 'SOM';
Christoph Budziszewski kleine änderungen code move

Christoph Budziszewski authored 15 years ago

calculateDecodePerformance.m           9) 
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

calculateDecodePerformance.m          10) outputStruct = struct;
calculateDecodePerformance.m          11) 
Christoph Budziszewski New5 Studie, Var-Name erset...

Christoph Budziszewski authored 15 years ago

calculateDecodePerformance.m          12) namehelper      = strcat('s',SubjectID);
calculateDecodePerformance.m          13) des             = inputStruct.(namehelper).des;
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

calculateDecodePerformance.m          14) timeLineStart   = inputStruct.frameShiftStart;
calculateDecodePerformance.m          15) timeLineEnd     = inputStruct.frameShiftEnd;
calculateDecodePerformance.m          16) decodeDuration  = inputStruct.decodeDuration;
calculateDecodePerformance.m          17) svmargs         = inputStruct.svmargs;
calculateDecodePerformance.m          18) sessionList     = inputStruct.sessionList;
Christoph Budziszewski New5 Studie, Var-Name erset...

Christoph Budziszewski authored 15 years ago

calculateDecodePerformance.m          19) voxelList       = inputStruct.(namehelper).voxelList;
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

calculateDecodePerformance.m          20) % classList       = inputStruct.classList;
calculateDecodePerformance.m          21) % labelMap        = inputStruct.labelMap;
Christoph Budziszewski added 2nd classification me...

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  22) smoothed        = inputStruct.smoothed;
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

calculateDecodePerformance.m          23) globalStart     = inputStruct.psthStart;
calculateDecodePerformance.m          24) globalEnd       = inputStruct.psthEnd;
calculateDecodePerformance.m          25) baselineStart   = inputStruct.baselineStart;
calculateDecodePerformance.m          26) baselineEnd     = inputStruct.baselineEnd;
calculateDecodePerformance.m          27) eventList       = inputStruct.eventList;
calculateDecodePerformance.m          28) 
calculateDecodePerformance.m          29) minPerformance = inf;
calculateDecodePerformance.m          30) maxPerformance = -inf;
calculateDecodePerformance.m          31)         
Christoph Budziszewski added 2nd classification me...

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  32)         %% ERSETZEN DURCH ROI-IMAGE!
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

calculateDecodePerformance.m          33)         for voxel = 1:size(voxelList,1)  % [[x;x],[y;y],[z;z]]
Christoph Budziszewski added 2nd classification me...

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  34)                 extr        = calculateImageData(voxelList(voxel,:),des,smoothed); 
private/calculateDecodePerformance.m  35)                 rawdata     = cell2mat({extr.mean}); % Raw Data
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

calculateDecodePerformance.m          36)                 pst{voxel}  = calculatePST(des,globalStart,baselineStart,baselineEnd,globalEnd,eventList,rawdata,sessionList);
calculateDecodePerformance.m          37)         end
Axel Lindner plot optimiert. normalisier...

Axel Lindner authored 15 years ago

calculateDecodePerformance.m          38)         
Christoph Budziszewski added 2nd classification me...

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  39)         timePointArgs.pst = pst;
private/calculateDecodePerformance.m  40)         timePointArgs.timeLineStart = timeLineStart;
private/calculateDecodePerformance.m  41)         timePointArgs.timeLineEnd   = timeLineEnd;
private/calculateDecodePerformance.m  42)         timePointArgs.globalStart   = globalStart;
private/calculateDecodePerformance.m  43)         timePointArgs.globalEnd     = globalEnd;
private/calculateDecodePerformance.m  44)         timePointArgs.decodeDuration= decodeDuration;
private/calculateDecodePerformance.m  45)         timePointArgs.labelMap      = inputStruct.labelMap;
private/calculateDecodePerformance.m  46)         timePointArgs.eventList     = eventList;
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

calculateDecodePerformance.m          47)         
Christoph Budziszewski added 2nd classification me...

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  48)         timePointMatrix = buildTimePointMatrix(timePointArgs);
private/calculateDecodePerformance.m  49) 
private/calculateDecodePerformance.m  50)         decodePerformance = [];
private/calculateDecodePerformance.m  51)         for index = 1:timeLineEnd-timeLineStart+1
private/calculateDecodePerformance.m  52)             RANDOMIZE_DATAPOINTS = 0;
private/calculateDecodePerformance.m  53)             svmdata      = timePointMatrix{index}(:,2:size(timePointMatrix{index},2));
private/calculateDecodePerformance.m  54)             svmlabel     = timePointMatrix{index}(:,1);
Axel Lindner plot optimiert. normalisier...

Axel Lindner authored 15 years ago

calculateDecodePerformance.m          55)             
Christoph Budziszewski added 2nd classification me...

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  56)             if RANDOMIZE_DATAPOINTS
private/calculateDecodePerformance.m  57)                 rndindex  = randperm(length(svmlabel));
private/calculateDecodePerformance.m  58)                 svmdata   = svmdata(rndindex,:);
private/calculateDecodePerformance.m  59)                 svmlabel  = svmlabel(rndindex);
private/calculateDecodePerformance.m  60)             end
private/calculateDecodePerformance.m  61) 
Christoph Budziszewski minor changes in coding style

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  62)             SVM_METHOD = 'som training'
Christoph Budziszewski added 2nd classification me...

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  63)             switch SVM_METHOD;
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  64)                 case 'libsvm crossval'
Christoph Budziszewski added 2nd classification me...

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  65)                     performance  = svmtrain(svmlabel, svmdata, svmargs);
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

calculateDecodePerformance.m          66) 
Christoph Budziszewski added 2nd classification me...

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  67)                     minPerformance = min(minPerformance,performance);
private/calculateDecodePerformance.m  68)                     maxPerformance = max(maxPerformance,performance);
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

calculateDecodePerformance.m          69) 
Christoph Budziszewski added 2nd classification me...

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  70)                     decodePerformance = [decodePerformance; performance];
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  71)                 case 'class performance'
Christoph Budziszewski added 2nd classification me...

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  72)                     newsvmopt = killCrossvalOpt(svmargs);
private/calculateDecodePerformance.m  73)                     
private/calculateDecodePerformance.m  74)                     model = svmtrain(svmlabel,svmdata,newsvmopt);
private/calculateDecodePerformance.m  75)                     classperformance = [];
private/calculateDecodePerformance.m  76)                     for class = unique(svmlabel)';
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  77) 
Christoph Budziszewski added 2nd classification me...

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  78)                         filterindex = find(class == svmlabel);
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  79)                         testing_label = svmlabel(filterindex);
private/calculateDecodePerformance.m  80)                         testing_data  = svmdata(filterindex);
private/calculateDecodePerformance.m  81)                         [plabel accuracy dvalue] = svmpredict(testing_label,testing_data,model,'');
private/calculateDecodePerformance.m  82) 
Christoph Budziszewski added 2nd classification me...

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  83)                         classperformance = [classperformance accuracy(1)];
private/calculateDecodePerformance.m  84)                     end
private/calculateDecodePerformance.m  85)                     decodePerformance = [decodePerformance; classperformance];
private/calculateDecodePerformance.m  86)                     
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  87)                 case 'som training'
private/calculateDecodePerformance.m  88)                     display('SOM TRAINING');
private/calculateDecodePerformance.m  89)                     addpath 'somtoolbox2';
Christoph Budziszewski minor changes in coding style

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  90)                     sD = som_data_struct(svmdata,'label',num2str(svmlabel));
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  91)                     assignin('base','sD',sD);
private/calculateDecodePerformance.m  92)                     sM = som_make(sD,'msize', [3 4],'lattice', 'rect');
private/calculateDecodePerformance.m  93)                     
Christoph Budziszewski minor changes in coding style

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  94)                     assignin('base','sD',sD);
private/calculateDecodePerformance.m  95)                     assignin('base','sM',sM);
private/calculateDecodePerformance.m  96)                     
Christoph Budziszewski kleine änderungen code move

Christoph Budziszewski authored 15 years ago

calculateDecodePerformance.m          97)             end
calculateDecodePerformance.m          98)             
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

calculateDecodePerformance.m          99)         end
calculateDecodePerformance.m         100)         
calculateDecodePerformance.m         101)         outputStruct.decodePerformance  = decodePerformance;
calculateDecodePerformance.m         102)         outputStruct.svmdata            = svmdata;
calculateDecodePerformance.m         103)         outputStruct.svmlabel           = svmlabel;
calculateDecodePerformance.m         104)         outputStruct.rawTimeCourse      = pst;
calculateDecodePerformance.m         105)         outputStruct.minPerformance     = minPerformance;
calculateDecodePerformance.m         106)         outputStruct.maxPerformance     = maxPerformance;
calculateDecodePerformance.m         107) end
calculateDecodePerformance.m         108)