% Batch script to process Phantom Example Data using FieldMap Toolbox
% Data is available from http://www.fil.ion.ucl.ac.uk/spm/data/fieldmap/
%--------------------------------------------------------------------------
% Copyright (C) 2012 Wellcome Trust Centre for Neuroimaging

% Chloe Hutton
% $Id: PhantomExample_fieldmap_batch.m $

% Initialise SPM defaults
%--------------------------------------------------------------------------
spm('Defaults','fMRI');
spm_jobman('initcfg');
clear matlabbatch

% Set up FieldMap job
%--------------------------------------------------------------------------
matlabbatch{1}.spm.tools.fieldmap.presubphasemag.subj.phase = {'PhantomData/fieldmap/sPhantom-0007-00001-000001-02.nii,1'};
matlabbatch{1}.spm.tools.fieldmap.presubphasemag.subj.magnitude = {'PhantomData/fieldmap/sPhantom-0006-00001-000001-01.nii,1'};
matlabbatch{1}.spm.tools.fieldmap.presubphasemag.subj.defaults.defaultsfile = {'pm_defaults_PhantomExample.m'};
matlabbatch{1}.spm.tools.fieldmap.presubphasemag.subj.session.epi = {'PhantomData/epi/fPhantom-0005-00001-000001-01.nii,1'};
matlabbatch{1}.spm.tools.fieldmap.presubphasemag.subj.matchvdm = 0;
matlabbatch{1}.spm.tools.fieldmap.presubphasemag.subj.sessname = 'session';
matlabbatch{1}.spm.tools.fieldmap.presubphasemag.subj.writeunwarped = 1;
matlabbatch{1}.spm.tools.fieldmap.presubphasemag.subj.anat = {''};
matlabbatch{1}.spm.tools.fieldmap.presubphasemag.subj.matchanat = 0;

% Run job
%--------------------------------------------------------------------------
spm_jobman('run',matlabbatch);
