[FieldTrip] a question in neighbours and channelrepair

masoud masoudheshmatibnd at gmail.com
Mon Feb 28 09:35:21 CET 2022


Hello, I am currently using the fieldtrip matlab toolbox for preprocessing
an EEG dataset. I want to interpolate the CZ channel with its neighbours,
all three methods of  ft_prepare_neighbours  function have been used.
1- I used the distance method in  ft_prepare_neighbours function but the
output is:
Warning: no neighbours found for CZ
 In ft_prepare_neighbours at line 384

Warning: No neighbouring channels were specified or found
 In ft_prepare_neighbours at line 390           (I changed the value of
cfg.neighbourdist multiple times but no changes has occurred)

2- The output of the triangulation method is:
Error using delaunay
At least three input points must be provided to define a triangular mesh.
          (how can i provide these inputs?)

Error in ft_prepare_neighbours (line 275)
    tri = delaunay(prj(:,1), prj(:,2));

3- for the template method I made a custom neighbourhood templated with the
file that you have shared on github, it works fine and I even tested it
through ft_neighbourplot and the answer was still correct, the output of
ft_neighbourplot was:
Selected channel CZ, which has 8 neighbours: FC1, FCZ, FC2, C1, C2, CP1,
CPZ, CP2
But when I tried ft_channelrepair function the output was:
Error using cell/unique>celluniqueR2012a (line 249)
Elements of cell array input A must be character vectors (row vectors of
class char).

Error in cell/unique (line 142)
        [varargout{1:nlhs}] =
celluniqueR2012a(varargin{1},logical(flaginds(1:5)));

Error in cell/setdiff>cellsetdiffR2012a (line 303)
    uA = unique(a,order);

Error in cell/setdiff (line 129)
        [varargout{1:nlhs}] =
cellsetdiffR2012a(varargin{1:2},logical(flaginds(1:3)));

Error in ft_channelrepair (line 204)
cfg.missingchannel = setdiff(cfg.missingchannel, data.label, 'stable');

the summary of the code is:
cfg.channel = {'CZ'};
cfg.method = 'template';
cfg.layout = 'layout.mat';
cfg.template = 'neighbours.mat';
neighbours = ft_prepare_neighbours(cfg, data);
cfg.badchannel     = 'CZ';
cfg.method         = 'average';
cfg.neighbours     = neighbours;
data_fixed = ft_channelrepair(cfg,data);

Would you mind please helping me with this problem?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20220228/45225b60/attachment.htm>


More information about the fieldtrip mailing list