[Eeglablist] how to load scalp maps in a script?
Bradley Voytek
bradley.voytek at gmail.com
Sun Jun 26 11:51:02 PDT 2011
Danielle:
It's been a while since I've worked with EEGLAB, but I still use the
topoplot.m function for making scalp EEG movies.
It's very simple; you pass it two arguments: your data vector and your
channel locations (but it accepts many useful optional inputs as
well). The data vector must have the same number of points as your
channel locations.
So for example, when I use it it might look like this:
topoplot(data(:, i), EEG.chanlocs, 'style', 'map', 'maplimits',
minmax, 'electrodes', 'on');
where I've created a variable called data is a 2D array of EEG
amplitudes by time (or power by frequency!) and I'm looping across
_i_, which is the timepoint. I'm assuming that all your subjects have
the same electrode space, thus EEG.chanlocs should be the same for all
subjects.
If you would instead want to plot the topography averaged across time
(say 300-500ms for a P3), then just make data a one-dimensional vector
where each element is the mean amplitude at each electrode in
EEG.chanlocs.
If you're unclear on how to make the data vector, let me know.
::brad
On Sat, Jun 25, 2011 at 08:29, Danielle Farrar <dfarrar at bu.edu> wrote:
> Hello,
> This is a seemingly simple problem but I can't seem to resolve it. I'm
> trying to script plotting a series of averages, but I can't seem to load the
> scalp map, so my figures are all just a series of numbers. I'd also like to
> script the 2-D scalp map plotting, but need a proper scalp map in order to
> do it. I've tried both pop_chanedit and pop_editset to no avail.
> Here's a snippet of my code:
>
> EEG = eeg_checkset( EEG );
>
> EEG = pop_loadset( 'filename', [ExperimentType,'.set'] , 'filepath',
> CNTDirectory);
>
> EEG = eeg_checkset( EEG );
>
> %Epoch the file - Common Trigger
>
> ExpTypeCommon = [ExperimentType, ' Common']
>
> EEG = pop_epoch( EEG, {CommonTrigger},[-0.15 1.0], 'newname', ExpTypeCommon,
> 'epochinfo', 'yes');
>
> EEG = eeg_checkset( EEG );
>
> EEG = pop_rmbase( EEG, [-150 0]);
>
> EEG = eeg_checkset( EEG );
>
> [ALLEEG EEG CURRENTSET] = pop_newset(ALLEEG, EEG,
> 1,'setname',ExpTypeCommon,'gui','off');
>
> EEG = eeg_checkset( EEG );
>
> EEG = pop_editset(EEG, 'chanlocs',
> '/Applications/eeglab10_0_0_0b/plugins/dipfit2.2/standard_BESA/standard-10-5-cap385.elp');
>
> EEG = eeg_checkset( EEG );
>
> ----------------
>
> I do this again for a rare set of stimuli.
> Then, I try to plot (calling pop_editset or pop_chanedit once more for good
> measure):
>
>
>
> figure;
>
> %EEG=pop_chanedit(EEG,
> 'lookup','/Applications/eeglab10_0_0_0b/plugins/dipfit2.2/standard_BESA/standard-10-5-cap385.elp');
>
> EEG = pop_editset(EEG,
>
> 'chanlocs',
> '/Applications/eeglab10_0_0_0b/plugins/dipfit2.2/standard_BESA/standard-10-5-cap385.elp');
>
> EEG = eeg_checkset( EEG );
>
> pop_comperp( ALLEEG, 1, [2 3]
> ,[], 'addavg','off','addstd','off','addall','on','diffavg','off','diffstd','off','tplotopt',{'ydir'
> 1});
>
> The images loads just fine, but it is definitely not retaining the channel
> locations. Thoughts?
>
> Thanks,
>
> Danielle
>
>
>
>
>
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to
> eeglablist-request at sccn.ucsd.edu
>
More information about the eeglablist
mailing list