0001 function spike_report(info, outdata_root)
0002
0003
0004
0005
0006
0007
0008
0009
0010 if nargin < 1
0011 error('No spike info structure present: run SPIKE_CHECK first')
0012 end
0013
0014 if nargin < 2
0015 outdata_root = './';
0016 end
0017
0018 fname = fullfile(outdata_root,sprintf('spikereport_%s_%s.ps', datestr(datenum(now),1), datestr(datenum(now),15)));
0019
0020 for isub = 1:length(info)
0021 if any(info(isub).numbad)
0022 disp(sprintf('\nSPIKE WARNING: Subject %s', info(isub).id))
0023 nrun = length(info(isub).run);
0024 figure(1), clf
0025 for irun = 1:nrun
0026 if info(isub).numbad(irun)
0027 disp(sprintf('\tRun %d: %d spikes', irun, info(isub).numbad(irun)))
0028 end
0029
0030 subplot(nrun,1,irun)
0031 plot(info(isub).data{irun})
0032 bi = info(isub).badidx{irun};
0033 hold on
0034 scatter(bi, ones(size(bi))*info(isub).mean(irun)+3*info(isub).std(irun),'*')
0035
0036 if irun == nrun
0037 ylabel('Signal intensity')
0038 xlabel('Volume #')
0039 end
0040
0041 title(sprintf('Subject: %s, Exam: %s, Series: %s, Overall EPI run: %d', info(isub).id, info(isub).exam{irun}, info(isub).series{irun}, irun))
0042 end
0043
0044 print(gcf,'-dps','-append',fname)
0045
0046 end
0047 end