[FieldTrip] ft_sourcemovie - producing 'contemporary art' instead of a brain

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Tue Mar 31 11:07:44 CEST 2020


Hi Emilie,

ft_sourcemovie has been designed to operate on source level data that is defined on a cortical surface based source model.
The code you pasted in suggests that you used a 3-dimensional grid as a sourcemodel. So this is never going to work.
Apparently, you managed to fool the function by post-hoc including a so-called ’tri’ field, which is the hallmark that fieldtrip uses to determine whether the sourcemodel geometry was a mesh or not.
However, there is no relation whatsoever between the specified triangulation (which you took from the headmodel) and the dipole positions at which your source activity has been estimated.

Best wishes,
Jan-Mathijs


On 31 Mar 2020, at 10:42, Emilie Caspar <ecaspar at ulb.ac.be<mailto:ecaspar at ulb.ac.be>> wrote:

Dear all,

I am trying to compute a source reconstruction of different ERPs between two experimental conditions. Well, good news is that the script ‘works’, but the issue is that I am producing contemporary art instead of a brain with ft_sourcemovie (see figure in attachement). The headmodel I used is the standard one available for download. The leadfield I built seems to look like a brain with a correct positions of the electrodes (see also figure in attachement).

I really have no cue about how I produced such output with ft_sourcemovie and what could possibly be the issue (code is below). If someone can help transforming this to a brain? ;-)
The only thing that differs (I think) from the tutorial is that I don’t have a headmodel.tri but rather a headmodel.bnd.tri. Don’t know if it makes any difference. Perhaps the sourcespace defined in the tutorial is something different?

Thank you,

Emilie

<ft_sourcemovie.png><leadfield.png><ft_plot_mesh.png>

CODE

q=biosim64;
ph = cell2mat(q(:,2));
th = cell2mat(q(:,3));
x = sin(ph*pi/180) .* cos(th*pi/180);
y = sin(ph*pi/180) .* sin(th*pi/180);
z = cos(ph*pi/180);

plot3(x, y, z, '.');
elec.label = q(:,1);
elec.pnt = [x y z];

cfg.sourcemodel.pos = elec.pnt;
sourcemodel = ft_prepare_sourcemodel(cfg);

headmodel = ft_read_headmodel('headmodel/standard_bem.mat');

% realign electrodes to headmodel
cfg = [];
cfg.method = 'interactive';
cfg.elec = elec;
cfg.headshape = headmodel.bnd(1); %1 = skin
elec = ft_electroderealign(cfg);

%save new electrodes
save elec64.mat elec

ERPsAll.elec = ft_read_sens('elec64.mat’);

% Prepare leadfield
cfg                 = [];
cfg.elec            = ERPsAll.elec;
cfg.vol             = headmodel;
cfg.reducerank      = 3;
cfg.grid.resolution = 1;   % use a 3-D grid with a 1 cm resolution
cfg.grid.unit       = 'cm';
cfg.channel ={'all'};
leadfield = ft_prepare_leadfield(cfg);



%%mne
cfg              = [];
cfg.method       = 'mne'; %pcc: partial cannonical correlation/coherence
cfg.elec         = ERPsAll.elec; %grid.cfg.elec;%
cfg.headmodel          = headmodel;
cfg.grid = leadfield;
%cfg.sourcemodel = sourcemodel;
% cfg.channel ={'all'};%, '-spmnas', '-spmlpa', '-spmrpa'};
cfg.mne.prewhiten = 'yes';
cfg.mne.lambda    = 3;
cfg.mne.scalesourcecov = 'yes';
%cfg.reducerank          = 2;

source_C_Shock = ft_sourceanalysis(cfg, GA_C_Shock);
source_C_Noshock = ft_sourceanalysis(cfg, GA_C_NOshock);

save source_C_Shock.mat source_C_Shock
save source_C_Noshock.mat source_C_Noshock

bnd.pos = headmodel.bnd.pos;
bnd.tri = headmodel.bnd.tri;

m=source_C_Shock.avg.pow(:,450);
%timeN1 = [1232:1301];timeP3 = [1722:1927];timeeLPP = [1928:2356];timelLPP = [2357:2868];
ft_plot_mesh(bnd, 'vertexcolor', m);
view([180 0]); h = light; set(h, 'position', [0 1 0.2]); lighting gouraud; material dull

cfg = [];
cfg.projectmom = 'yes';
sdShock  = ft_sourcedescriptives(cfg,source_C_Shock);
sdNoShock = ft_sourcedescriptives(cfg,source_C_Noshock);

sdDIFF         = sdNoShock;
sdDIFF.avg.pow = sdNoShock.avg.pow - sdShock.avg.pow;
sdDIFF.tri = headmodel.bnd.tri;

save sd sdDIFF;

cfg = [];
cfg.funparameter = 'pow';
%cfg.method       = 'surface';
ft_sourcemovie(cfg,sdDIFF);


---------------------------------------------
Emilie Caspar, Ph.D

CO3, Centre de Recherche Cognition et Neurosciences (CRCN), ULB
Voice : +32 2 650 32 95
mail : ecaspar at ulb.ac.be<mailto:ecaspar at ulb.ac.be>
office: DB10-138

Social Brain Lab, Netherlands Institute for Neuroscience (NIN), KNAW
mail : e.caspar at nin.knaw.nl<mailto:e.caspar at nin.knaw.nl>

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200331/7fa04f55/attachment.htm>


More information about the fieldtrip mailing list