function runCoordTable(args) disp('run coord table') subjects = args.subjects; nSubjects = size(subjects); sessionlist = args.sessionList; for s = 1:nSubjects subjectStruct{s}.dir = fullfile(args.basedir,cell2mat(subjects(s))); d = load(fullfile(subjectStruct{s}.dir,'results','SPM.mat')); subjectStruct{s}.des = d.SPM; subjectStruct{s}.name = cell2mat(subjects(s)); map = load(fullfile(subjectStruct{s}.dir,'results','roi','coord_map.mat')); subjectStruct{s}.coords = getSubjectCoordinates(args.coords,map); nVoxel = size(subjectStruct{s}.coords,1); disp('fetching volume definitions, please wait'); subjectStruct{s}.volumes = spm_vol(getImageFileList(subjectStruct{s}.dir,sessionlist,args.mask)); extr = calculateImageData(subjectStruct{s}.volumes,subjectStruct{s}.coords); pstopts.des = subjectStruct{s}.des; pstopts.eventList = args.eventList; pstopts.sessionList = sessionlist; disp('computing psth'); for iVoxel = 1:nVoxel rawdata = []; for iImage = 1:length(extr); tmp = extr(iImage); rawdata = [rawdata tmp.dat(iVoxel)]; end subjectStruct{s}.pst{iVoxel} = calculatePST(args.timeline,pstopts,rawdata); end disp(sprintf('done %g // %g',s,nSubjects)); end assignin('base','subjectStruct',subjectStruct); end % % % 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.'); %