[FieldTrip] Fwd: Electrode visualization in FieldTrip

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Tue Dec 12 07:35:53 CET 2023


Dear Abraham,

I forward your questions to the discussion list, which is the place where to ask this type of questions.
Not only can you tap into the knowledge of many more people who might have hands on experience, also potentially many more people can learn from the discussion.

Best wishes,
Jan-Mathijs Schoffelen


Begin forwarded message:

From: "Dada, Abraham" <Abraham.Dada at ucsf.edu<mailto:Abraham.Dada at ucsf.edu>>
Subject: Re: Electrode visualization in FieldTrip
Date: 12 December 2023 at 02:54:24 CET
To: "janmathijs.schoffelen at donders.ru.nl<mailto:janmathijs.schoffelen at donders.ru.nl>" <janmathijs.schoffelen at donders.ru.nl<mailto:janmathijs.schoffelen at donders.ru.nl>>
Hello Professor Schoffelen,
My apologies for underspecifying the issue. I'm intending on using ft_sourceplot and plotting the overlay instead of power. I tried to just plot the MNI positions of  subject UC129's electrodes onto the mni template brain, but it's not working as expected. I've pasted my code below as well as the visualizaiton output.

% Create dummy source data structure
sourceDiffIntNorm = struct;
% first set sourceDiffIntNorm.pos = to electrode positions
sourceDiffIntNorm.pos = data.elec.elecpos; % Assign the grid of coordinates to pos get from electrodes of pt uc129 from tutorial
% Set all power to 14
sourceDiffIntNorm.pow = ones(size(sourceDiffIntNorm.pos, 1), 1) * 14; % Set all to 14 initially

% FieldTrip configuration
cfg = [];
cfg.method         = 'surface';
cfg.projmethod = 'sphere_weighteddistance';
cfg.sphereradius = 10;
cfg.funparameter   = 'pow';
cfg.maskparameter  = cfg.funparameter;
cfg.funcolorlim    = [0.0 14.0]; % Adjusted to match the range of power values
cfg.funcolormap    = 'jet';
cfg.opacitylim     = [0.0 14.0]; % Adjusted to match the range of power values
cfg.opacitymap     = 'rampup';
cfg.surffile       = 'surface_pial_both.mat'; % Cortical sheet from canonical MNI brain
% Set datatype to 'source'
sourceDiffIntNorm = ft_datatype_source(sourceDiffIntNorm);
% Plot the dummy source data
ft_sourceplot(cfg, sourceDiffIntNorm);
The function is only plotting one hemisphere despite there being electrodes in both hemisphere. Can you advise?

Best,
Abraham
Abraham Dada
M.D. Candidate UCSF | 2026
B.A. Harvard College | 2021
Pronouns: he/him/his
xxx-xxx-xxxx

University of California, San Francisco

[cid:ba39579f-3b9f-42ac-b58e-f9cff80cd752]
________________________________
From: Dada, Abraham <Abraham.Dada at ucsf.edu<mailto:Abraham.Dada at ucsf.edu>>
Sent: Saturday, December 9, 2023 10:42 AM
To: janmathijs.schoffelen at donders.ru.nl<mailto:janmathijs.schoffelen at donders.ru.nl> <janmathijs.schoffelen at donders.ru.nl<mailto:janmathijs.schoffelen at donders.ru.nl>>
Subject: Electrode visualization in FieldTrip

Hello Professor Schoffelen,

I hope this email finds you well. I'm looking to use your toolbox to generate images for my project like the example attached. I attempted to join the support email list, but was not able to get validated.

I'm new to fieldtrip but want to make a simple image showing the cortical coverage of electrodes in my cohort.

I already have all the electrode coordinates localized to MNI for my patients. I want to create a polygon for each patient spanning their electrodes like the image below and project it into the cortical surface. Is this possible to do in FiledTrip?


[Image.jpeg]
Best

Abraham Dada
M.D. Candidate UCSF | 2026
B.A. Harvard College | 2021
Pronouns: he/him/his
xxx-xxx-xxxx

University of California, San Francisco

[cid:b4e8b878-0ef0-4345-947e-2dde840775a6]
[cid:0D89F4B0-7636-4CF9-9F07-192F224DFD6E][cid:84FC4C6B-1CD5-4719-A530-6EC2B92E1EB6]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20231212/4e5d6f94/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Outlook-lyb1ixpk.png
Type: image/png
Size: 17249 bytes
Desc: Outlook-lyb1ixpk.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20231212/4e5d6f94/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 115721 bytes
Desc: image.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20231212/4e5d6f94/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Outlook-whm0e5qj.png
Type: image/png
Size: 17249 bytes
Desc: Outlook-whm0e5qj.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20231212/4e5d6f94/attachment-0007.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot 2023-12-11 at 5.52.06 PM.png
Type: image/png
Size: 245397 bytes
Desc: Screenshot 2023-12-11 at 5.52.06 PM.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20231212/4e5d6f94/attachment-0008.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot 2023-12-11 at 5.52.17 PM.png
Type: image/png
Size: 97935 bytes
Desc: Screenshot 2023-12-11 at 5.52.17 PM.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20231212/4e5d6f94/attachment-0009.png>


More information about the fieldtrip mailing list