90f42025f7bfc3246aa5cb22f8c0b702077787ed
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

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

Christoph Budziszewski authored 15 years ago

3) 
4) addpath 'libsvm-mat-2.88-1';
5) 
Christoph Budziszewski kleine änderungen code move

Christoph Budziszewski authored 15 years ago

6) SINGLE = 1;
7) 
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

8) outputStruct = struct;
9) 
Christoph Budziszewski New5 Studie, Var-Name erset...

Christoph Budziszewski authored 15 years ago

10) namehelper      = strcat('s',SubjectID);
11) des             = inputStruct.(namehelper).des;
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

17) voxelList       = inputStruct.(namehelper).voxelList;
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

18) % classList       = inputStruct.classList;
19) % labelMap        = inputStruct.labelMap;
Christoph Budziszewski killed unnecessary assignin...

Christoph Budziszewski authored 15 years ago

20) smoothed       = inputStruct.smoothed;
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

21) globalStart     = inputStruct.psthStart;
22) globalEnd       = inputStruct.psthEnd;
23) baselineStart   = inputStruct.baselineStart;
24) baselineEnd     = inputStruct.baselineEnd;
25) eventList       = inputStruct.eventList;
Christoph Budziszewski new LabelMap new svm groupi...

Christoph Budziszewski authored 15 years ago

26) labelMap        = inputStruct.labelMap;
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

27) 
28) 
29) minPerformance = inf;
30) maxPerformance = -inf;
31) 
32) 
33)         
34)         %Pro Voxel PSTH TIMELINE berechnen.
35)         %   timeshift mit pst-timeline durchf�hren.
36)         % psth-timeline -25 bis +15 zu RES Onset.
37)         
38) %         eventList       = [9,11,13;10,12,14];
39) %         globalStart     = -25;
40) %         globalEnd       = 15;
41) %         baselineStart   = -22;
42) %         baselineEnd     = -20;
43)         
44)         
45)         for voxel = 1:size(voxelList,1)  % [[x;x],[y;y],[z;z]]
Christoph Budziszewski killed unnecessary assignin...

Christoph Budziszewski authored 15 years ago

46)                 extr  = calculateImageData(voxelList(voxel,:),des,smoothed);
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

47)                 rawdata=cell2mat({extr.mean}); % Raw Data
48)                 pst{voxel}  = calculatePST(des,globalStart,baselineStart,baselineEnd,globalEnd,eventList,rawdata,sessionList);
49)         end
Axel Lindner plot optimiert. normalisier...

Axel Lindner authored 15 years ago

50)         
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

51)         decodePerformance = [];
52) 
53)         for timeShift   = timeLineStart:1:timeLineEnd
54)             frameStart  = floor(-globalStart+1+timeShift - 0.5*decodeDuration);
55)             frameEnd    = min(ceil(frameStart+decodeDuration + 0.5*decodeDuration),-globalStart+globalEnd);
56)             
57)             tmp =[];
58)             anyvoxel = 1;
Christoph Budziszewski new LabelMap new svm groupi...

Christoph Budziszewski authored 15 years ago

59)             for pstConditionGroup = 1:size(pst{1,anyvoxel},2) 
60)                 for dp = 1:size(pst{1,anyvoxel}{1,pstConditionGroup},1) % data point
Axel Lindner plot optimiert. normalisier...

Axel Lindner authored 15 years ago

61)                   row = getSVMLabel(labelMap,eventList(pstConditionGroup,1));
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

62)                     for voxel = 1:size(pst,2)
Christoph Budziszewski new LabelMap new svm groupi...

Christoph Budziszewski authored 15 years ago

63)                         row = [row, pst{1,voxel}{1,pstConditionGroup}(dp,frameStart:frameEnd)]; % label,value,value
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

64)                     end
65)                 tmp  = [tmp; row];
66)                 end
67)             end 
68)         
69)             svmdata      = tmp(:,2:size(tmp,2));
70)             svmlabel     = tmp(:,1);
Christoph Budziszewski kleine änderungen code move

Christoph Budziszewski authored 15 years ago

71)             
Axel Lindner plot optimiert. normalisier...

Axel Lindner authored 15 years ago

72) %             rndindex  = randperm(length(svmlabel));
73) %             svmdata   = svmdata(rndindex,:);
74) %             svmlabel  = svmlabel(rndindex);
75)             
Christoph Budziszewski kleine änderungen code move

Christoph Budziszewski authored 15 years ago

76)             if SINGLE
77)                 performance  = svmtrain(svmlabel, svmdata, svmargs);
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

78) 
Christoph Budziszewski kleine änderungen code move

Christoph Budziszewski authored 15 years ago

79)                 minPerformance = min(minPerformance,performance);
80)                 maxPerformance = max(maxPerformance,performance);
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

81) 
Christoph Budziszewski kleine änderungen code move

Christoph Budziszewski authored 15 years ago

82)                 decodePerformance = [decodePerformance; performance];
83)             end
84)