38be2ad51981d49eadb9c563708d99f27c2c9186
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 16 years ago

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

Christoph Budziszewski authored 16 years ago

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

Christoph Budziszewski authored 15 years ago

classify.m   3) 
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

classify.m   4) 
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 16 years ago

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

Axel Lindner authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 16 years ago

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

Christoph Budziszewski authored 16 years ago

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

Christoph Budziszewski authored 16 years ago

classify.m  15)         
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

classify.m  16)         % common params
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 16 years ago

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

Christoph Budziszewski authored 16 years ago

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

Christoph Budziszewski authored 15 years ago

classify.m  19) 
Christoph Budziszewski GUI parsing halfway done.

Christoph Budziszewski authored 16 years ago

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

Christoph Budziszewski authored 16 years ago

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

Christoph Budziszewski authored 16 years ago

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

Christoph Budziszewski authored 16 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 16 years ago

classify.m  43)         
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

classify.m  56) 
classify.m  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

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 16 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 16 years ago

classify.m  74) 
Christoph Budziszewski kleine änderungen code move

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

classify.m  79)         
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 16 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 16 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 16 years ago

classify.m  99)