Sorry, but I made a mistake. The correct code is:
regname = {'x'; 'y'; 'z'; 'pitch'; 'roll'; 'yaw'};
for i=1:6
jobs{1}.stats{1}.fmri_spec.sess(sess_num).regress(i).name =...
regname(i);
jobs{1}.stats{1}.fmri_spec.sess(sess_num).regress(i).val = ...
mot(:,i);
end
(the curly brackets in line 4 have been replaced by normal brackets, in
order to assign a cell-string rather than a string....)
Thilo
-------- Forwarded Message --------
From: Thilo Kellermann <[log in to unmask]>
Reply-to: [log in to unmask]
To: Yune Lee <[log in to unmask]>
Cc: [log in to unmask]
Subject: Re: [SPM] Is a regressor not shown in the design matrix?
Date: Wed, 27 Jan 2010 22:00:09 +0100
Dear Yune,
the field "regress" is not a cell-array but a structure-array with the
fields "name" and "val". The easiest way to include multiple covariates
in the design is to use the field "multi_reg" instead and put the name
of a textfile containing the realignment-parameters.
If you prefer to use a matlab variable then you would have to write
something like the following for each session:
regname = {'x'; 'y'; 'z'; 'pitch'; 'roll'; 'yaw'};
for i=1:6
jobs{1}.stats{1}.fmri_spec.sess(sess_num).regress(i).name =...
regname{i};
jobs{1}.stats{1}.fmri_spec.sess(sess_num).regress(i).val = ...
mot(:,i);
end
Here I assume that "mot" is an nscan (244 in your case I guess) by 6
matrix with the six parameters for each scan in the respective session.
Hope this helps,
Thilo
On Wed, 2010-01-27 at 15:07 -0500, Yune Lee wrote:
>
> Dear SPM users,
> I'm putting the motion parameter of each run as a regressor using a
> batch script as below.
>
> %For regress (motion parameter)
> jobs{1}.stats{1}.fmri_spec.sess(sess_num).regress{1} =
> 'mparams';
> jobs{1}.stats{1}.fmri_spec.sess(sess_num).regress{2}=
> mot(:,sess_num); % 244 motion parameters per each run are stored
> here.
>
>
> But after the GLM, I don't see the additional coloumns of mparams that
> I put in the regress in the design matrix.
> Are they supposed to be sitting next to the last condition (e..g,
> Sn(1)catch*bf(1) see the enclosed design matrix) or they don't show up
> in the design matrix?
> Any comments would be greatly appreciated.
>
> Thanks,
> YSL
>
>
>
>
>
|