[FieldTrip] issues with ft_connectivityanalysis, interpolation, and parcellation in EEG

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Tue May 21 20:30:36 CEST 2019


Hi Christian,

I guess you need to figure out why the dimension of the coherence matrix does not match the expectations.
Based on the information you provide (i.e. the lack thereof: it’s not clear how you compute SourceData, and how you spectrally transformed your sensor data that goes into the source reconstruction step) there is lottle to go on.

Best wishes,
Jan-Mathijs



On 21 May 2019, at 19:27, Christian Mista <cmista at ingenieria.uner.edu.ar<mailto:cmista at ingenieria.uner.edu.ar>> wrote:

Hi FieldTrip community,

I've been trying to perform a connectivity analysis using a 66 eeg recording database. So far, I've being able to solve the sourceanalysis (following the tutorial http://www.fieldtriptoolbox.org/tutorial/networkanalysis/) and plot the source activity. However, the problem starts when I'm trying the connectivity analysis. Any grid dimension lower than 20 mm in the sourcemodel calculation results in a matlab error (Out of memory) in the connectivity analysis. I guess that a grid dimension lower than 20 mm conveys to huge matrix sizes, not manageable by my OS (linux + Matlab).

%% This is how I compute the sourcemodel (run ok)
    cfg                 = [];
    cfg.elec            = data.elec;
    cfg.elec.unit = 'mm';                   % unit in cm
    cfg.headmodel       = headmodel;
    cfg.grid.resolution = 20;     % use a 3-D grid with a 20 mm resolution
    [lf] = ft_prepare_leadfield(cfg);


After computing the sourcemodel using the 20 mm grid, I have issues to parcellate my data. My main concern is about the mismatch size between the connectivity matrix and the atlas.

source_conn =
          dim: [7 9 8]
       inside: [504×1 logical]
          pos: [504×3 double]
    cohspctrm: [5544×5544 double]
       dimord: 'pos_pos_freq'
         freq: 10
          cfg: [1×1 struct]


atlas =
            dim: [91 109 91]
            hdr: [1×1 struct]
      transform: [4×4 double]
           unit: 'mm'
         tissue: [91×109×91 double]
    tissuelabel: {1×116 cell}
       coordsys: 'mni'

I'd tried to interpolate and parcellate the matrix, but I must be missing or confusing something... Below is the code to calculate the connectivity and the parcellation.

%% connectivity
    cfg         = [];
    cfg.method  = 'coh';
    cfg.complex = 'absimag';
    source_conn = ft_connectivityanalysis(cfg, SourceData);

    %The conectome
    figure;imagesc(source_conn.cohspctrm); %5544x5544 double

    %Parcellation
    atlas = ft_read_atlas('/fieldtrip-master/template/atlas/aal/ROI_MNI_V4.nii');

    cfg = [];
    cfg.interpmethod='nearest';
    cfg.parameter='tissue';
    [int_atlas] = ft_sourceinterpolate(cfg, atlas, source_conn);
    int_atlas.pos = source_conn.pos; % otherwise the parcellation won't work

    % and call ft_sourceparcellate:
    cfg = [];
    cfg.parcellation = 'tissue';
    cfg.parameter    = 'cohspctrm';
    parc_conn = ft_sourceparcellate(cfg, source_conn, int_atlas);

    figure;imagesc(parc_conn.cohspctrm);

++Error in command windows matlab

there are in total 504 positions, 230 positions are inside the brain, 181 positions have a label
168 of the positions inside the brain have a label
168 of the labeled positions are inside the brain
62 of the positions inside the brain do not have a label
Error using ft_notification (line 340)
unsupported dimord unknown_unknown_freq

Error in ft_error (line 39)
  ft_notification(varargin{:});

Error in ft_sourceparcellate (line 309)
    ft_error('unsupported dimord %s', dimord{i})

Two questions
-Is 20 mm the min grid size to calculate connectivity?
-What I'm missing in the parcellation process?

I would really appreciate any advice, I've been scratching my head for a while on this one.

Best,
Christian
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190521/4882334f/attachment-0002.html>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202


More information about the fieldtrip mailing list