|
4 | 4 |
|
5 | 5 | switch task |
6 | 6 | case 'report' |
| 7 | + SFX = {'accepted','rejected'}; |
| 8 | + |
| 9 | + % init summary |
| 10 | + % - first session |
| 11 | + if ~isfield(aap.report, aap.tasklist.currenttask.name) |
| 12 | + for indSfx = 1:numel(SFX) |
| 13 | + aap.report.(aap.tasklist.currenttask.name).(SFX{indSfx}) = NaN(aas_getN_bydomain(aap,'subject'),numel(aap.acq_details.meeg_sessions)); |
| 14 | + end |
| 15 | + end |
| 16 | + |
7 | 17 | for fnames = cellstr(spm_select('FPList',aas_getsesspath(aap,subj,sess),['^diagnostic_' mfilename '_[0-9]*.jpg$']))' |
8 | 18 | aap = aas_report_addimage(aap,subj,fnames{1}); |
9 | 19 | end |
10 | | - aap = aas_report_add(aap,subj,'<table><tr><th>Accepted</th><th>Rejected</th></tr><tr>'); |
11 | | - for sfx = {'accepted','rejected'} |
| 20 | + nIC = cellfun(@(sfx) size(spm_select('FPList',aas_getsesspath(aap,subj,sess),['^diagnostic_.*' sfx '.*jpg$']),1)/2, SFX); |
| 21 | + aap = aas_report_add(aap,subj,sprintf('<th>%c%s: %d</th>',... |
| 22 | + upper(SFX{1}(1)), SFX{1}(2:end), nIC(1),... |
| 23 | + upper(SFX{2}(1)), SFX{2}(2:end), nIC(2)... |
| 24 | + )); |
| 25 | + for indSfx = 1:numel(SFX) |
| 26 | + aap.report.(aap.tasklist.currenttask.name).(SFX{indSfx})(subj,sess) = nIC(indSfx); |
12 | 27 | aap = aas_report_add(aap,subj,'<td valign="top">'); |
13 | | - for fn = cellstr(spm_select('FPList',aas_getsesspath(aap,subj,sess),['^diagnostic_.*' sfx{1} '.*jpg$']))' |
| 28 | + for fn = cellstr(spm_select('FPList',aas_getsesspath(aap,subj,sess),['^diagnostic_.*' SFX{indSfx} '.*jpg$']))' |
14 | 29 | if ~isempty(fn{1}), aap=aas_report_addimage(aap,subj,fn{1}); end |
15 | 30 | end |
16 | 31 | aap = aas_report_add(aap,subj,'</td>'); |
|
0 commit comments