fd18aa844618f46af27cad4ff66769818d85398c
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) 
private/calculateDecodePerformance.m  62)             SVM_METHOD = 2;
private/calculateDecodePerformance.m  63)             switch SVM_METHOD;
private/calculateDecodePerformance.m  64)                 case 1
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];
private/calculateDecodePerformance.m  71)                 case 2
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)';
private/calculateDecodePerformance.m  77) %                         assignin('base','uniquelabel',unique(svmlabel));
private/calculateDecodePerformance.m  78) %                         assignin('base','class',class);
private/calculateDecodePerformance.m  79) %                         assignin('base','svmlabel',svmlabel);
private/calculateDecodePerformance.m  80)                         filterindex = find(class == svmlabel);
private/calculateDecodePerformance.m  81)                         testing_label = svmlabel(filterindex)
private/calculateDecodePerformance.m  82)                         testing_data  = svmdata(filterindex)
private/calculateDecodePerformance.m  83)                         [plabel accuracy dvalue] = svmpredict(testing_label,testing_data,model,'')
private/calculateDecodePerformance.m  84) %                         assignin('base','accuracy',accuracy);
private/calculateDecodePerformance.m  85)                         classperformance = [classperformance accuracy(1)];
private/calculateDecodePerformance.m  86)                     end
private/calculateDecodePerformance.m  87)                     decodePerformance = [decodePerformance; classperformance];
private/calculateDecodePerformance.m  88)                     
Christoph Budziszewski kleine änderungen code move

Christoph Budziszewski authored 15 years ago

calculateDecodePerformance.m          89)             end
calculateDecodePerformance.m          90)             
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

calculateDecodePerformance.m          91)         end
calculateDecodePerformance.m          92)         
calculateDecodePerformance.m          93)         outputStruct.decodePerformance  = decodePerformance;
calculateDecodePerformance.m          94)         outputStruct.svmdata            = svmdata;
calculateDecodePerformance.m          95)         outputStruct.svmlabel           = svmlabel;
calculateDecodePerformance.m          96)         outputStruct.rawTimeCourse      = pst;
calculateDecodePerformance.m          97)         outputStruct.minPerformance     = minPerformance;
calculateDecodePerformance.m          98)         outputStruct.maxPerformance     = maxPerformance;
calculateDecodePerformance.m          99) end
calculateDecodePerformance.m         100)