[FieldTrip] Dimension mismatch in .grad struct for neuromag data

George Wallis wallisgj at gmail.com
Thu Sep 13 15:26:55 CEST 2012

Dear fieldtrippers,

With neuromag306 data, after the old style of .grad gets converted to the
new style, the field have dimensions as follows:


ans =

       unit: 'mm'
      label: {306x1 cell}
    coilori: [510x3 double]
    coilpos: [510x3 double]
        lab: {102x3 cell}
    chanpos: [102x3 double]
    chanori: [102x3 double]
    balance: [1x1 struct]

Because there are three sensors in each location, there are 1/3 as many
elements in chanpos as in coilpos.

However, in ft_combineplanar, where the function remakes the .grad field to
match the new list of channels (where the gradiometers have been combined),
is uses a list of channel indices 'sel' which is concatenated vertically:

sel      = [sel_comb(:);sel_other(:)];

...and indexes into newgrad.chanpos.  As above, newgrad.chanpos is 102x3,
but sel is 204x1: 102 combined gradiometers ('sel_comb') plus 102
magnetometers ('sel_other').  There is therefore a dimension mismatch,
because the different channel types are 'overlaid' in 'chanpos' but not in

Have I set up my .chanpos, .chanori incorrectly?

Thanks for any tips,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20120913/24a90364/attachment-0001.html>

More information about the fieldtrip mailing list