[FieldTrip] Assistance Request for Displaying Values of Electrodes Outside Brain Contour with ft_topoplotER function

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Mon Feb 19 09:25:54 CET 2024


Hi Chengyuan,

I am not sure whether I fully understand what you wish to achieve, but I think it is related to how your ‘layout’ has been defined.

If you use ft_prepare_layout with an electrode position file in the input cfg, FieldTrip will create a ’standard’ layout, based on a 2D projection of the electrodes, and a default ‘outline’ and ‘mask’, corresponding to a circle with two ears and a nose (for the outline), and a circle for the mask. The size and shape of the outline and mask are determined by the 2D projected positions of the electrodes.

If you posthoc scale the electrode positions with a factor of 1.7, the electrodes at the edge of the circle may end up outside the ‘mask’-circle.  Any electrodes positioned outside the mask will not be ‘drawn’ in the figure, i.e. you won’t see the color on them.

If you aim for an EEGlab style topoplot, where the colored circle containing data that is larger than the circle of the cartoon head, you’d need to make your own layout. More information about layouts for plotting can be found here: https://www.fieldtriptoolbox.org/tutorial/layout/<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.fieldtriptoolbox.org%2Ftutorial%2Flayout%2F&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C9f3ea73492d74d5d4c5408dc31246412%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638439279556616020%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=NYH4zS3IqBV%2Fage1cNE7PwCNPjJ5CfMzplgbxwGol8Q%3D&reserved=0>

Good luck,
Jan-Mathijs



On 17 Feb 2024, at 17:30, 二姬 via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:

Dear FieldTrip Community,

I am Chengyuan Wu from Ningbo Kangning Hospital, reaching out for guidance on an issue I've encountered while working with EEG topographical mapping with ft_topoplotER function, specifically using the EGI 129 electrode system.

My current challenge is with electrodes positioned outside the brain contour on the topoplot. While the electrode positions relative to the brain are correct, those located outside the brain contour do not display their corresponding values, appearing as blank areas on the map.

To provide some context, here is a segment of my code:

cfg = [];
cfg.layout = 'F:\eeg_ningbo\fieldtrip-20211209\template\electrode\AdultAverageNet128_v1.sfp';
[layout, ~] = ft_prepare_layout(cfg);
% Scaling layout to avoid electrodes clustering in the center of the brain
layout.pos(:,1) = layout.pos(:,1) * 1.7;
layout.pos(:,2) = layout.pos(:,2) * 1.7;
cfg = [];
cfg.parameter = 'avg';
cfg.xlim = [0.35 0.35];
cfg.channel = data.label;
cfg.layout = layout;
cfg.marker = 'labels';
cfg.zlim = [-3 3];
cfg.style = 'straight';
cfg.colormap = '*RdBu';
cfg.shading = 'interp';
cfg.gridscale = 300;
figure; ft_topoplotER(cfg, data);

I have scaled the layout to prevent all electrodes from clustering at the center of the brain. This adjustment has allowed for a more accurate representation of electrode positions relative to the brain. However, the electrodes located outside the brain contour do not display their values.

So I am seeking advice on the following points:

Is there a way to modify the cfg parameters or adjust the layout in FieldTrip to enable the visualization of electrode colors outside the brain contour on the topographical map? If direct cfg adjustments within ft_topoplotER are not feasible, how should I alter the layout variable for this purpose?

Thank you in advance for your time and assistance.

Best regards,

Chengyuan Wu
Ningbo Kangning Hospital
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C9f3ea73492d74d5d4c5408dc31246412%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638439279556616020%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=NGf0BpGT%2FFn67HRLK1cYweEhxCVZvFDcuRFigtHq1qg%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240219/4128c91c/attachment.htm>


More information about the fieldtrip mailing list