[FieldTrip] matrix multiplication error in ft_sourcedescriptives

Philip Cho pnc9 at georgetown.edu
Sat Nov 14 22:04:39 CET 2020


Hi Jan-Mathijs,

Thank you so much for your help. That did seem to fix the bulk of my
problem, and I'm now able to view the movie. That being said, I am somewhat
surprised by this fix. I had never explicitly written cfg.backproject =
'no' in my previous code, and the description of the ft_prepare_leadfield
function claims that the default setting for cfg.backproject is 'yes'. I
strangely have to explicitly write cfg.backproject = 'yes' in my forward
model script. Is this expected?

Additionally, although I'm now able to view the movies, I am getting a
warning claiming

Warning could not determine dimord of "noisecov" in:
 time: [1×1020 double]
         cfg: [1×1 struct]
      inside: [8196×1 logical]
         pos: [8196×3 double]
         tri: [16384×3 int32]
         mom: {8196×1 cell}
         pow: [8196×1020 double]
    noisecov: {8196×1 cell}
         phi: [8196×1 double]
         ori: {8196×1 cell}
       noise: [8196×1 double]

If any input can be given as to what this might mean, it would also be
greatly appreciated. I suspect that this should be the last obstacle I face
with this analysis. Thank you!

Best,
Philip

On Wed, Nov 11, 2020 at 3:43 AM Schoffelen, J.M. (Jan Mathijs) <
jan.schoffelen at donders.ru.nl> wrote:

> Hi Philip,
>
> It could be that your error is caused by the fact that you computed your
> forward model (ft_prepare_leadfield), using cfg.backproject = ’no’.
> Consequently, the dipole specific leadfields are of dimensionality Nchan x
> 2, rather than the ’normal’, Nchan x 3. Some of the derived measures
> obtained from ft_sourceanlaysis (using the Nchan x 2 leadfields) then have
> dimensions that are 2 x something, or something x 2, rather than the more
> conventional … x 3. One of these derived measures might be the ‘ori’ field,
> that ft_sourcedescriptives complains about. Long story short, the
> cfg.backproject = ’no’ option in ft_prepare_leadfield is apparently
> incompatible with the computation of the ‘phi’ variable in
> ft_sourcedescriptives.
> The phi variable seems to quantify the (cosine of) the angle between the
> orientation of the reconstructed source, and the local normal of the
> cortical sheet. With un-backprojected (and rank reduced) leadfields, the
> (implicit) axes of the coordinate system that spans the plane in which the
> leadfield lives are incompatible with the implicit axes of the coordinate
> system that spans the 3D space in which the cortex lives. In other words,
> the issue is not only an incompatibility between the numbers 2 and 3, but
> it goes a bit deeper than that.
>
> Assuming that my diagnosis is correct, the short term solution for you
> would be to re-run the source reconstruction pipeline (including the
> ft_prepare_leadfield step with cfg.backproject = ‘yes’).
> The somewhat longer term solution would be to implement an error check
> (dispreferred because it’s more like a band aid), or impose some stricter
> consistency between the assumed coordinate systems of the different
> attributes of individual dipoles.
>
> Best wishes,
> Jan-Mathijs
>
>
>
> On 11 Nov 2020, at 04:12, Philip Cho <pnc9 at georgetown.edu> wrote:
>
> Hello Fieldtrip Community,
>
> I'm a new Fieldtrip user, and I'd appreciate any help I can receive. I'm
> currently working on MEG source reconstruction of an averaged event-related
> field from a single subject. I believe I have completed most of the steps,
> and I'm able to view my results at a given time using ft_plot_mesh. What I
> want to do now is view a movie of the activity, but for reasons I do not
> fully understand, I am having trouble obtaining the descriptive parameters
> of my results, which I believe is a parameter I must feed into
> ft_sourcemovie.
>
> In particular, when I run ft_sourcedescriptives, I obtain the following
> error:
>
> Error using  *
> Incorrect dimensions for matrix multiplication. Check that the number of
> columns in the first matrix matches the number of rows in the second
> matrix. To perform elementwise multiplication, use
> '.*'.
>
> Error in ft_sourcedescriptives (line 619)
>         source.avg.phi(diplop) = source.avg.ori{diplop}*nrm(diplop,:)';
>
> Error in mous_sourcemovie (line 7)
> sd  = ft_sourcedescriptives(cfg,source_allWords);
>
>
>
> It looks like source.avg.ori{diplop}  is a 1x2 array, while nrm(diplop,:)'
> is a 3x1 array. Please let me know if there is a possible fix to this
> error. If any additional information is needed, I would also be happy to
> send it out. Any advice would be deeply appreciated.
>
>
> Best,
> Philip
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
>
> _______________________________________________
> 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/20201114/90463bf0/attachment.htm>


More information about the fieldtrip mailing list