[FieldTrip] source pos dimensions ft_sourcestatistics

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Sat Jun 24 09:30:27 CEST 2017


Hi Stephen,

The error suggests that Fieldtrip does not manage to guess whether the set of dipole positions are defined on a regular grid, or whether it’s on a 2D mesh. Your source structure either needs a ‘dim’ field (if indeed the positions describe a full 3D grid in an ordered way), or it needs a ‘tri’, defining the edges between the nodes.

Best,
JM


J.M.Schoffelen, MD PhD
Senior Researcher, VIDI-fellow - PI, language in interaction
Telephone: +31-24-3614793
Physical location: room 00.028
Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands

On 23 Jun 2017, at 16:28, Stephen Whitmarsh <stephen.whitmarsh at gmail.com<mailto:stephen.whitmarsh at gmail.com>> wrote:

Dear Jan-Mathijs,

Thanks, I've been away but back on it now.
I've been going over it again, and while plotting works fine (after sourceinterpolate), sourcestatistics still throws the same error. Just to be clear - i am using/creating current source-level datastructures and without complicating things, I end up with the following data structures that go into sourceanalysis.

         pos: [2982×3 double]
        freq: 10.5000
         cfg: [1×1 struct]
          MI: [2982×1 double]
      inside: [2982×1 logical]
    MIdimord: 'pos'

The error I keep getting is:

Error using spm_bwlabel
spm_bwlabel: CONN must be 6, 18 or 26

Error in clusterstat (line 222)
      [negclusobs, negnum] = spm_bwlabel(tmp, 2*numdims);

Error in ft_statistics_montecarlo (line 347)
  [stat, cfg] = clusterstat(cfg, statrand, statobs);

Error in ft_sourcestatistics (line 205)
  [stat, cfg] = statmethod(cfg, dat, design);

It's a mystery what might be wrong. Would you have any further leads?

Thanks again,
Stephen

On 18 May 2017 at 21:35, Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>> wrote:
Hi Stephen,

source2full and source2sparse are probably quite outdated, and do not seem to work well anymore with the latest type of source-level data structures. Most relevantly, the inside field these days is by default a boolean vector of size nposx1, whereas once upon a time the inside and outside fields together contained the indices of the dipole positions, indicating which positions are on the in-/outside.

Do you need the source2sparse step to begin with?

Best,
JM



On 17 May 2017, at 16:46, Stephen Whitmarsh <stephen.whitmarsh at gmail.com<mailto:stephen.whitmarsh at gmail.com>> wrote:

Hi there,


After beamformer sourceanalysis I end up with datastructures looking like:

  struct with fields:

         freq: 10.5000
          cfg: [1×1 struct]
          pos: [2982×3 double]
          pow: [2982×1 double]
       inside: [2982×1 logical]
    powdimord: 'pos'

The .inside field is created by ft_selectdata used to average across frequencies, and contains all 1s. Running sourceanalysis with this data trows the following error:


Error using spm_bwlabel
spm_bwlabel: CONN must be 6, 18 or 26

Error in clusterstat (line 222)
      [negclusobs, negnum] = spm_bwlabel(tmp, 2*numdims);

Error in ft_statistics_montecarlo (line 347)
  [stat, cfg] = clusterstat(cfg, statrand, statobs);

Error in ft_sourcestatistics (line 205)
  [stat, cfg] = statmethod(cfg, dat, design);

222       [negclusobs, negnum] = spm_bwlabel(tmp, 2*numdims);


I think this results because of a wrong estimate of the dimensionality, resulting from the fact that the data is represented in an array rather than a 3-dimensional matrix, which it seems to expect.

I think therefor that I might need to convert my data back into a 3-d representation, i..e not a sparse but full representation. I have tried using ft_source2full, but that is not straightforward as I only have inside voxels/positions. In other words, I would need to do exactly the same as ft_source_statistics seems to want to do with spm_bwlabel.

So I guess I might just have put FieldTrip on the wrong leg, to use a Dutch expression.

Any suggestions?

Best,
Stephen


_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip


_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip

_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20170624/8f0e509b/attachment-0002.html>


More information about the fieldtrip mailing list