Print

Print


An alternative approach to writing a script would be to use the createVec.m file in the gPPI toolbox (http://www.nitrc.org/projects/gppi). This m-file can generate the correct contrasts accounting for the differential regressors per run. The script builds the contrast based on the column names.

You could write a wrapper around createVec and the lines of code necessary to write out the contrasts to do this for all subjects. Examples of the lines can be found in spm_contrasts_ppi.m (also in the gPPI toolbox).


Best Regards, Donald McLaren
=================
D.G. McLaren, Ph.D.
Research Fellow, Department of Neurology, Massachusetts General Hospital and
Harvard Medical School
Postdoctoral Research Fellow, GRECC, Bedford VA
Website: http://www.martinos.org/~mclaren
Office: (773) 406-2464
=====================
This e-mail contains CONFIDENTIAL INFORMATION which may contain PROTECTED
HEALTHCARE INFORMATION and may also be LEGALLY PRIVILEGED and which is
intended only for the use of the individual or entity named above. If the
reader of the e-mail is not the intended recipient or the employee or agent
responsible for delivering it to the intended recipient, you are hereby
notified that you are in possession of confidential and privileged
information. Any unauthorized use, disclosure, copying or the taking of any
action in reliance on the contents of this information is strictly
prohibited and may be unlawful. If you have received this e-mail
unintentionally, please immediately notify the sender via telephone at (773)
406-2464 or email.

On Fri, Apr 24, 2015 at 10:47 AM, Guillaume Flandin <[log in to unmask]> wrote:
Dear Elias,

I can think of three ways to generate the contrast weights in your
situation:

1/ write a script that will take care of the different number of
regressors per session

2/ use an option of the batch interface, thanks to Volkmar:
  SPM > Stats > Contrast Manager
        Contrast Sessions > T-contrasts (con/sess based)

3/ regress out covariates without including them explicitly in the
design matrix, as you hinted. To do so, specify your GLM in the usual
way without the movement regressors, then:
  load SPM.mat
  for s=1:numel(SPM.xX.K)
     SPM.xX.K(s).X0 = [SPM.xX.K(s).X0 detrend(mvt_sess_s)];
  end
  save SPM.mat SPM
and specify your contrasts without having to worry about the number of
covariates you included per session (and double check I don't overlook
anything).

Best regards,
Guillaume.


On 23/04/15 12:55, Elias Mouchlianitis wrote:
> Dear SPM experts,
>
> I have a phMRI with 6 sessions for each subject, within a 3x2 design (3 drugs x 2 task levels), with each session representing a factorial level.  As you might understand the 1st-level design matrix becomes quite complicated when including regressors for the motion parameters and columns from a confound matrix that regresses out outlying volumes as computed with DVARS. The issue is that since each subject has different number of outlier volumes, there is no consistency across subjects when defining contrasts and zero padding for the outlier columns differs both across sessions and subjects  This is doable with a bit of matlab but i was hoping there is a simpler way (or maybe I am missing something obvious...)
>
> I was wondering whether there is a way to implicitly model movement regressors, outlier scans (or other regressors) without actually including them in the design matrix, similar with how FSL for example outputs the design matrix only for EVs.
>
> It would be great if anyone can point to a way to do this either within SPM or with a utility/toolbox.
>
> If not, maybe it is something that SPM developers should think including in future releases? with phMRI and other similar experimental and methodological advances, designs can become quite intricate, at least in my mind it would be most beneficial if one was given the option to model regressors explicitly or implicitly in the design matrix.
>
> Many thanks,
>
> Elias
>
>
>
> .
>

--
Guillaume Flandin, PhD
Wellcome Trust Centre for Neuroimaging
University College London
12 Queen Square
London WC1N 3BG