[FieldTrip] visualize source localization data

Leopold Zizlsperger zizlsperger at gmail.com
Tue Oct 29 10:30:42 CET 2013


Dear all,
I have a question concerning source localization implementation. I need
help in the very last step of visualizing a difference between 2
conditions over
time:

I get there by using the tutorial steps on single subject functional EEG
data (*fieldtrip-20130914; *tried both WIN and MAC):

*clear all;*
*load('F:\fieldtrip-20130914\EEG1_HC35_GA_XY_ICA_rHFdemeanktkt.mat')*
*load('F:\fieldtrip-20130914\EEG1_HC35_GA_XY_ICA_lHFdemeanktkt.mat')*
*load leadfield;*
*load vol;*
*load elec_aligned;*
*
*
*
*
*cfg        = [];*
* cfg.method = 'mne';*
*cfg.elec = elec_aligned;*
*cfg.grid   = leadfield;*
*cfg.vol    = vol;*
*cfg.mne.prewhiten = 'yes';*
*cfg.mne.lambda    = 3;*
*cfg.mne.scalesourcecov = 'yes';*
*cfg.mne.normalize = 'yes';*
*sourcerHF  = ft_sourceanalysis(cfg, EEG1_HC35_GA_XY_ICA_rHFdemeanktkt);*
*sourcelHF = ft_sourceanalysis(cfg, EEG1_HC35_GA_XY_ICA_lHFdemeanktkt);*
*
*
*save source sourcerHF sourcelHF;*
*
*
*clear all;*

*load source;*
*load sourcespace;*
*
*
*bnd.pnt = sourcespace.pnt;*
*bnd.tri = sourcespace.tri;*
*m=sourcerHF.avg.pow(:,1200);*
*ft_plot_mesh(bnd, 'vertexcolor', m);*
*
*
*
*
*
*
*> In ft_defaults at 74*
*  In ft_sourceanalysis at 146*
*the input is timelock data with 32 channels and 7000 timebins*
*using headmodel specified in the configuration*
*using electrodes specified in the configuration*
*determining source compartment (3)*
*projecting electrodes on skin surface*
*combining electrode transfer and system matrix*
*creating dipole grid based on user specified dipole positions*
*using headmodel specified in the configuration*
*using gradiometers specified in the configuration*
*8196 dipoles inside, 0 dipoles outside brain*
*the call to "ft_prepare_sourcemodel" took 0 seconds*
*estimating current density distribution for repetition 1*
*using pre-computed leadfields: some of the specified options will not have
an effect*
*computing the solution where the noise covariance is used for
regularisation*
*prewhitening the leadfields using the noise covariance*
*scaling the source covariance*
*the call to "ft_sourceanalysis" took 10 seconds*
*the input is timelock data with 32 channels and 7000 timebins*
*using headmodel specified in the configuration*
*using electrodes specified in the configuration*
*determining source compartment (3)*
*projecting electrodes on skin surface*
*combining electrode transfer and system matrix*
*creating dipole grid based on user specified dipole positions*
*using headmodel specified in the configuration*
*using gradiometers specified in the configuration*
*8196 dipoles inside, 0 dipoles outside brain*
*the call to "ft_prepare_sourcemodel" took 0 seconds*
*estimating current density distribution for repetition 1*
*using pre-computed leadfields: some of the specified options will not have
an effect*
*computing the solution where the noise covariance is used for
regularisation*
*prewhitening the leadfields using the noise covariance*
*scaling the source covariance*
*the call to "ft_sourceanalysis" took 87 seconds*
*>> *
*
*
*cfg = [];*
*cfg.projectmom = 'yes';*
*sdrHF = ft_sourcedescriptives(cfg,sourcerHF);*
*sdlHF = ft_sourcedescriptives(cfg, sourcelHF);*
*
*
*sdDIFF = sdrHF;*
*sdDIFF.avg.pow = sdrHF.avg.pow - sdlHF.avg.pow;*
*sdDIFF.tri = sourcespace.tri;*
*
*
*save sd sdrHF sdlHF sdDIFF;*

Then I tried different suggestions from the tutorial or the mailing list:

*cfg = [];*
*cfg.mask = 'avg.pow';*
*ft_sourcemovie(cfg,sdDIFF);*
*
*
*the input is source data with 8196 positions*
*baseline correcting dipole moments
[--------------------------------------\]*
* projecting dipole moment
[------------------------------------------------/]*
*computing power
[---------------------------------------------------------|]*
*the call to "ft_sourcedescriptives" took 32 seconds*
*the input is source data with 8196 positions*
*baseline correcting dipole moments
[---------------------------------------]*
*projecting dipole moment
[------------------------------------------------\]*
*computing power
[----------------------------------------------------------]*
*the call to "ft_sourcedescriptives" took 33 seconds*
*the input is source data with 8196 vertex positions and 16384 triangles*
*Warning: use cfg.maskparameter instead of cfg.mask *
*> In ft_checkconfig at 120*
*  In ft_sourcemovie at 48*
*??? Error using ==> set*
*Bad property value found.*
*Object Name :  axes*
*Property Name : 'CLim'*
*Values must be increasing and non-NaN.*
*
*
*Error in ==> caxis at 80*
*            set(ax,'CLim',arg);*
*
*
*Error in ==> ft_sourcemovie at 263*
*caxis(cfg.zlim);*



If I set a break before this point I can see that "arg" indeed contains two
NaNs only.

Do you have any suggestions why the script above fails to determine the
axes properties?

Alternatively I tried:

*figure*
*sdDIFF.tri = sourcespace.tri;*
*cfg = [];*
*cfg.alim = [0 0.5];*
*cfg.zlim = [0 0.5];*
*cfg.maskparameter = 'avg.pow';*
*ft_sourcemovie(cfg,sdDIFF);*


That results in a GUI that does seem to work but in the time course there
is no activity displayed.

Any advice how to visualize the difference properly?
Thanks in advance.
Best
Leo
RWTH Aachen Neurology


P.S.
structure of the difference *sdDIFF*:

*time: [1x7000 double]*
*        pos: [8196x3 double]*
*     inside: [8196x1 double]*
*    outside: [1x0 double]*
*     method: 'average'*
*        avg: [1x1 struct]*
*        cfg: [1x1 struct]*
*        tri: [16384x3 int32]*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20131029/cc54aaac/attachment-0001.html>


More information about the fieldtrip mailing list