function outputStruct = calculateDecodePerformance(timeline,subjectStruct,model) outputStruct = struct; RANDOMIZE_DATAPOINTS = 0; eventList = inputStruct.eventList; timeLineStart = timeline.frameShiftStart; timeLineEnd = timeline.frameShiftEnd; % for iVoxel = 1:nVoxel % rawdata = []; % for iImage = 1:length(extr); % tmp = extr(iImage); % rawdata = [rawdata tmp.dat(iVoxel)]; % end % pst{iVoxel} = calculatePST(timeline,calculatePstOpts,rawdata); % end timePointArgs.pst = pst; timePointArgs.labelMap = inputStruct.labelMap; timePointArgs.eventList = eventList; timePointMatrix = buildTimePointMatrix(timeline,timePointArgs); decodePerformance = []; for index = 1:timeLineEnd-timeLineStart+1 svmdata = timePointMatrix{index}(:,2:size(timePointMatrix{index},2)); svmlabel = timePointMatrix{index}(:,1); if RANDOMIZE_DATAPOINTS rndindex = randperm(length(svmlabel)); svmdata = svmdata(rndindex,:); svmlabel = svmlabel(rndindex); end decodePerformance = [decodePerformance; svm_single_crossval(svmlabel,svmdata,svmopts)]; end outputStruct.decodePerformance = decodePerformance; outputStruct.svmdata = svmdata; outputStruct.svmlabel = svmlabel; outputStruct.rawTimeCourse = pst; outputStruct.minPerformance = minPerformance; outputStruct.maxPerformance = maxPerformance; end