6157c8a01a7b175a3d35a2f333815e5f0a80545d
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

1) function classify(varargin)
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

2) 
Christoph Budziszewski new LabelMap new svm groupi...

Christoph Budziszewski authored 15 years ago

3) 
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

4) 
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

5) switch nargin
6)     case 1
7)         paramModel = varargin{1};
Axel Lindner New Option for COL Bias rem...

Axel Lindner authored 15 years ago

8)         %PROJECT_BASE_PATH = 'D:\Analyze\Stimolos';
9)         PROJECT_BASE_PATH = 'D:\Analyze\Choice\24pilot';
Christoph Budziszewski new LabelMap new svm groupi...

Christoph Budziszewski authored 15 years ago

10)         PROJECT_RESULT_PATH = 'results\SPM.mat';
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

11)     otherwise
12)         error('spmtoolbox:SVMCrossVal:arginError','Please Specify action and parameter model');
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

13) end
14) 
Christoph Budziszewski GUI parsing halfway done.

Christoph Budziszewski authored 15 years ago

15)         
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

16)         % common params
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

17)         calculateParams  = struct;
Christoph Budziszewski killed unnecessary assignin...

Christoph Budziszewski authored 15 years ago

18)         calculateParams.smoothed        = getDouble(paramModel.txtSmoothed);
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

19) 
Christoph Budziszewski GUI parsing halfway done.

Christoph Budziszewski authored 15 years ago

20)         calculateParams.frameShiftStart = getDouble(paramModel.txtFrameShiftStart);  % -20;
21)         calculateParams.frameShiftEnd   = getDouble(paramModel.txtFrameShiftEnd); %15;
22)         calculateParams.decodeDuration  = getDouble(paramModel.txtFrameShiftDur);
23)         calculateParams.psthStart       = getDouble(paramModel.txtPSTHStart); % -25;
24)         calculateParams.psthEnd         = getDouble(paramModel.txtPSTHEnd); % 20;
25)         calculateParams.baselineStart   = getDouble(paramModel.txtBaselineStart); % -22;
26)         calculateParams.baselineEnd     = getDouble(paramModel.txtBaselineEnd); % -20;
27) 
28)         calculateParams.svmargs         = get(paramModel.txtSVMopts,'String');
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

29)         calculateParams.sessionList     = 1:3;
Christoph Budziszewski GUI parsing halfway done.

Christoph Budziszewski authored 15 years ago

30) 
Christoph Budziszewski class def parsing added str...

Christoph Budziszewski authored 15 years ago

31)         classStruct = parseClassDef(paramModel);
32)         
33)         
Christoph Budziszewski new LabelMap new svm groupi...

Christoph Budziszewski authored 15 years ago

34)         calculateParams.labelMap        = LabelMap(classStruct.labelCells , classStruct.conditionCells, 'auto'); % LabelMap({'<','>','<+<','>+>','<+>','>+<'},{-2,-1,1,2,3,4}); 0 is autolabel
35)         calculateParams.classList       = getClasses(calculateParams.labelMap);
36)         calculateParams.eventList       = classStruct.eventMatrix; %[9,11,13; 10,12,14];
37) %         calculateParams.eventList       = getPSTEventMatrix(calculateParams.labelMap);
38)         
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

39)         subjectSelection = getSubjectIDString(paramModel);
40)         decode = struct;
41)         decode.decodePerformance = [];
42)         decode.rawTimeCourse     = [];
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

43)         
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

44)         for subjectCell = subjectSelection
45)             SubjectID = cell2mat(subjectCell);
Christoph Budziszewski new LabelMap new svm groupi...

Christoph Budziszewski authored 15 years ago

46)             namehelper = strcat('s',SubjectID); %Vars can not start with numbers.
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

47) 
Christoph Budziszewski new LabelMap new svm groupi...

Christoph Budziszewski authored 15 years ago

48)             display('loading SPM.mat ...');
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

49)             spm = load(fullfile(PROJECT_BASE_PATH,SubjectID,PROJECT_RESULT_PATH));
Christoph Budziszewski new LabelMap new svm groupi...

Christoph Budziszewski authored 15 years ago

50)             display('... done.');
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

51) 
52)             %% calculate
Christoph Budziszewski New5 Studie, Var-Name erset...

Christoph Budziszewski authored 15 years ago

53)             calculateParams.(namehelper).des             = spm.SPM;
54)             calculateParams.(namehelper).voxelList       = parseVoxelList(paramModel,SubjectID);
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

55)             assignin('base','calculateParams',calculateParams);
Christoph Budziszewski kleine änderungen code move

Christoph Budziszewski authored 15 years ago

56) 
57)             display(sprintf('calculating cross-validation performance time-shift for Subject %s. Please Wait. ...',SubjectID));
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

58)             display('switching off all warnings');
Christoph Budziszewski kleine änderungen code move

Christoph Budziszewski authored 15 years ago

59)             warning_state               = warning('off','all');
Christoph Budziszewski new LabelMap new svm groupi...

Christoph Budziszewski authored 15 years ago

60)             display('calculating ...');
Christoph Budziszewski kleine änderungen code move

Christoph Budziszewski authored 15 years ago

61)             decode.(namehelper)         = calculateDecodePerformance(calculateParams,SubjectID);
Christoph Budziszewski new LabelMap new svm groupi...

Christoph Budziszewski authored 15 years ago

62)             display('... done');
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

63)             display('restoring warnings');
64)             warning(warning_state);
65)             
Christoph Budziszewski kleine änderungen code move

Christoph Budziszewski authored 15 years ago

66)             decode.decodePerformance    = [decode.decodePerformance decode.(namehelper).decodePerformance];
67)             decode.rawTimeCourse        = [decode.rawTimeCourse decode.(namehelper).rawTimeCourse];
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

68) 
69)             assignin('base','decode',decode);
70)         end
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

71) 
72)         display('Finished calculations.');
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

73)         display('Plotting...');
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

74) 
Christoph Budziszewski kleine änderungen code move

Christoph Budziszewski authored 15 years ago

75)         plotParams                   = struct;
76)         plotParams.psthStart         = calculateParams.psthStart;
77)         plotParams.psthEnd           = calculateParams.psthEnd;
78)         plotParams.nClasses          = length(calculateParams.classList);
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

79)         
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

80)         plotParams.frameShiftStart   = calculateParams.frameShiftStart;
81)         plotParams.frameShiftEnd     = calculateParams.frameShiftEnd;
82)         plotParams.decodePerformance = decode.decodePerformance;
83)         plotParams.rawTimeCourse     = decode.rawTimeCourse;
84)         
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

85)         if numel(subjectSelection) == 1
86)           plotParams.SubjectID         = SubjectID;
87)         else
88)           plotParams.SubjectID         = 'Multiple';
89)         end
90) 
91)         plotParams.smoothed          = boolToYesNoString(calculateParams.smoothed);
92)          
93) 
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

94)         assignin('base','plotParams',plotParams);
95) %         plotDecodePerformance(params.psthStart,params.psthEnd,params.nClasses,decode.decodeTable,params.frameShiftStart,params.frameShiftEnd,decode.rawTimeCourse);
96)         plotDecodePerformance(plotParams);
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

97)             
Christoph Budziszewski new LabelMap new svm groupi...

Christoph Budziszewski authored 15 years ago

98)         display('all done.');
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

99)