Dear Edward,
the general idea is to use the graphical user interface to create a
template of the job you want to run, save it as a MAT-file (or a script
M-file) edit the fields that you want to change, and save/run it again.
There is an easy-to-guess one-to-one mapping between the jobs structure
fields and the fields in the SPM job manager interface.
For example, if you want to change the source image files of a
"normalise: estimate" job, it will be something like:
jobs{1}.spatial{1}.normalise{1}.est.subj(1).source = ...
cellstr('/path/to/anat_subj1.img');
jobs{1}.spatial{1}.normalise{1}.est.subj(2).source = ...
cellstr('/path/to/anat_subj2.img');
Idem for the template file:
jobs{1}.spatial{1}.normalise{1}.est.eoptions.template = ...
cellstr(fullfile(spm('Dir'),'templates','T1.nii'));
If you are doing VBM, you might want to have a look at the Unified
Segmentation algorithm:
spm('Defaults','fMRI');
clear jobs
jobs{1}.spatial{1}.preproc.data = cellstr('/path/to/anat.img');
spm_jobman('interactive',jobs); % to display the job in the interface
spm_jobman('run',jobs);
At last, concerning second level model specification, this is again the
same principle. For a one-sample T-test, the field storing the input
images is:
jobs{1}.stats{1}.factorial_design.des.t1.scans
You will find some examples in this batch script:
http://www.fil.ion.ucl.ac.uk/spm/data/face_rfx/face_rfx_spm5_batch.m
All the best,
Guillaume.
Hui, Edward SK wrote:
> Dear Dr. Flandin,
>
> I am sorry to interrupt. I am working on VBM and use SPM5 to perform
> normalisation and etc. I am just wondering what variable in "job" should
> I modify to add it more source image files or change the source file
> image file and template file? Similar question also goes for images for
> statistical analysis in 2nd level specification.
>
> Many thanks indeed and best regards,
> Edward
>
>
> On Thu, Jun 19, 2008 at 01:08, Guillaume Flandin
> <[log in to unmask] <mailto:[log in to unmask]>> wrote:
>
> Dear Tao,
>
> There is no "Multiple Contrasts" option like with "Multiple
> Conditions" or "Multiple Regressors" but this can easily be done
> with a script:
>
> % Define as many T-contrasts as you want
> contrasts(1).name = 'Name_Contrast_1';
> contrasts(1).convec = [1 0];
> contrasts(2).name = 'Name_Contrast_2';
> contrasts(2).convec = [0 1];
>
> % Specify and estimate new T-contrasts
> spm('Defaults','fMRI');
> clear jobs
> jobs{1}.stats{1}.con.spmmat = cellstr('/path/to/SPM.mat');
> for i=1:length(contrasts)
> jobs{1}.stats{1}.con.consess{i}.tcon = contrasts(i);
> end
> spm_jobman('run',jobs);
>
> I hope this helps,
> Guillaume.
>
>
> jiang wrote:
>
> Dear SPM5 users,
>
> I would like to know whether there is a method to enter the
> several T tests contrasts at the same time, a little like to
> enter multiconditions ?
> thank you for your help !
> Tao
--
Guillaume Flandin, PhD
Wellcome Trust Centre for Neuroimaging
University College London
12 Queen Square
London WC1N 3BG
|