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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

calculateDecodePerformance.m           3) 
Christoph Budziszewski using global variables now....

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m   4) global CROSSVAL_METHOD_DEF;
private/calculateDecodePerformance.m   5) 
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

calculateDecodePerformance.m           6) addpath 'libsvm-mat-2.88-1';
calculateDecodePerformance.m           7) 
Christoph Budziszewski using global variables now....

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m   8) % CROSSVAL_METHOD_DEF = inputStruct.CROSSVAL_METHOD_DEF;
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m   9) METHOD              = inputStruct.CROSSVAL_METHOD;
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  10) 
private/calculateDecodePerformance.m  11) RANDOMIZE_DATAPOINTS = inputStruct.RANDOMIZE;
Christoph Budziszewski kleine änderungen code move

Christoph Budziszewski authored 15 years ago

calculateDecodePerformance.m          12) 
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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) eventList       = inputStruct.eventList;
calculateDecodePerformance.m          24) 
Christoph Budziszewski subject loop is function

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  25) timeLineStart   = timeline.frameShiftStart;
private/calculateDecodePerformance.m  26) timeLineEnd     = timeline.frameShiftEnd;
private/calculateDecodePerformance.m  27) decodeDuration  = timeline.decodeDuration;
private/calculateDecodePerformance.m  28) globalStart     = timeline.psthStart;
private/calculateDecodePerformance.m  29) globalEnd       = timeline.psthEnd;
private/calculateDecodePerformance.m  30) baselineStart   = timeline.baselineStart;
private/calculateDecodePerformance.m  31) baselineEnd     = timeline.baselineEnd;
private/calculateDecodePerformance.m  32) 
private/calculateDecodePerformance.m  33) 
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

calculateDecodePerformance.m          34) minPerformance = inf;
calculateDecodePerformance.m          35) maxPerformance = -inf;
calculateDecodePerformance.m          36)         
Christoph Budziszewski added 2nd classification me...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

calculateDecodePerformance.m          38)         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  39)                 extr        = calculateImageData(voxelList(voxel,:),des,smoothed); 
private/calculateDecodePerformance.m  40)                 rawdata     = cell2mat({extr.mean}); % Raw Data
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

Axel Lindner authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  44)         timePointArgs.pst = pst;
private/calculateDecodePerformance.m  45)         timePointArgs.timeLineStart = timeLineStart;
private/calculateDecodePerformance.m  46)         timePointArgs.timeLineEnd   = timeLineEnd;
private/calculateDecodePerformance.m  47)         timePointArgs.globalStart   = globalStart;
private/calculateDecodePerformance.m  48)         timePointArgs.globalEnd     = globalEnd;
private/calculateDecodePerformance.m  49)         timePointArgs.decodeDuration= decodeDuration;
private/calculateDecodePerformance.m  50)         timePointArgs.labelMap      = inputStruct.labelMap;
private/calculateDecodePerformance.m  51)         timePointArgs.eventList     = eventList;
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  53)         timePointMatrix = buildTimePointMatrix(timePointArgs);
private/calculateDecodePerformance.m  54) 
private/calculateDecodePerformance.m  55)         decodePerformance = [];
private/calculateDecodePerformance.m  56)         for index = 1:timeLineEnd-timeLineStart+1
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  58)             svmdata      = timePointMatrix{index}(:,2:size(timePointMatrix{index},2));
private/calculateDecodePerformance.m  59)             svmlabel     = timePointMatrix{index}(:,1);
Axel Lindner plot optimiert. normalisier...

Axel Lindner authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  61)             if RANDOMIZE_DATAPOINTS
private/calculateDecodePerformance.m  62)                 rndindex  = randperm(length(svmlabel));
private/calculateDecodePerformance.m  63)                 svmdata   = svmdata(rndindex,:);
private/calculateDecodePerformance.m  64)                 svmlabel  = svmlabel(rndindex);
private/calculateDecodePerformance.m  65)             end
private/calculateDecodePerformance.m  66) 
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  67)             switch METHOD;
private/calculateDecodePerformance.m  68)                 case CROSSVAL_METHOD_DEF.svmcrossval
private/calculateDecodePerformance.m  69)                     
Christoph Budziszewski added 2nd classification me...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  75)                     decodePerformance = [decodePerformance; performance];
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  76)                     
private/calculateDecodePerformance.m  77)                 case CROSSVAL_METHOD_DEF.classPerformance
private/calculateDecodePerformance.m  78)                     
Christoph Budziszewski added 2nd classification me...

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  79)                     newsvmopt = killCrossvalOpt(svmargs);
private/calculateDecodePerformance.m  80)                     
private/calculateDecodePerformance.m  81)                     model = svmtrain(svmlabel,svmdata,newsvmopt);
private/calculateDecodePerformance.m  82)                     classperformance = [];
private/calculateDecodePerformance.m  83)                     for class = unique(svmlabel)';
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  86)                         testing_label = svmlabel(filterindex);
private/calculateDecodePerformance.m  87)                         testing_data  = svmdata(filterindex);
private/calculateDecodePerformance.m  88)                         [plabel accuracy dvalue] = svmpredict(testing_label,testing_data,model,'');
private/calculateDecodePerformance.m  89) 
Christoph Budziszewski added 2nd classification me...

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  90)                         classperformance = [classperformance accuracy(1)];
private/calculateDecodePerformance.m  91)                     end
private/calculateDecodePerformance.m  92)                     decodePerformance = [decodePerformance; classperformance];
private/calculateDecodePerformance.m  93)                     
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  94)                 case CROSSVAL_METHOD_DEF.somTraining
private/calculateDecodePerformance.m  95)                     
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  96)                     display('SOM TRAINING');
private/calculateDecodePerformance.m  97)                     addpath 'somtoolbox2';
Christoph Budziszewski minor changes in coding style

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m  99)                     assignin('base','sD',sD);
Axel Lindner labels for axis

Axel Lindner authored 15 years ago

private/calculateDecodePerformance.m 100)                     sM = som_make(sD,'msize', [3 3],'lattice', 'hexa');
Christoph Budziszewski starting som prediction fin...

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m 101)                     
Christoph Budziszewski minor changes in coding style

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m 102)                     assignin('base','sD',sD);
private/calculateDecodePerformance.m 103)                     assignin('base','sM',sM);
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

private/calculateDecodePerformance.m 104)                     display('type ''figure'' before visualisation');
Christoph Budziszewski kleine änderungen code move

Christoph Budziszewski authored 15 years ago

calculateDecodePerformance.m         105)             end
calculateDecodePerformance.m         106)             
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

calculateDecodePerformance.m         107)         end
calculateDecodePerformance.m         108)         
calculateDecodePerformance.m         109)         outputStruct.decodePerformance  = decodePerformance;
calculateDecodePerformance.m         110)         outputStruct.svmdata            = svmdata;
calculateDecodePerformance.m         111)         outputStruct.svmlabel           = svmlabel;
calculateDecodePerformance.m         112)         outputStruct.rawTimeCourse      = pst;
calculateDecodePerformance.m         113)         outputStruct.minPerformance     = minPerformance;
calculateDecodePerformance.m         114)         outputStruct.maxPerformance     = maxPerformance;
calculateDecodePerformance.m         115) end
calculateDecodePerformance.m         116)