07662323fba6e78914c6c57228dd116276b8a9ca
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

classify.m           2) 
Christoph Budziszewski using global variables now....

Christoph Budziszewski authored 15 years ago

private/classify.m   3) global CROSSVAL_METHOD_DEF;
Christoph Budziszewski refactored to arg-structs!...

Christoph Budziszewski authored 15 years ago

private/classify.m   4) global VOXEL_SELECTION_MODE_DEF;
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

private/classify.m   5) 
Christoph Budziszewski gui layout finished

Christoph Budziszewski authored 15 years ago

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

Axel Lindner authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

classify.m          14) end
Christoph Budziszewski subject loop is function

Christoph Budziszewski authored 15 years ago

private/classify.m  15) 
private/classify.m  16)         % timeline params (claculate and plot)
private/classify.m  17)         timelineParams = struct;
private/classify.m  18)         
private/classify.m  19)         timelineParams.frameShiftStart = getDouble(paramModel.txtFrameShiftStart);  % -20;
private/classify.m  20)         timelineParams.frameShiftEnd   = getDouble(paramModel.txtFrameShiftEnd); %15;
private/classify.m  21)         timelineParams.decodeDuration  = getDouble(paramModel.txtFrameShiftDur);
private/classify.m  22)         timelineParams.psthStart       = getDouble(paramModel.txtPSTHStart); % -25;
private/classify.m  23)         timelineParams.psthEnd         = getDouble(paramModel.txtPSTHEnd); % 20;
private/classify.m  24)         timelineParams.baselineStart   = getDouble(paramModel.txtBaselineStart); % -22;
private/classify.m  25)         timelineParams.baselineEnd     = getDouble(paramModel.txtBaselineEnd); % -20;       
Christoph Budziszewski added 2nd classification me...

Christoph Budziszewski authored 15 years ago

private/classify.m  26)        
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

classify.m          28)         calculateParams  = struct;
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

private/classify.m  29)         
Christoph Budziszewski using global variables now....

Christoph Budziszewski authored 15 years ago

private/classify.m  30) %         calculateParams.CROSSVAL_METHOD_DEF = CROSSVAL_METHOD_DEF;
Christoph Budziszewski refactored to arg-structs!...

Christoph Budziszewski authored 15 years ago

private/classify.m  31)         calculateParams.CROSSVAL_METHOD      = CROSSVAL_METHOD_DEF.svmcrossval;
private/classify.m  32)         calculateParams.VOXEL_SELECTION_MODE = VOXEL_SELECTION_MODE_DEF.roiImage;
private/classify.m  33)         calculateParams.PROJECT_BASE_PATH    = PROJECT_BASE_PATH;
private/classify.m  34)         calculateParams.PROJECT_RESULT_PATH  = PROJECT_RESULT_PATH;
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

private/classify.m  35)         
private/classify.m  36)         calculateParams.RANDOMIZE       = 0;
private/classify.m  37)         
Christoph Budziszewski added 2nd classification me...

Christoph Budziszewski authored 15 years ago

private/classify.m  38)         calculateParams.smoothed        = getChkValue(paramModel.chkSmoothed);
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

classify.m          40)         calculateParams.svmargs         = get(paramModel.txtSVMopts,'String');
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

classify.m          43)         classStruct = parseClassDef(paramModel);
classify.m          44)         
classify.m          45)         
Christoph Budziszewski new LabelMap new svm groupi...

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

classify.m          51)         subjectSelection = getSubjectIDString(paramModel);
Christoph Budziszewski subject loop is function

Christoph Budziszewski authored 15 years ago

private/classify.m  52)         calculateParams.subjectSelection = subjectSelection;
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

classify.m          53)         
Christoph Budziszewski subject loop is function

Christoph Budziszewski authored 15 years ago

private/classify.m  54)         decode = claculateMultiSubjectDecodePerformance(timelineParams,calculateParams);
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

classify.m          59)         plotParams                   = struct;
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

private/classify.m  60)         
Christoph Budziszewski using global variables now....

Christoph Budziszewski authored 15 years ago

private/classify.m  61) %         plotParams.CROSSVAL_METHOD_DEF = CROSSVAL_METHOD_DEF;
Christoph Budziszewski transport changes

Christoph Budziszewski authored 15 years ago

private/classify.m  62)         plotParams.CROSSVAL_METHOD     = calculateParams.CROSSVAL_METHOD;
private/classify.m  63)         
Christoph Budziszewski kleine änderungen code move

Christoph Budziszewski authored 15 years ago

classify.m          64)         plotParams.nClasses          = length(calculateParams.classList);
Christoph Budziszewski subject loop is function

Christoph Budziszewski authored 15 years ago

private/classify.m  65) 
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

classify.m          66)         plotParams.decodePerformance = decode.decodePerformance;
classify.m          67)         plotParams.rawTimeCourse     = decode.rawTimeCourse;
Christoph Budziszewski subject loop is function

Christoph Budziszewski authored 15 years ago

private/classify.m  68)         plotParams.SubjectID         = subjectSelection;
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

classify.m          69)         plotParams.smoothed          = boolToYesNoString(calculateParams.smoothed);
classify.m          70) 
Christoph Budziszewski SVMCrossVal toolbox init

Christoph Budziszewski authored 15 years ago

classify.m          71)         assignin('base','plotParams',plotParams);
classify.m          72) %         plotDecodePerformance(params.psthStart,params.psthEnd,params.nClasses,decode.decodeTable,params.frameShiftStart,params.frameShiftEnd,decode.rawTimeCourse);
Christoph Budziszewski subject loop is function

Christoph Budziszewski authored 15 years ago

private/classify.m  73)         plotDecodePerformance(timelineParams,plotParams);
Christoph Budziszewski multi-subject support

Christoph Budziszewski authored 15 years ago

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

Christoph Budziszewski authored 15 years ago

classify.m          75)         display('all done.');
Christoph Budziszewski subject loop is function

Christoph Budziszewski authored 15 years ago

private/classify.m  76) end
private/classify.m  77)     
private/classify.m  78) 
private/classify.m  79) %% subject loop
private/classify.m  80) function decode = claculateMultiSubjectDecodePerformance(timelineParams,calculateParams)
Christoph Budziszewski refactored to arg-structs!...

Christoph Budziszewski authored 15 years ago

private/classify.m  81) global VOXEL_SELECTION_MODE_DEF;
private/classify.m  82) 
Christoph Budziszewski subject loop is function

Christoph Budziszewski authored 15 years ago

private/classify.m  83) decode = struct;
private/classify.m  84) decode.decodePerformance = [];
private/classify.m  85) decode.rawTimeCourse     = [];
private/classify.m  86) 
Christoph Budziszewski refactored to arg-structs!...

Christoph Budziszewski authored 15 years ago

private/classify.m  87) for subjectCell = calculateParams.subjectSelection
Christoph Budziszewski subject loop is function

Christoph Budziszewski authored 15 years ago

private/classify.m  88)     SubjectID = cell2mat(subjectCell);
private/classify.m  89)     namehelper = strcat('s',SubjectID); %Vars can not start with numbers.
private/classify.m  90) 
private/classify.m  91)     display('loading SPM.mat ...');
private/classify.m  92)     spm = load(fullfile(calculateParams.PROJECT_BASE_PATH,SubjectID,calculateParams.PROJECT_RESULT_PATH));
private/classify.m  93)     display('... done.');
private/classify.m  94) 
Christoph Budziszewski refactored to arg-structs!...

Christoph Budziszewski authored 15 years ago

private/classify.m  95)     % per subject params..
private/classify.m  96)     subjectParams = struct;
private/classify.m  97)     
private/classify.m  98)     subjectParams.des             = spm.SPM;
Christoph Budziszewski heavy CrossVal Toolbox deve...

Christoph Budziszewski authored 15 years ago

private/classify.m  99)     smoothed = calculateParams.smoothed;
private/classify.m 100)     
private/classify.m 101)     DataImageFilenames      = getImageFileList(des,~smoothed);
private/classify.m 102)     subjectParams.voxelList = getTransformedCoordinates(...
private/classify.m 103)         calculateParams.VOXEL_SELECTION_MODE,
private/classify.m 104)         
Christoph Budziszewski refactored to arg-structs!...

Christoph Budziszewski authored 15 years ago

private/classify.m 105)     switch calculateParams.VOXEL_SELECTION_MODE 
private/classify.m 106)         case VOXEL_SELECTION_MODE_DEF.manualGui
Christoph Budziszewski heavy CrossVal Toolbox deve...

Christoph Budziszewski authored 15 years ago

private/classify.m 107)             parsedVoxelList          = parseVoxelList(paramModel,SubjectID);
private/classify.m 108)               = transformVoxelList(parsedVoxelList);
private/classify.m 109)             
Christoph Budziszewski refactored to arg-structs!...

Christoph Budziszewski authored 15 years ago

private/classify.m 110)             
private/classify.m 111)         case VOXEL_SELECTION_MODE_DEF.roiImage
Christoph Budziszewski heavy CrossVal Toolbox deve...

Christoph Budziszewski authored 15 years ago

private/classify.m 112)             subjectParams.voxelList       = readRoiImage(); % image for subject!
Christoph Budziszewski refactored to arg-structs!...

Christoph Budziszewski authored 15 years ago

private/classify.m 113)     end
private/classify.m 114)     
private/classify.m 115)     
private/classify.m 116)     subjectParams.SubjectID       = SubjectID;
private/classify.m 117)     subjectParams.namehelper      = namehelper;
private/classify.m 118) %     assignin('base','calculateParams',calculateParams);
Christoph Budziszewski subject loop is function

Christoph Budziszewski authored 15 years ago

private/classify.m 119) 
private/classify.m 120)     display(sprintf('calculating cross-validation performance time-shift for Subject %s. Please Wait. ...',SubjectID));
private/classify.m 121)     display('switching off all warnings');
private/classify.m 122)     warning_state               = warning('off','all');
private/classify.m 123)     display('calculating ...');
Christoph Budziszewski refactored to arg-structs!...

Christoph Budziszewski authored 15 years ago

private/classify.m 124)     decode.(namehelper)         = calculateDecodePerformance(timelineParams,calculateParams,subjectParams);
Christoph Budziszewski subject loop is function

Christoph Budziszewski authored 15 years ago

private/classify.m 125) 
private/classify.m 126)     display('... done');
private/classify.m 127)     display('restoring warnings');
private/classify.m 128)     warning(warning_state);
private/classify.m 129) 
private/classify.m 130)     decode.decodePerformance    = [decode.decodePerformance decode.(namehelper).decodePerformance];
private/classify.m 131)     decode.rawTimeCourse        = [decode.rawTimeCourse decode.(namehelper).rawTimeCourse];
private/classify.m 132) 
private/classify.m 133)     assignin('base','decode',decode);
private/classify.m 134) end
private/classify.m 135)