Home > marsbar > @mardo_2 > block_rows.m

block_rows

PURPOSE ^

returns cell array of rows for each (subject/session) block

SYNOPSIS ^

function rows = block_rows(D)

DESCRIPTION ^

 returns cell array of rows for each (subject/session) block

 $Id$

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

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

Generated on Thu 17-Mar-2016 01:14:46 by m2html © 2005