[FieldTrip] align MRI- headmodel- EEG electrodes problem
Konstantina Kalogianni
K.Kalogianni at tudelft.nl
Tue Jul 21 16:56:15 CEST 2015
Dear fieldtrippers,
I am struggling with aligning the individual MRI, the headmodel and electrode positions(EEG) for some days now, without any success.
I would appreciate some help.
To begin with, as an input I have the subject specific MRI which was segmented with the use of freesurfer and MNE software.
I load first the MRI ,the triangulated meshes for brain skull and skin, and the electrodes positions of 65-channel EEG.
I am then computing the bem headmodel from the brain skull skin (computed with the use of MNE software)
Afterwards I am aligning the MRI to my headmodel (ft_volumerealign) and then I identify the fiducials with the interactive mode (ft_volumerealign).
I do the transformation of the fiducial points with ft_warp_apply to the coordinates specified at the alignment.
Then I call the ft_electroderealign to align my electrodes to the mri's fiducial points.
And then I realign my electrodes manually.
The problem is that no matter how much rotation translation scaling I do, it's IMPOSSIBLE TO FIT THE ELECTRODES TO THE HEADMODEL!
I tried the volume_realign with ctf coordinates as well and I tried the ft_electroderalign with the interactive mode only(without matching the fiducials), it doesn't work.
Below you can find the code that I used.
Any ideas on this issue would be of great help!
%% READ
% read mri
mri=ft_read_mri([freesurferDir 'mri\orig.mgz']);
mri.coordsys='neuromag';
% read surfaces
brain=ft_read_headshape([freesurferDir 'bem\brain.surf\Pilot08_brain_surface']);
skull=ft_read_headshape([freesurferDir 'bem\brain.surf\Pilot08_inner_skull_surface' ]);
skin=ft_read_headshape([freesurferDir 'bem\brain.surfilot08_outer_skin_surface' ]);
% read electrodes positions
elec_file=[datadir '\raw\M10.elc'];
elec=ft_read_sens(elec_file );
elec.coordsys='neuromag';
elec.label=upper(elec.label);
%% HEADMODEL
%assign values of segmented surfaces
geom(1).tri=brain.tri;
geom(2).tri=skull.tri;
geom(3).tri=skin.tri;
geom(1).pnt=brain.pnt;
geom(2).pnt=skull.pnt;
geom(3).pnt=skin.pnt;
% compute headmodel
vol=ft_headmodel_bemcp(geom);
vol=ft_convert_units(vol, 'mm');
vol.coordsys='neuromag';
%% ALIGNMENTS
%align mri and headshape
mri_coord=ft_determine_coordsys(mri, 'interactive', 'yes');
vol_coord=ft_determine_coordsys(vol, 'interactive', 'yes');
cfg=[];
cfg.method = 'headshape';
cfg.headshape=vol_coord.bnd(3);
mri_headshape=ft_volumerealign(cfg,mri_coord);
%find fiducials
cfg=[];
cfg.method='interactive';
cfg.coordsys='neuromag';
mri_fid=ft_volumerealign(cfg,mri_headshape);
%% APPLY TRANSFORMATIONS ON FIDUCIALS
transm=mri_fid.transform;
nas=ft_warp_apply(transm,mri_fid.cfg.fiducial.nas, 'homogenous');
lpa=ft_warp_apply(transm,mri_fid.cfg.fiducial.rpa, 'homogenous');
rpa=ft_warp_apply(transm,mri_fid.cfg.fiducial.lpa, 'homogenous');
fid.chanpos = [nas; rpa; lpa];
fid.elecpos =fid.chanpos;
fid.label = {'NASION', 'RIGHTEAR','LEFTEAR'}; % same labels as in elec
fid.unit = 'mm'; % same units as mri
% Automatic electrode alignment using the fiducials
cfg = [];
cfg.method = 'fiducial';
cfg.template = fid;
cfg.elec = elec;
cfg.fiducial = {'NASION', 'RIGHTEAR','LEFTEAR'}; % labels of fiducials in fid and in sens
cfg.headshape=vol_coord.bnd(3); % use the scalp as headshape
elec_aligned_fid = ft_electroderealign(cfg);
%% Interactive alignment of electrodes to fix some misalignment
cfg=[];
cfg.method='interactive';
cfg.elec=elec_aligned_fid;
cfg.headshape=vol_coord.bnd(3); % use the scalp as headshape
elec_aligned=ft_electroderealign(cfg);
Best Regards,
K. (Nadia) Kalogianni
PhD candidate
TU Delft /Department of Biomechanical Engneering
Neuromuscular Control Laboratory
Mekelweg 2
2628 CD Delft
Room: F-1-320
T +31 15-27 84230
E k.kalogianni at tudelft.nl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150721/3d6f31dd/attachment-0001.html>
More information about the fieldtrip
mailing list