Home > marsbar > @mardo_99 > 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   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

Generated on Wed 11-May-2022 16:26:09 by m2html © 2003-2019