[FieldTrip] source analysis EEG data without MRI

Tzvetan Popov tzvetan.popov at uni-konstanz.de
Tue Apr 9 09:32:53 CEST 2013


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
> 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
> 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
*******************************************






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130409/93474549/attachment.html>


More information about the fieldtrip mailing list