Hi everybody,
I try to read the SPM.mat file information for some permutation correction algorithm, that means I want to extract the information which file is used for which subject and which condition. In specific, I start with a evaluated 2nd Level ANOVA within subject. The field SPM.xVi.I supplies the information on subject and condition as shown in the design matrix easy enough, however when i look for the file names available at SPM.xY.P or SPM.xY.VY.fname they are ordered alphabetically, not as shown in the design matrix (see a simple example below). I was expecting to find some index vector encoding the order the files are used in the design matrix, but I cannot find one. The information must be somewhere I just cannot find it. Has anybody got an idea where to look? I'd greatly appreciate any help on that!
In an simple example, testing two subjects with two contrast names con0001_subj0001.nii to con0002_subj0002.nii the 2nd level design matrix looks somewhat like this (and is given in SPM.xVi.I in the same way)
cond subject file
1 1 con0001_subj0001.nii
2 1 con0002_subj0001.nii
1 2 con0001_subj0002.nii
2 2 con0002_subj0002.nii
However the list of files found in SPM.xY.P would be
con0001_subj0001.nii
con0001_subj0002.nii
con0002_subj0001.nii
con0002_subj0002.nii
|