<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi Ingrid,<br>
<br>
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:<br>
<i><small>% read in the template MRI<br>
if isunix<br>
mri =
ft_read_mri('/home/common/matlab/fieldtrip/external/spm8/templates/T1.nii');<br>
elseif ispc<br>
mri = ft_read_mri(fullfile('M:', 'FieldTrip', 'trunk',
'external', 'spm8', 'templates', 'T1.nii'));<br>
end<br>
<br>
<br>
% segment the MRI<br>
cfg = [];<br>
cfg.output = {'brain' 'skull' 'scalp'};<br>
segmentedmri = ft_volumesegment(cfg, mris);<br>
<br>
<br>
% create the headmodel (BEM)<br>
cfg = [];<br>
%cfg.method ='openmeeg'; % TODO FIXME download openmeeg<br>
if isunix<br>
cfg.method ='dipoli'; % dipoli only works under linux<br>
else<br>
disp('TODO FIXME stick to dipoli for now or download
openmeeg\n');<br>
keyboard;<br>
end<br>
hdm = ft_prepare_headmodel(cfg, segmentedmri);<br>
<br>
elec = ft_read_sens('standard_1020.elc');<br>
hdm = ft_convert_units(hdm, elec.unit);<br>
<br>
cfg = [];<br>
cfg.grid.xgrid = -125:8:125; <br>
cfg.grid.ygrid = -125:8:125; <br>
cfg.grid.zgrid = -125:8:125;<br>
cfg.grid.tight = 'yes'; <br>
cfg.grid.unit = hdm.unit;<br>
cfg.inwardshift = -1.5;<br>
cfg.vol = hdm;<br>
grid = ft_prepare_sourcemodel(cfg)<br>
grid = ft_convert_units(grid, elec.unit);<br>
<br>
figure;<br>
hold on;<br>
ft_plot_mesh(hdm.bnd(1), 'facecolor',[0.2 0.2 0.2],
'facealpha', 0.3, 'edgecolor', [1 1 1], 'edgealpha', 0.05);<br>
ft_plot_mesh(grid.pos(grid.inside, :));<br>
<br>
% this step is not necessary, cause you will see that
everything is already aligned<br>
cfg = [];<br>
cfg.method = 'interactive';<br>
cfg.elec = elec;<br>
cfg.headshape = hdm.bnd(1);<br>
tmp = ft_electroderealign(cfg);<br>
elec = tmp; % I had a bug here that I couldn't assign elec
directly<br>
<br>
%% verify location of occipital electrodes<br>
<br>
occ_elec = elec;<br>
occ_chan = ft_channelselection({'O*', 'PO*', 'Cz*', 'Fz*'},
elec.label);<br>
occ_idx = match_str(elec.label, occ_chan);<br>
occ_elec.chanpos = occ_elec.chanpos(occ_idx, :);<br>
occ_elec.elecpos = occ_elec.elecpos(occ_idx, :);<br>
occ_elec.label = occ_elec.label(occ_idx, :);<br>
figure;<br>
ft_plot_sens(occ_elec)<br>
hold on;<br>
ft_plot_vol(ft_convert_units(hdm, elec.unit))</small></i><br>
<br>
<br>
Afair, that's all that is needed. Of course you need to adjust
folder and file names.<br>
<br>
Greetings<br>
Jörn<br>
<br>
On 4/9/2013 2:04 AM, Ingrid Nieuwenhuis wrote:<br>
</div>
<blockquote cite="mid:51635B04.7090004@berkeley.edu" type="cite">Hi
all,
<br>
<br>
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?
<br>
<br>
Thanks a lot!
<br>
Ingrid
<br>
<br>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
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: <a class="moz-txt-link-abbreviated" href="mailto:jm.horschig@donders.ru.nl">jm.horschig@donders.ru.nl</a>
Tel: +31-(0)24-36-68493
Web: <a class="moz-txt-link-freetext" href="http://www.ru.nl/donders">http://www.ru.nl/donders</a>
Visiting address:
Trigon, room 2.30
Kapittelweg 29
NL-6525 EN Nijmegen
The Netherlands</pre>
</body>
</html>