function runCoordTable(args) global SVMCROSSVAL_SUBJECTSTRUCT_NAME; 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',SVMCROSSVAL_SUBJECTSTRUCT_NAME,subjectStruct); end