Print

Print


Dear SPMers,
I attach below a batch script that can be taken as an example for the
specification of parametric modulation designs. I hope it can help
someone.
Many thanks to all the people that have helped me to fix the
several bugs in the script!
Greetings,

Marco Tettamanti
Istituto Scientifico San Raffaele
Reparto Medicina Nucleare
Via Olgettina 60
I-20132 Milano
Italy
Tel. 0039 - 02 - 26 42 34 60
Fax: 0039 - 02 - 21 71 75 58
email: [log in to unmask]

%---------------------------------------------------------------
% user variables defined here
%---------------------------------------------------------------
F1 = spm_get('files','/directory1','sn*.img');
F2 = spm_get('files','/directory2','sn*.img');

%---------------------------------------------------------------
% batch variables defined here for analysis 'model'
%---------------------------------------------------------------

model(1) = struct( ...
 'types',          4, ...
 'global_effects', {'Scaling'}, ...
 'burst_mode',     0, ...
 'HF_fil',         'specify',  ...
 'HF_cut',         [150 168], ...
 'LF_fil',         'hrf', ...
 'LF_cut',         4, ...
 'int_corr',       'none', ...
 'now_later',      1, ...
 'stop_writing',   0, ...
 'trial_fcon',     1, ...
 'RT',             3, ...
 'replicated',     0, ...
 'nsess',          2, ...
 'nscans',         [202 202], ...
 'files',          {{F1,F2}}, ...
 'conditions_nb',  [4 4], ...
 'conditions',     [1 2], ...
 'regressors_nb',  [0 0], ...
 'regressors',     [], ...
 'parametrics_type', {{'other','other'}}, ...
 'parametrics',    [1 2], ...
 'stochastics_flag', [0 0], ...
 'stochastics',    []);

%-------------------------------------------

conditions(1) = struct( ...
 'names',   {{'RL1','JL1','RLS','JLS'}}, ...
 'onsets',  {{[106 131 156 181],[118 143 168 193],[2 27 52 80],[14 39 64
92]}}, ...
 'types',    {{'epochs','epochs','epochs','epochs'}}, ...
 'bf_ev',   [], ...
 'bf_ep',   [1 1 1 1], ...
 'volterra',  0, ...
 'variable_dur', 0);

conditions(2) = conditions(1);
conditions(2).onsets = {[2 27 52 77],[14 39 64 89],[103 128 153 181],[115
140 165 193]};

%-------------------------------------------

bf_ep(1) = struct( ...
  'ep_type', 4, ...
  'length',10, ...
  'conv',  1, ...
  'deriv', 0);

%----------------------------------------

parametrics(1) = struct( ...
 'name',       {'behav'}, ...
 'exp_type',   {'linear'}, ...
 'trials',     {[1 2 3 4]}, ...
 'parameters', {{[1396 1712 1384 2097],[7 7 7 8],[2983 2008 1468 1547],[7
8 8 7]}});

parametrics(2) = parametrics(1);
parametrics(2).parameters = {[1551 1629 2002 1550],[8 8 8 7],[1915 1976
1314 1522],[7 8 7 7]};