[FieldTrip] source pos dimensions ft_sourcestatistics

Stephen Whitmarsh stephen.whitmarsh at gmail.com
Fri Jun 23 16:28:01 CEST 2017


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> 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>
> 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
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
>
>
> _______________________________________________
> fieldtrip mailing list
> 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/20170623/9a35b009/attachment-0001.html>


More information about the fieldtrip mailing list