[FieldTrip] EEG Source Analysis Using EGI 128 Electrode System and Head Model Alignment

二姬 wcy131608 at gmail.com
Tue Jan 16 19:30:00 CET 2024


Dear FieldTrip Community,

I am Chengyuan Wu, currently engaged in source analysis using FieldTrip
with EEG data collected from the EGI 128 electrode system. I'd like to
share my approach and seek your advice on a couple of points.

Due to the complexity of aligning electrodes with the EGI system compared
to the 10-20 standard, and lacking subject-specific MRI structural images,
I opted to use FieldTrip's standard structural images for head model
creation. Following the community discussions “source analysis EEG data
without MRI (2013)” and “Standard BEM or FEM models for use with
256-electrode EEG data recorded with EGI caps (2016)”, I used the
subjectK.mri from the recommended tutorial, which extends from the head to
the neck, thus fitting well with the EGI 128 system(download from:
https://download.fieldtriptoolbox.org/tutorial/beamformingextended/).

I created the head model and realigned the electrode positions using my
electrode template, AdultAverageNet129_v1.sfp, similar to FieldTrip’s
GSN-HydroCel-129.sfp. The first three electrodes were renamed 'Nz', 'LPA',
and 'RPA' directly in the .sfp file, as suggested in the 2016 discussion.
The process followed the standard FieldTrip tutorial, with steps including
reading anatomical data, segmentation, mesh creation, head model
preparation, and electrode alignment.The code shows as below:

%% Reading in the anatomical data
mri = ft_read_mri('F:\eeg_ningbo\source\2mne\subjectK.mri');

%% Segmentation:three different tissue types(scalp, skull and brain)
cfg           = [];
cfg.output    = {'brain','skull','scalp'};
segmentedmri  = ft_volumesegment(cfg, mri);
save segmentedmri segmentedmri

%% Mesh
cfg=[];
cfg.tissue={'brain','skull','scalp'};
cfg.numvertices = [3000 2000 1000];
bnd=ft_prepare_mesh(cfg,segmentedmri);
save bnd bnd

%% Head model
cfg        = [];
cfg.method = 'bemcp'; % You can also specify 'openmeeg', 'bemcp', or
another method.
vol        = ft_prepare_headmodel(cfg, bnd);
save vol vol

%% Align the electrodes
 elec = ft_read_sens('F:\eeg_ningbo\AdultAverageNet128_v1.sfp');
 elec = ft_convert_units(elec, 'mm');
% First, we get these positions in the ctf coordinate system using the
transformation matrix of the mri
% and the ft_warp_apply function.
nas=mri.hdr.fiducial.mri.nas;
lpa=mri.hdr.fiducial.mri.lpa;
rpa=mri.hdr.fiducial.mri.rpa;

transm=mri.transform;
nas=ft_warp_apply(transm,nas, 'homogenous');
lpa=ft_warp_apply(transm,lpa, 'homogenous');
rpa=ft_warp_apply(transm,rpa, 'homogenous');

% Then, we align the position of the fiducials in the electrode structure
(defined with labels ‘Nz’, ‘LPA’, ‘RPA’)
% to their ctf-coordinates that we acquired from the anatomical mri (nas,
lpa, rpa).
% create a structure similar to a template set of electrodes
fid.elecpos       = [nas; lpa; rpa];       % ctf-coordinates of fiducials
fid.label         = {'Nz','LPA','RPA'};    % same labels as in elec
fid.unit          = 'mm';                  % same units as mri
% alignment
cfg               = [];
cfg.method        = 'fiducial';
cfg.target        = fid;                   % see above
cfg.elec          = elec;
cfg.fiducial      = {'Nz','LPA','RPA'};     % labels of fiducials in fid
and in elec
elec_aligned      = ft_electroderealign(cfg);
% We can check the alignment by plotting together the scalp surface with
the electrodes.
figure;
% Interactive alignment
cfg           = [];
cfg.method    = 'interactive';
cfg.elec      = elec_aligned;
cfg.headshape = vol.bnd(3);
elec_aligned  = ft_electroderealign(cfg);
save elec_aligned elec_aligned;

Despite following these steps, I observed that the 'fiducial' method didn't
precisely match electrode positions, being accurate only along the y-axis.
Consequently, I performed a manual adjustment using 'interactive' method. I
have attached images showing the electrode-skin combination after the
'fiducial' adjustment and the subsequent 'interactive' adjustment for
reference.

My questions are as follows:

1. Is the use of the 'interactive' method for a second adjustment rigorous?
and could it impact the accuracy of subsequent source analysis results?
2. Are there more standardized methods specifically for creating head
models and realigning electrodes with the EGI 128 system, especially
methods that avoid the manual adjustments I resorted to?

If anyone has standardized procedures, particularly those that circumvent
manual electrode position adjustments, your guidance would be immensely
appreciated. Also, if there are any errors or improvements to be suggested
in my code or approach, I would be grateful for your insights.

Thank you all for your guidance and support in advance!

Best regards,

Chengyuan Wu
[image: align after interactive method.jpg][image: align after interactive
method2.jpg][image: align after interactive method3.jpg][image: align after
the first 'fiducial' method.jpg][image: align after the first 'fiducial'
method2.jpg]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240117/a217bfd6/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: align after interactive method.jpg
Type: image/jpeg
Size: 28692 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240117/a217bfd6/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: align after interactive method2.jpg
Type: image/jpeg
Size: 25375 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240117/a217bfd6/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: align after interactive method3.jpg
Type: image/jpeg
Size: 25383 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240117/a217bfd6/attachment-0002.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: align after the first  'fiducial' method.jpg
Type: image/jpeg
Size: 24101 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240117/a217bfd6/attachment-0003.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: align after the first  'fiducial' method2.jpg
Type: image/jpeg
Size: 20008 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240117/a217bfd6/attachment-0004.jpg>


More information about the fieldtrip mailing list