[FieldTrip] Antwort: Re: strange leadfield for beamforming from template files
m.goeldi at psychologie.uzh.ch
m.goeldi at psychologie.uzh.ch
Fri Mar 20 18:05:46 CET 2015
Hi Jan-Mathijs
Thanks for your quick reply.
How would I prove it is not a numerical problem?
The big arrows are all close to the boundary.
I created my own head models according to the ft-tutorial, but the problem persists.
To solve this issue is it feasible to simply remove the points closest to the boundary?
(Or a bit more sophisticated, remove those points where the vector is missaligned wrt. its neighbours.)
If this happens with the template files, I guess this will also happen routinely with any other (i.e. individual) scans I would use.
Is there a standard ft approach to adress this issue?
Cheers
Maurice
---
University of Zürich
Maurice Göldi
Department of Psychology
Biopsychology
Binzmühlestr. 14 / Box 5
CH - 8050 Zürich
Tel. +41 (0)44 635 74 55
www.psychologie.uzh.ch
maurice.goeldi at uzh.ch
-----fieldtrip-bounces at science.ru.nl schrieb: -----
An: FieldTrip discussion list <fieldtrip at science.ru.nl>
Von: "Schoffelen, J.M. (Jan Mathijs)"
Gesendet von: fieldtrip-bounces at science.ru.nl
Datum: 19.03.2015 22:30
Betreff: Re: [FieldTrip] strange leadfield for beamforming from template files
Hi Maurice,
The way in which you visualize the leadfield vectors it is hard to see in which locations the arrows are big. My suspicion is (unless otherwise proven) that you are suffering from numerical problems at dipole positions close to the inner boundary.
Best,
Jan-Mathijs
On Mar 19, 2015, at 12:34 PM, m.goeldi at psychologie.uzh.ch wrote:
Hi all
I am trying to do beamforming with my EEG data. I am using the template headmodel etc provided in fieldtrip to compute the leadfield.
Since my data looks strange I have visualized the leadfield expecting grid points close to the electrode to have a larger leadfield.
Unfortunately this is not the case. The vectors are all over the place. See figure.
The red circle is the electrode location (Cz).
The field looks (qualitatively) just as wrong for any other electrode.
Below is the code I used to generate & visualize the lead field.
I have used the same code to visualize the leadfield from a example MEG file from the fieldtrip page.
There the result is as expected, so I think the problem lies not in the visualization.
I am using fieldtrip-20150118
I have tried all the standard_sourcemodel3d*mm files. Qualitatively the error remains the same.
My question is, am I doing anything wrong in generating the lead field?
Am I expecting something wrong (i.e. is this a realistidc lead field?)
Does anyones lead field look the same/different when using the template files?
I would appreciate any help with this problem.
Thanks for your thoughts
Cheers
Maurice
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% load mri
load('C:\Program Files\MATLAB\fieldtrip-20150118\template\headmodel\standard_mri.mat')
% load template sourcemodel
template = load('C:\Program Files\MATLAB\fieldtrip-20150118\template\sourcemodel\standard_sourcemodel3d8mm');
% compute source model
cfg = [];
cfg.grid.warpmni = 'yes';
cfg.grid.template = template.sourcemodel;
cfg.grid.nonlinear = 'yes'; % use non-linear normalization
cfg.grid.resolution = 6;
cfg.mri = mri;
sourcemodel = ft_prepare_sourcemodel(cfg);
sourcemodel = ft_convert_units(sourcemodel, 'cm');
% make head model
load('C:\Program Files\MATLAB\fieldtrip-20150118\template\headmodel\standard_bem.mat');
vol = ft_convert_units(vol, 'cm');
%% electrode layout
elec = ft_read_sens('C:\Program Files\MATLAB\spm12\EEGtemplates\egi128_GSN_HydroCel.sfp');
[elec] = removeelectrodes(elec,data.label); % remove the electrodes that are not in my data
elec = ft_convert_units(elec,'cm');
% lead field
cfg = [];
cfg.grid = sourcemodel;
cfg.elec = elec;
cfg.vol = vol;
cfg.channel = 'all';
[grid] = ft_prepare_leadfield(cfg,freqC1);
grid = ft_convert_units(grid, 'cm');
%%%% visualize leadfield %%%%
channel = 'Cz';
%% electrode position
elecpos = grid.cfg.elec.elecpos(strcmp(grid.cfg.elec.label,channel),:);
%% leadfield positions
leadfieldpos = grid.pos(grid.inside,:);
%% extract leadfield
npts = numel(grid.leadfield);
lead = grid.leadfield(grid.inside);
nchan = find(strcmp(grid.cfg.channel,channel));
for i = 1:numel(lead)
leadVect(i,:) = lead{i}(nchan,:);
end
figure; hold on % plot all objects in one figure
ft_plot_mesh(vol.bnd(3), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]);
ft_plot_mesh(vol.bnd(2), 'edgecolor','none','facealpha',0.8,'facecolor','y');
alpha 0.3
scale = 30;
quiver3(leadfieldpos(:,1),leadfieldpos(:,2),leadfieldpos(:,3),leadVect(:,1),leadVect(:,2),leadVect(:,3),scale)
plot3(elecpos(1),elecpos(2),elecpos(3),'ro')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
---
University of Zürich
Maurice Göldi
Department of Psychology
Biopsychology
Binzmühlestr. 14 / Box 5
CH - 8050 Zürich
Tel. +41 (0)44 635 74 55
www.psychologie.uzh.ch
maurice.goeldi at uzh.ch
_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150320/d3dd6ca5/attachment-0001.html>
More information about the fieldtrip
mailing list