Print

Print


Dear Sheila,

You can create a head model automatically via SPM batch prior to running
the correction code as follows.

Best,

Vladimir

---

%% Create a head model
matlabbatch{1}.spm.meeg.source.headmodel.D = {fullfile(D)};

matlabbatch{1}.spm.meeg.source.headmodel.val = 1;
matlabbatch{1}.spm.meeg.source.headmodel.comment = '';
matlabbatch{1}.spm.meeg.source.headmodel.meshing.meshes.template = 1;
matlabbatch{1}.spm.meeg.source.headmodel.meshing.meshres = 3;

matlabbatch{1}.spm.meeg.source.headmodel.coregistration.coregspecify.fiducial(1).fidname
= 'nas';
matlabbatch{1}.spm.meeg.source.headmodel.coregistration.coregspecify.fiducial(1).specification.select
= 'nas';
matlabbatch{1}.spm.meeg.source.headmodel.coregistration.coregspecify.fiducial(2).fidname
= 'lpa';
matlabbatch{1}.spm.meeg.source.headmodel.coregistration.coregspecify.fiducial(2).specification.select
= 'FIL_CTF_L';
matlabbatch{1}.spm.meeg.source.headmodel.coregistration.coregspecify.fiducial(3).fidname
= 'rpa';
matlabbatch{1}.spm.meeg.source.headmodel.coregistration.coregspecify.fiducial(3).specification.select
= 'FIL_CTF_R';
matlabbatch{1}.spm.meeg.source.headmodel.coregistration.coregspecify.useheadshape
= 0;


matlabbatch{1}.spm.meeg.source.headmodel.forward.eeg = 'EEG BEM';
matlabbatch{1}.spm.meeg.source.headmodel.forward.meg = 'Single Shell';

spm_jobman('run', matlabbatch);

D = reload(D);

On Thu, Nov 27, 2014 at 10:07 AM, Kerry, Sheila <[log in to unmask]>
wrote:

>  Dear Valdimir,
>
>
>
> I work with Alex Leff and Zoe Woodhead. I am preparing some MEG data and I
> want to make a script do this automatically. However, I am having trouble
> scripting the forward model in SPM12. Currently I have this:
>
> S.D = D;
>
>
>
> S.val = 1;
>
> S.comment = '';
>
> S.template = 1;
>
> S.meshres = 2;
>
> S.fidname = 'nas';
>
> S.select = 'nas';
>
> S.fidname = 'lpa';
>
> S.select = 'lpa';
>
> S.fidname = 'rpa';
>
> S.select = 'rpa';
>
> S.useheadshape = 0;
>
> S.eeg = 'EEG BEM';
>
> S.meg = 'Single Shell';
>
> S.mode='EYES';
>
> D=spm_eeg_spatial_confounds(S);
>
>
>
> This opens a ui and I have to select the options I want. Do you know how I
> can stop this and run the options from the script?
>
>
>
> Thanks
>
>
>
> Sheila Kerry
>