[FieldTrip] Error when running ft_sourceanalysis with stats across two conditions

Maris Skujevskis icelandhouse at gmail.com
Tue Apr 11 12:13:42 CEST 2017


Dear Fieldtrip developers/source localizing experts,

I get an error when running ft_sourceanalysis on two EEG conditions with
the statistical testing (permutation) enabled (no issues with single
condition and no statistics).
As far as I can see, I am doing everything right (as per  ft_sourceanalysis
reference page; my fieldtrip version: fieldtrip-20161122). Please correct
me where I am wrong or ask for more information in case what I
paste/explain below is not sufficient.

CODE INPUT:

    cfg                            = [];
    cfg.method               = 'dics';
    cfg.frequency           = 10;
    cfg.grid                     = leadfield;
    cfg.keepleadfield      = 'no';
    cfg.headmodel          = vol;
    cfg.dics.keepfilter      = 'yes';
    cfg.dics.lambda         = '5%';
    cfg.dics.fixedori         = 'yes';
    cfg.dics.keepmom      = 'yes';
    cfg.dics.realfilter        = 'yes';
    cfg.grid.filter              = source_cmb.avg.filter;
    cfg.permutation         = 'yes';
    cfg.numpermutation   = 500;

    sourceStatsAB = ft_sourceanalysis(cfg, condA, condB);

COMMAND WINDOW OUTPUT:

the input is freq data with 128 channels, 1 frequencybins and no timebins
the input is freq data with 128 channels, 1 frequencybins and no timebins
the call to "ft_selectdata" took 0 seconds
converting the linearly indexed channelcombinations into a square CSD-matrix
using electrodes specified in the data
converting units from 'cm' to 'mm'
determining source compartment (3)
projecting electrodes on skin surface
combining electrode transfer and system matrix
creating dipole grid based on user specified dipole positions
using gradiometers specified in the configuration
5124 dipoles inside, 0 dipoles outside brain
the call to "ft_prepare_sourcemodel" took 0 seconds
the call to "ft_selectdata" took 0 seconds
the call to "ft_selectdata" took 0 seconds
2 conditions, each with 3 data objects
averaging 182 replications for one condition
averaging 182 replications for one condition
2 conditions, each with 3 data objects
 <<<<<<<<<<<<<---------- what are the "3 data objects"?
creating 100 random permutations from total 6.129982e+54

HERE COMES THE ERROR:

Error using prepare_resampled_data (line 381)
the dimensions should be the same for every condition

Error in ft_sourceanalysis (line 561)
    [dum, rnd_aCf, rnd_aCr, rnd_aPr, rnd_bCf, rnd_bCr, rnd_bPr] =
prepare_resampled_data(cfg, aCf, aCr, aPr, bCf, bCr, bPr);


When checking the function prepare_resampled_data, it turns out that it
requires a cell named "datain" to have the same size matrices column-wise
(whatever the columns may represent) :

datain =

    [182x128x128 double]    [182x128 double]    [182x1 double]
    [182x128x128 double]    [  1x128 double]    [         NaN]


My input data condA and condB have identical dimensions, so I have no idea
what has gone wrong here:

condA =

           label: {128x1 cell}
       dimord: 'rpt_chan_freq'
           freq: 9.8462
powspctrm: [182x128 double]
   labelcmb: {8128x2 cell}
  crsspctrm: [182x8128 double]
cumsumcnt: [182x1 double]
  cumtapcnt: [182x1 double]
            elec: [1x1 struct]
       trialinfo: [182x22 double]
             cfg: [1x1 struct]

condB =

          label: {128x1 cell}
       dimord: 'rpt_chan_freq'
            freq: 9.8462
 powspctrm: [182x128 double]
    labelcmb: {8128x2 cell}
   crsspctrm: [182x8128 double]
 cumsumcnt: [182x1 double]
  cumtapcnt: [182x1 double]
            elec: [1x1 struct]
       trialinfo: [182x22 double]
             cfg: [1x1 struct]




Thanks for your input!

Best wishes,
Maris





On Sun, Apr 9, 2017 at 12:00 PM, <fieldtrip-request at science.ru.nl> wrote:

> Send fieldtrip mailing list submissions to
>         fieldtrip at science.ru.nl
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> or, via email, send a message with subject or body 'help' to
>         fieldtrip-request at science.ru.nl
>
> You can reach the person managing the list at
>         fieldtrip-owner at science.ru.nl
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of fieldtrip digest..."
>
>
> Today's Topics:
>
>    1. error in source parcellation and source connectivity      analysis
>       (velmurugan jayabal)
>    2. Problem with Matlab system commands in OS X (XTerm, Logout,
>       crash, sleep mode) (Markus Gschwind)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sat, 8 Apr 2017 17:54:43 -0700
> From: velmurugan jayabal <velmurugan.nimhans at gmail.com>
> To: fieldtrip at science.ru.nl
> Subject: [FieldTrip] error in source parcellation and source
>         connectivity    analysis
> Message-ID:
>         <CAKmRZP1gp6W54S4aKPDXAU_4uZQa1LzWQiobxn7uDpR8MN-Wmw@
> mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Dear Field-trip community,
>
> I am having the following errors when computing connectivity
> analysis. Please any help in this regard would be highly appreciated.
> Thanks in advance.
>
> 1. How to compute atlas based source model grid, from MMP atlas?. Since MMP
> atlas doesn't contain the *dim *field, the ft_volumelookup function doesn't
> work prompting me the same error.
>
>
> 2. Alternatively, I had created AAL atlas based source model grid and used
> to compute source connectivity (img.coh) from PCC beamformer source output.
> But, I am unable to compute the connectivity value for each parcel using
> ft_sourceparcellate. I am writing the codes used to derive the same.
>
> 3. Is there any acronym or a clear explanation for the parcellation label?.
> I had read Glasser et al 2016 paper and their resource site. But, I
> couldn't get complete names or explanation for all the ROIs.
>
>
> CODE:
> %source is the output of pcc beamformer results.
> cfg         = [];
> cfg.method  ='coh';
> cfg.complex = 'absimag';
> source_conn_imcoh = ft_connectivityanalysis(cfg, source);
>
> atlas =ft_read_atlas ('ROI_MNI_V5.nii');
> atlas.pos =source_conn_imcoh.pos;
> cfg =[];
> cfg.method ='mean'
> cfg.parameter ='cohspctrm';
> cfg.parcellation = 'tissue';
> parc_conn= ft_sourceparcellate(cfg,source_conn, atlas);
>
> I had even tried computing source connectivity interpolation on the atlas
> before parcellation. But, I am getting a huge array > 50 GB, which exceeds
> my MATLAB and system limit.
>
>
> --
> - sincerely,
> *Velmurugan Jayabal,*
> *Magnetoencephalography (MEG) research centre,*
> *Department of Clinical Neurosciences,*
>
> *National Institute of Mental Health and Neurosciences (NIMHANS),*
> *Bangalore - 560029, Karnataka, India*
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/
> attachments/20170408/ede3c3c1/attachment-0001.html>
>
> ------------------------------
>
> Message: 2
> Date: Sun, 9 Apr 2017 11:18:21 +0200
> From: Markus Gschwind <Markus.Gschwind at unige.ch>
> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
> Subject: [FieldTrip] Problem with Matlab system commands in OS X
>         (XTerm, Logout, crash, sleep mode)
> Message-ID:
>         <CABaUQnyQcLUwAyxxyEfaVYw73Ryxct=sLxe_rV++Qr-zdDgz9w at mail.
> gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Dear all,
>
> I hope to find here an expert who knows an answer to the following problem:
>
> I am running Matlab on OSX 10.9.5 started from the Xterm, and I am not able
> to run big and lengthy matlab jobs because at each logout (which occurs
> after 2h), Matlab crashes, all results are gone (if they are not save to
> the HD and XTerm closes.
>
> I start Matlab form the XTerm (and not by clicking the App Icon) in order
> to be able to run system (unix) commands within Matlab.
>
> I guess, this behaviour is proper to XTerm, and in case I could find an
> other way to run system commands from Matlab, probably this could be
> resolved.
>
> Could it be that the running matlab job is not visible to the system which
> goes to sleep??
>
> For info here the power management info:
>
> $ pmset -g custom
> Battery Power:
>  lidwake              1
>  autopoweroff         1
>  autopoweroffdelay    14400
>  standbydelay         18000
>  standby              1
>  ttyskeepawake        0
>  hibernatemode        3
>  gpuswitch            2
>  hibernatefile        /var/vm/sleepimage
>  displaysleep         2
>  sleep                0
>  acwake               1
>  halfdim              1
>  sms                  1
>  lessbright           1
>  disksleep            10
> AC Power:
>  lidwake              1
>  autopoweroff         1
>  autopoweroffdelay    14400
>  standbydelay         18000
>  standby              0
>  ttyskeepawake        1
>  hibernatemode        3
>  gpuswitch            2
>  hibernatefile        /var/vm/sleepimage
>  womp                 1
>  displaysleep         3
>  networkoversleep     0
>  sleep                0
>  acwake               0
>  halfdim              1
>  sms                  1
>  disksleep            60
>
>
> Many thanks for help!
> Markus
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/
> attachments/20170409/ce9b8000/attachment-0001.html>
>
> ------------------------------
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
> End of fieldtrip Digest, Vol 77, Issue 6
> ****************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20170411/3d323db9/attachment-0001.html>


More information about the fieldtrip mailing list