returns cell array of rows for each (subject/session) block $Id$
0001 function rows = block_rows(D) 0002 % returns cell array of rows for each (subject/session) block 0003 % 0004 % $Id$ 0005 0006 SPM = des_struct(D); 0007 if strcmp(modality(D), 'fmri') 0008 Sess = SPM.Sess; 0009 for i = 1:length(Sess) 0010 rows{i} = Sess{i}.row; 0011 end 0012 else % PET I guess 0013 xX = SPM.xX; 0014 if ~isfield(xX, 'I') 0015 error('Expecting I field in SPM design'); 0016 end 0017 scol = xX.I(:, 3); % the subject column 0018 subjnos = unique(scol); 0019 for s = 1:length(subjnos); 0020 rows{s} = find(scol == subjnos(s)); 0021 end 0022 end