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

Emilie Caspar ecaspar at ulb.ac.be
Tue Mar 31 10:42:52 CEST 2020


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



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
office: DB10-138 

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200331/4d9f8853/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ft_sourcemovie.png
Type: image/png
Size: 141034 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200331/4d9f8853/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: leadfield.png
Type: image/png
Size: 70775 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200331/4d9f8853/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ft_plot_mesh.png
Type: image/png
Size: 94842 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200331/4d9f8853/attachment-0005.png>


More information about the fieldtrip mailing list