<font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2"> <span>Hi fieldtrippers<br><br>I am trying to do source localization for my EEG data with beamforming, but my results seem to indicate something has gone wrong.<br>The subjects were exposed to a flickering screen of 14Hz so I expect atleast some activity in the visual cortex. <br>The topoplot of a frequency analysis showed a 15Hz peak in the parietal area.<br><br><br>The Problem:<br>I always get extreme activity in a few voxels, usually around the fringes of my volume, several orders of magnitude larger than the rest.<br>See attached figure 1.<br>If I adjust the colorscale of my plot drastically i only get activity at the fringes of the brain/along the skull.<br>See figure 2.<br><br>This seems like a systematic error but at this point I am not sure where my error is. <br>I am suspecting the forward/inverse model, the frequency analysis or my preprocessing pipeline. (So basically everything)<br><br>I have created my source model using .\fieldtrip-20140225\template\headmodel\standard_bem.mat provided in fieldtrip <br>and I have also tried to create the headmodel myself using .\fieldtrip-20140225\template\headmodel\standard_mri.mat.<br>The results are slightly different as in where the extreme activities are, but qualitatively they are the same.<br>A plot of the head and source model with the electrodes is attached in figure3. Source, head and electrodes seem to math up fine.<br><br><br>The Questions:<br>Is there something obviously wrong with my head/source model?<br><br>Is there something wrong with how i calculate the cross spectral density matrix? <br>And is there a way to visualize the output of ft_freqanalysis to do a sanity-check?<br>Since there is no time dimension the ft plotting options don't work.<br><br>Is there something wrong with my preprocessing pipeline? (Artifact rejection was done before using VisionAnalyzer2)<br><br><br>Thanks in advance for your thoughts and inputs<br><br>Cheers<br>Maurice<br><br>PS: Before submitting this I updated to the newest version of ft (20141002) to see if it was a version issue. <br>It turns out that all the template files I had been using from my previous install (20140225) have vanished sometime inbetween.<br>Is there a reason for this?<br>Btw. I ran it with the new version and the old template files and the result is the same.<br><br><br><br>Some Code:<br><br>%% Preprocessing:<br>cfg = [];                                           % empty configuration<br>cfg.dataset                 = '..\Data\9 20131105 0928_Segmentation 3.dat';       % dataset  <br>cfg.trialdef.eventtype      = 'Comment';<br>cfg.trialdef.prestim        = 0.3;<br>cfg.trialdef.poststim       = 2;<br>cfg.trialdef.eventvalue     = {'14HZ'}; <br><br>cfg = ft_definetrial(cfg);<br><br>% baseline correction<br>cfg.demean = 'yes';<br>cfg.baselinewindow = [-0.3 0];<br><br>% rereference to avg over all<br>cfg.reref = 'yes';<br>cfg.refchannel = 'all';<br><br>data = ft_preprocessing(cfg);<br><br>% shifts and scales all channles of the the input data<br>% to a mean of zero and a standard deviation of one.<br>cfg = [];<br>data = ft_channelnormalise(cfg,data);<br><br>% load the manually realigned electrodes<br>load('.\Data\electrodes_aligned.mat');<br><br>% Time window of interest<br>cfg = [];                                           <br>cfg.toilim = [0 2];                       <br>dataPost = ft_redefinetrial(cfg, data);<br><br><br>%% Calculating the cross spectral density matrix<br>cfg            = [];<br>cfg.method     = 'mtmfft';<br>cfg.taper = 'dpss';<br>cfg.output     = 'powandcsd';<br>cfg.keeptrials = 'yes';<br>cfg.tapsmofrq  = 2;<br>cfg.foi        = 15;<br>freqPost      = ft_freqanalysis(cfg, dataPost);<br><br><br>%% The forward model and lead field matrix<br>% load mri<br>load('C:\Program Files\MATLAB\fieldtrip-20140225\template\headmodel\standard_mri.mat')<br><br>% make segments<br>cfg          = [];<br>segmentedmri = ft_volumesegment(cfg, mri);<br>segmentedmri.transform = mri.transform;<br>segmentedmri.anatomy   = mri.anatomy;<br><br>%load template sourcemodel<br>template = load('C:\Program Files\MATLAB\fieldtrip-20140225\template\sourcemodel\standard_sourcemodel3d8mm'); <br>% compute source model<br>cfg                = [];<br>cfg.grid.warpmni   = 'yes';<br>cfg.grid.template  = template.sourcemodel;<br>cfg.grid.nonlinear = 'yes'; % use non-linear normalization<br>cfg.mri            = mri;<br>sourcemodel        = ft_prepare_sourcemodel(cfg);<br><br>% make headmodel<br>cfg        = [];<br>cfg.method = 'openmeeg'; <br>hdm        = ft_prepare_headmodel(cfg, segmentedmri);<br>vol = ft_convert_units(hdm, 'cm');<br><br>% lead field<br>cfg                 = [];<br>cfg.grid            = sourcemodel;<br>cfg.elec            = elec;<br>cfg.vol             = vol;<br>cfg.channel = 'all';<br>cfg.normalize = 'yes';       % normalize instead of contrasting to noise estimate<br>[grid] = ft_prepare_leadfield(cfg,freqPost);<br><br><br>%% Source Analysis<br>cfg              = []; <br>cfg.elec         = elec;<br>cfg.method       = 'dics';<br>cfg.frequency    = freqPost.freq;  <br>cfg.grid         = grid; <br>cfg.vol          = vol;<br>cfg.keeptrials        = 'yes';<br>cfg.dics.lambda       = '10%';<br>cfg.dics.keepfilter   = 'yes';<br>cfg.dics.fixedori     = 'yes';<br>cfg.dics.realfilter   = 'yes';<br>sourcePost_nocon = ft_sourceanalysis(cfg, freqPost);<br><br>cfg              = [];<br>cfg.voxelcoord   = 'no';<br>cfg.parameter    = 'avg.pow';<br>cfg.interpmethod = 'nearest';<br>sourcePostInt_nocon  = ft_sourceinterpolate(cfg, sourcePost_nocon ,mri);<br><br>% plot<br>cfg              = [];<br>cfg.method       = 'slice';<br>cfg.funparameter = 'avg.pow';<br>cfg.maskparameter = cfg.funparameter;<br>% cfg.funcolorlim   = [0.0 0.08];<br>% cfg.opacitylim    = [0.0 0.2]; <br>cfg.opacitymap    = 'rampup'; <br>ft_sourceplot(cfg,sourcePostInt_nocon);<br><br><br><br>---<br>University of Zürich<br>Maurice Göldi<br>Department of Psychology<br>Biopsychology<br>Binzmühlestr. 14 / Box 5<br>CH - 8050 Zürich<br><br>Tel. +41 (0)44 635 74 55<br><a href="http://www.psychologie.uzh.ch">www.psychologie.uzh.ch</a><br><a href="mailto:maurice.goeldi@uzh.ch">maurice.goeldi@uzh.ch</a></span><div></div></font>