[FieldTrip] source analysis EEG data without MRI

IMALI THANUJA HETTIARACHCHI ith at deakin.edu.au
Wed Apr 10 15:38:16 CEST 2013


Hi Ingrid,

I had a similar issue a few weeks ago, where my lower most electrodes started floating after electrode realign using the ft_electroderealign function.

I used the ft_prepare_vol_sens as,
[vol, elecR]=ft_prepare_vol_sens (col,elecR) and this did the trick and brought the electrodes on to the skin.

Hope this helps...!

Regards
Imali


From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Ingrid Nieuwenhuis [inieuwenhuis at berkeley.edu]
Sent: Wednesday, 10 April 2013 9:29 AM
To: fieldtrip at science.ru.nl
Subject: Re: [FieldTrip] source analysis EEG data without MRI

Hi all,

A follow up on this and some new issues:

1) I first tried Jörn's approach by creating my own BEM, always fun to make it yourself ;) However, I did not succeed since:
a) the dipoli method does not work on Windows
b) I downloaded the openmeeg toolbox, but got an error "om_minverser.exe has stopped working" I've emailed their buglist
c) bemcp did run, but the result was not ok (see attachement). I also got the warning "% Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate." several times, so that might be the problem.
d) and asa gave the following error: % Error using ft_prepare_headmodel (line 201) % You must supply a valid cfg.hdmfile for use with ASA headmodel

And away went my determination to do it myself, so I continued using the standard_bem.mat<http://fieldtrip.fcdonders.nl/template/headmodel?s[]=standard&s[]=bem>. (I did not know this existed, I've added this link to note in the headmodel tutorial<http://fieldtrip.fcdonders.nl/tutorial/headmodel_eeg?&#background> to make it easier to find, thanks Tzvetan for pointing this out!).

2) This worked and after some fiddling to get the electrodes aligned it looks okay (see attached).
However, as you can see in the figures, I have several very low electrodes, that are lower than the skin mesh. So I was wondering if this is a problem? Since for accurate calculation of how the currents flow from these low electrodes, I assume one needs the skin to go till there? What happens when I have electrodes floating in thin air?
So my question is:
a) will this cause great inaccuracies?
b) if so, how can I extend the skin to go lower? The template MRI only goes that far to the bottom... Trick anyone?

Thanks again,
Ingrid


On 4/9/2013 9:39 AM, Ingrid Nieuwenhuis wrote:
Thanks Jörn and Tzvetan for the scripts! I'll try it out and put it on the wiki.
Have a great day,
Ingrid

On 4/9/2013 12:32 AM, Tzvetan Popov wrote:
Dear Ingrid,

in addition to Jorn's approach since you don't have MR and digitized elec position's you can load and realign the electrodes to the standard bem. Subsequently you can calculate the lead field and  continue with your analysis pipeline.
Good luck
tzvetan
%% read electrodes
elec = ft_read_sens('/your path/fieldtrip-20130324/template/electrode/GSN-HydroCel-128.sfp');
%% read  headmodel
templateheadmodel = '/your path/fieldtrip-20130324/template/headmodel/standard_bem.mat';
load(templateheadmodel);
%% electrode realign as good as possible
% i.e. translate 0 -2 1.5
cfg=[];
cfg.method = 'interactive';
cfg.elec = elec;
cfg.headshape = vol.bnd(1).pnt;
elecR = ft_electroderealign(cfg);
%% verify how the electrodes fit toghether with the brain volume
cfg=[];
cfg.method = 'interactive';
cfg.elec = elecR;
cfg.headshape = vol.bnd(3).pnt;
elecR = ft_electroderealign(cfg);


Hi Ingrid,

I just happen to done this a few weeks back, I changed things in the meanwhile, but I hope that the below steps are complete:
% read in the template MRI
    if isunix
      mri = ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii');
    elseif ispc
      mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk', 'external', 'spm8', 'templates', 'T1.nii'));
    end


% segment the MRI
cfg           = [];
cfg.output    = {'brain'  'skull'  'scalp'};
segmentedmri  = ft_volumesegment(cfg, mris);


% create the headmodel (BEM)
cfg        = [];
%cfg.method ='openmeeg'; % TODO FIXME download openmeeg
if isunix
  cfg.method ='dipoli'; % dipoli only works under linux
else
  disp('TODO FIXME stick to dipoli for now or download openmeeg\n');
  keyboard;
end
hdm        = ft_prepare_headmodel(cfg, segmentedmri);

elec       = ft_read_sens('standard_1020.elc');
hdm        = ft_convert_units(hdm, elec.unit);

  cfg = [];
  cfg.grid.xgrid  = -125:8:125;
  cfg.grid.ygrid  = -125:8:125;
  cfg.grid.zgrid  = -125:8:125;
  cfg.grid.tight  = 'yes';
  cfg.grid.unit   = hdm.unit;
  cfg.inwardshift = -1.5;
  cfg.vol        = hdm;
  grid  = ft_prepare_sourcemodel(cfg)
  grid        = ft_convert_units(grid, elec.unit);

figure;
hold on;
ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2], 'facealpha', 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05);
ft_plot_mesh(grid.pos(grid.inside, :));

% this step is not necessary, cause you will see that everything is already aligned
  cfg           = [];
  cfg.method    = 'interactive';
  cfg.elec      = elec;
  cfg.headshape = hdm.bnd(1);
  tmp  = ft_electroderealign(cfg);
  elec = tmp; % I had a bug here that I couldn't assign elec directly

%% verify location of occipital electrodes

occ_elec = elec;
occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'}, elec.label);
occ_idx = match_str(elec.label, occ_chan);
occ_elec.chanpos = occ_elec.chanpos(occ_idx, :);
occ_elec.elecpos = occ_elec.elecpos(occ_idx, :);
occ_elec.label = occ_elec.label(occ_idx, :);
figure;
ft_plot_sens(occ_elec)
hold on;
ft_plot_vol(ft_convert_units(hdm, elec.unit))


Afair, that's all that is needed. Of course you need to adjust folder and file names.

Greetings
Jörn

On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote:
Hi all,

I'd like to do source analysis (loreta and or DICS) on my EEG data. I don't have anatomical MRIs and I don't have a measurement of the scalp surface. So I'd like to use a template MRI or a template head model that is located in the FieldTrip template directory. I have EGI (128 channels) data and electrode positions (not subject specific, just the standard file also available in FieldTrip electrode template, GSN-HydroCel-128.sfp), but I'm kind of stuck how to start. I don't see any examples on the FieldTrip page of how to make a headmodel and volume conduction model giving only this limited data. I'd be happy to make it into a example Matlab script on the FieldTrip page after I got it to work. Would someone be able to give me some pointers, or example code?

Thanks a lot!
Ingrid




--
Jörn M. Horschig
PhD Student
Donders Institute for Brain, Cognition and Behaviour
Centre for Cognitive Neuroimaging
Radboud University Nijmegen
Neuronal Oscillations Group
FieldTrip Development Team

P.O. Box 9101
NL-6500 HB Nijmegen
The Netherlands

Contact:
E-Mail: jm.horschig at donders.ru.nl<mailto:jm.horschig at donders.ru.nl>
Tel:    +31-(0)24-36-68493
Web: http://www.ru.nl/donders

Visiting address:
Trigon, room 2.30
Kapittelweg 29
NL-6525 EN Nijmegen
The Netherlands

_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

*******************************************
Tzvetan Popov
Clinical Psychology
University of Konstanz
Box 23
78457 Konstanz, GERMANY
Phone: 0049-7531-883086
Fax:      0049-7531-884601
Email:  tzvetan.popov at uni-konstanz.de<mailto:tzvetan.popov at uni-konstanz.de>
*******************************************









_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip


--
Ingrid Nieuwenhuis PhD
Postdoctoral Fellow
Sleep and Neuroimaging Laboratory
Department of Psychology
University of California, Berkeley
California 94720-1650
Tolman Hall, room 5305



_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip


--
Ingrid Nieuwenhuis PhD
Postdoctoral Fellow
Sleep and Neuroimaging Laboratory
Department of Psychology
University of California, Berkeley
California 94720-1650
Tolman Hall, room 5305
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130410/626785c6/attachment-0002.html>


More information about the fieldtrip mailing list