Hi Vladimir,
Thanks for your advice regarding how to adapt the script, I had tried entering the names of the two mastoid electrodes as you suggested but this didn't work - which led me to think perhaps I should be using the montage function instead... hence my question to the list.
As you suggested, the part of the script I'm running is:
if reref==1
prefix='MMedff';
file=[prefix 'spm8_gemma_msc_' subj_dir(2:5) '.mat'];
S = [];
S.D = file;
S.refchan = {'EXG5', 'EXG6'};
D=spm_eeg_reref_eeg(S)
end
(where 'EXG5' and 'EXG6' are the left and right mastoid electrode names respectively) and the error message I'm getting is:
Error using spm_eeg_reref_eeg (line 80)
Not all S.refchan are valid indices for (non-bad) EEG channels.
I'd appreciate any further ideas???
Many thanks,
Gemma.
Miss Gemma Barnacle
PhD Student
School of Psychology
Room 119, Zochonis Building
University of Manchester
M13 9PL.
________________________________________
From: Vladimir Litvak [[log in to unmask]]
Sent: 21 February 2013 13:55
To: Gemma Barnacle
Cc: [log in to unmask]
Subject: Re: [SPM] EEG Re-Reference to mastoids
Dear Gemma,
You do what you want just by doing something like:
S.refchan= {'M1', 'M2'};
in your code (assuming that your mastoid channels are called 'M1' and
'M2'). Note that in SPM8, you should use average reference for source
analysis and DCM so mastoid reference is only OK for sensor-level
stats.
Best,
Vladimir
On Wed, Feb 20, 2013 at 6:07 PM, Gemma Barnacle
<[log in to unmask]> wrote:
> Dear All,
>
> I'm working with an EEG data set and would like to re-reference the data to
> an average of the mastoid electrodes rather than an average of all
> electrodes.
>
> The script I'm using currently (for average of all electrodes) is:
>
> if reref==1
> prefix='MMedff';
> file=[prefix 'spm8_gemma_msc_' subj_dir(2:5) '.mat'];
> S = [];
> S.D = file;
> S.refchan=[1:64];
> D=spm_eeg_reref_eeg(S)
> end
>
> From reading the SPM manual I understand that you can re-reference using
> 'spm eeg montage' by entering '-1' in all the rows of the desired reference
> electrode column (except for the row that corresponds to itself where '0' is
> entered).
>
> However, I wonder if somebody can tell me if for my scenario where I wish to
> re-reference to an average of the two mastoid electrodes what the values
> would be? Would I be right in using '-.5' in the rows of both mastoid
> columns (and '0' in corresponding mastoid rows)?
>
> Also, as I'm working from a pre-processing script it would be useful to know
> if I could adapt the part of the script above to reflect my desired changes,
> rather than using the GUI? Could anyone advise me of how to do this?
>
> Any feedback would be much appreciated,
>
> Best Wishes,
> Gemma.
>
> Miss Gemma Barnacle
> PhD Student
> School of Psychology
> Room 119, Zochonis Building
> University of Manchester
> M13 9PL.
|