[FieldTrip] Source reconstruction - biosemi 64

Emilie Caspar ecaspar at ulb.ac.be
Mon Mar 23 17:35:02 CET 2020


Dear all, 

I am trying to perform a source reconstruction on EEG data acquired with a Biosemi system with 64 electrodes. I am experiencing two issues at the moment, one associated to whether or not my source_model is correct (see figure in attachement) or not and the second one is a mistake associated with the code.

Here is the code I am using:

% cfg=[];
% cfg.layout='biosemi64.lay';
% d=ft_prepare_layout(cfg);
% 
% q=struct2cell(d);
% 
% zeroline = 92/40*50;
% 
% q{65,1} = 'nasion';
% q{65,2} = zeroline; %ten percent under FPz
% q{65,3} = q{33,3};
% 
% q{66,1} = 'inion';
% q{66,2} = zeroline; %ten percent under Oz
% q{66,3} = q{29,3};
% 
% q{67,1} = 'left';
% q{67,2} = -zeroline; %ten percent under T7
% q{67,3} = q{15,3};
% 
% q{67,1} = 'right';
% q{67,2} = zeroline; %ten percent under T8
% q{67,3} = q{52,3};

q=biosim64;
ph = table2array(q(:,2));
th = table2array(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);
 
vol = ft_read_headmodel('headmodel/standard_bem.mat');
 
% realign electrodes to headmodel
cfg = [];
cfg.method = 'interactive';
cfg.elec = elec;
cfg.headshape = vol.bnd(1); %1 = skin
elec = ft_electroderealign(cfg);
 
%save new electrodes
save elec64.mat elec

When I run the plot of the source model, it gives the output in attachement. But I really have no cue whether or not it sounds correct since this is the first time I am running this.

Then, we I run the ft_electroderealign, I have the following error message:
Error using table/length (line 419)
Undefined function 'length' for input arguments of type 'table'.  Use the HEIGHT, WIDTH,
or SIZE functions instead.

Do you have an easy solution to solve this? I could of course change the code in the ft_electroderealign but it’s probably not a good idea.


((((((((((other option:

I also tried to run it differently with what is in green (commented) based on an another example that I have found online (see http://www.fieldtriptoolbox.org/example/biosemi/#modify-layout-file <http://www.fieldtriptoolbox.org/example/biosemi/#modify-layout-file>). 
If I just use the same example it first lead to a mistake saying that Cell contents assignment to a non-cell array object. while it is exactly what is mentioned online. 
If I use a struct2cell q=struct2cell(d);, then I have the following error message Index exceeds matrix dimensions.))))))))))))

I am thus stuck with several different mistakes and since I have no one around who did this before, I am a bit lost on what to do and if what I am currently doing is correct.
Thank you in advance!
Emilie




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200323/be4f85f8/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Capture d'e?cran 2020-03-23 17.17.18.png
Type: image/png
Size: 132106 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200323/be4f85f8/attachment.png>


More information about the fieldtrip mailing list