[FieldTrip] Channel order after interpolation

Julian Keil julian.keil at gmail.com
Thu Mar 23 09:44:38 CET 2017

Dear Arti,

if you know exactly where your channels are, and where they ought to be, you can simply build a vector with the index of the current channel at the position where it should be, and assign this vector as a new matrix index.

So for example, if you have channels A, B and C, but they should be ordered B-C-A, you can use something like this:
neworder = [2 3 1]; % Element 2, should now be at the beginning, then the third element, and then the first;
data.avg = data.avg(neworder,:); % Assign neworder to the 2D-Matrix of - for example - trial averaged data

Hope this helps,


Am 23.03.2017 um 07:09 schrieb Arti Abhishek:

> Dear list,
> I am working with 128 channel EEG data recorded from infants and young children. As they had few bad channels, I removed them, computed ICA, removed eye-blink components and then interpolated the removed channels. The interpolated channels were appended at the end, not at their original positions. Is there a way I can add the interpolated channels in the original order? I want to run some scripts outside fieldtrip on the data and the channel order is important. Any help would be greatly appreciated.
> Thanks,
> Arti
> cfg                     =[];
> cfg.layout              = 'GSN-Hydrocel-129.sfp';
> lay                     = ft_prepare_layout(cfg);
> cfg                     = [];
> cfg_neighb.layout       = lay;
> cfg_neighb.method       = 'triangulation';
> cfg.feedback            = 'yes';
> EEG_neighbours          = ft_prepare_neighbours(cfg_neighb);
> load('NJ_24_ica_artrej.mat')
> badchannels            = setdiff(lay.label(1:129), NJ_24_ica_artrej.label);
> cfg                     = [];
> cfg.layout              = lay;
> cfg.neighbours          = EEG_neighbours;
> cfg.badchannel          = badchannels;
> cfg.method              ='spline';
> cfg.senstype            = 'EEG';
> NJ_24_ica_interp   = ft_channelrepair(cfg, NJ_24_ica_artrej);
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20170323/0337d62f/attachment-0002.sig>

More information about the fieldtrip mailing list