Skip to content

Commit 0380b6b

Browse files
committed
ENH - MEEG: report IC classification
1 parent 80a206d commit 0380b6b

1 file changed

Lines changed: 18 additions & 3 deletions

File tree

aa_modules/aamod_meeg_icclassification.m

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,28 @@
44

55
switch task
66
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+
717
for fnames = cellstr(spm_select('FPList',aas_getsesspath(aap,subj,sess),['^diagnostic_' mfilename '_[0-9]*.jpg$']))'
818
aap = aas_report_addimage(aap,subj,fnames{1});
919
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);
1227
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$']))'
1429
if ~isempty(fn{1}), aap=aas_report_addimage(aap,subj,fn{1}); end
1530
end
1631
aap = aas_report_add(aap,subj,'</td>');

0 commit comments

Comments
 (0)