Hi Ainat,
looks like the original experiment
has 2 runs, 2 conditions and 6 motion regressors for each run. Then SPM adds
a constant run regressor for each totaling 18 columns for SPM.xX.X.
depending on how many runs you have and conditions you'll have to change
the values. Say you have 5 runs, 4 conditions, and 6 motion regressors
for each.
for sess=1:5
sessdm=SPM.xX.X(:,(sess-1)*(4+6) + [1:(4+6)]);
sesscc=corrcoef(sessdm);
for r=1:4, % conditions
for m=5:10, % motion params
Hope that helps,
Pete
> I am trying to figure out how to detect a motion
> that is related to the stimulation. I have a code that was
> written by somebody else, and
> would like to know how can it be adopted to our experiment.
> This code works for SPM.xX.X = 18.
> In our experiment: SPM.xX.X=50. What should be the values of sess, r, and m?
> (I do not understand why r iterates from 1 to 2 and m from 3 to 8 and what
> are they related to?)
>
> We are using spm2 for fmri.
>
> for sess=1:2
> sessdm=SPM.xX.X(:,(sess-1)*8 + [1:8]);
> sesscc=corrcoef(sessdm);
> for r=1:2,
> for m=3:8,
> if abs(sesscc(r,m))>THRESH
> fprintf(fid2, 'sess %d, cond %d, motion reg %d: r =
> %0.2f\n',
> sess,r,m,sesscc(r,m)); % this should be printing the results into
> stim_motion.tx
> t
> end;
> end;
> end;
>
>
> Thank you - Ainat
>
>
>
|