git.schokokeks.org
Repositories
Help
Report an Issue
SVMCrossVal.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
ea0c5c0
Branches
Tags
master
SVMCrossVal.git
private
runCoordTable.m
new parseVoxelTxtField getImageFileList reads files according to gui-settings voxel to subject coordinate mapping missing.
Christoph Budziszewski
commited
ea0c5c0
at 2009-02-16 17:32:42
runCoordTable.m
Blame
History
Raw
function runCoordTable(timeline,varargin) paramModel = varargin{1}; global SVMCROSSVAL_CROSSVAL_METHOD_DEF; global SVMCROSSVAL_VOXEL_SELECTION_MODE_DEF; %PROJECT_BASE_PATH = 'D:\Analyze\Stimolos'; PROJECT_BASE_PATH = paramModel.baseDir; PROJECT_RESULT_PATH = 'results\SPM.mat'; % timeline params (claculate and plot) timelineParams = timeline; % timelineParams.frameShiftStart = getDouble(paramModel.txtFrameShiftStart); % -20; % timelineParams.frameShiftEnd = getDouble(paramModel.txtFrameShiftEnd); %15; % timelineParams.decodeDuration = getDouble(paramModel.txtFrameShiftDur); % timelineParams.psthStart = getDouble(paramModel.txtPSTHStart); % -25; % timelineParams.psthEnd = getDouble(paramModel.txtPSTHEnd); % 20; % timelineParams.baselineStart = getDouble(paramModel.txtBaselineStart); % -22; % timelineParams.baselineEnd = getDouble(paramModel.txtBaselineEnd); % -20; % % common params calculateParams = struct; % calculateParams.SVMCROSSVAL_CROSSVAL_METHOD_DEF = SVMCROSSVAL_CROSSVAL_METHOD_DEF; calculateParams.CROSSVAL_METHOD = SVMCROSSVAL_CROSSVAL_METHOD_DEF.svmcrossval; calculateParams.VOXEL_SELECTION_MODE = SVMCROSSVAL_VOXEL_SELECTION_MODE_DEF.roiImage; calculateParams.PROJECT_BASE_PATH = PROJECT_BASE_PATH; calculateParams.PROJECT_RESULT_PATH = PROJECT_RESULT_PATH; calculateParams.RANDOMIZE = 0; % calculateParams.smoothed = getChkValue(paramModel.chkSmoothed); % calculateParams.svmargs = get(paramModel.txtSVMopts,'String'); calculateParams.sessionList = 1:3; classStruct = parseClassDef(paramModel); % calculateParams.labelMap = LabelMap(classStruct.labelCells , classStruct.conditionCells, 'auto'); % LabelMap({'<','>','<+<','>+>','<+>','>+<'},{-2,-1,1,2,3,4}); 0 is autolabel % calculateParams.classList = getClasses(calculateParams.labelMap); calculateParams.eventList = classStruct.eventMatrix; %[9,11,13; 10,12,14]; % calculateParams.eventList = getPSTEventMatrix(calculateParams.labelMap); subjectSelection = {'JZ006'}; %getSubjectIDString(paramModel); calculateParams.subjectSelection = subjectSelection; decode = claculateMultiSubjectDecodePerformance(timelineParams,calculateParams,paramModel); display('Finished calculations.'); display('Plotting...'); plotParams = struct; % plotParams.SVMCROSSVAL_CROSSVAL_METHOD_DEF = SVMCROSSVAL_CROSSVAL_METHOD_DEF; plotParams.CROSSVAL_METHOD = calculateParams.CROSSVAL_METHOD; plotParams.nClasses = length(calculateParams.classList); plotParams.decodePerformance = decode.decodePerformance; plotParams.rawTimeCourse = decode.rawTimeCourse; plotParams.SubjectID = subjectSelection; plotParams.smoothed = boolToYesNoString(calculateParams.smoothed); assignin('base','plotParams',plotParams); % plotDecodePerformance(params.psthStart,params.psthEnd,params.nClasses,decode.decodeTable,params.frameShiftStart,params.frameShiftEnd,decode.rawTimeCourse); plotDecodePerformance(timelineParams,plotParams); display('all done.'); end %% subject loop function decode = claculateMultiSubjectDecodePerformance(timelineParams,calculateParams,paramModel) decode = struct; decode.decodePerformance = []; decode.rawTimeCourse = []; for subjectCell = calculateParams.subjectSelection SubjectID = cell2mat(subjectCell); namehelper = strcat('s',SubjectID); %Vars can not start with numbers. display('loading SPM.mat ...'); spm = load(fullfile(calculateParams.PROJECT_BASE_PATH,SubjectID,calculateParams.PROJECT_RESULT_PATH)); display('... done.'); % per subject params.. subjectParams = struct; subjectParams.des = spm.SPM; subjectParams.voxelList = mapVoxelList(voxelList,SubjectID); subjectParams.SubjectID = SubjectID; subjectParams.namehelper = namehelper; % assignin('base','calculateParams',calculateParams); display(sprintf('calculating cross-validation performance time-shift for Subject %s. Please Wait. ...',SubjectID)); display('switching off all warnings'); warning_state = warning('off','all'); display('calculating ...'); decode.(namehelper) = calculateDecodePerformance(timelineParams,calculateParams,subjectParams); display('... done'); display('restoring warnings'); warning(warning_state); decode.decodePerformance = [decode.decodePerformance decode.(namehelper).decodePerformance]; decode.rawTimeCourse = [decode.rawTimeCourse decode.(namehelper).rawTimeCourse]; assignin('base','decode',decode); end end