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 rows = {Sess(:).row}; 0010 else % PET I guess 0011 xX = SPM.xX; 0012 if ~isfield(xX, 'I') 0013 error('Expecting I field in SPM design'); 0014 end 0015 scol = xX.I(:, 3); % the subject column 0016 subjnos = unique(scol); 0017 for s = 1:length(subjnos); 0018 rows{s} = find(scol == subjnos(s)); 0019 end 0020 end