[FieldTrip] Error in dim when plotting results with ft_sourceplot

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Wed Nov 24 13:06:26 CET 2021


Hi Manon,

It would be helpful if you share some details of your variables ‘gray’, and 'source_MEG’.

Also, note that if you intend to plot a source structure that is already defined on a surface, you need to include the exact same topological surface (in terms of number of vertices and in terms of the defined triangles). If there is no match FT will try and interpolate the functional values in the input source structure onto the surface, thereby assuming that the functional values are defined on a well-defined 3D grid. In your situation this does not seem to be the case.

Best wishes,
Jan-Mathijs


On 23 Nov 2021, at 12:11, CHATEAUX Manon via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:

Dear Fieldtrip community,

I am trying to plot results on a mesh I created from a participant’s MRI. For this I use the following code :

cfg               = [];
cfg.funparameter  = 'pow';
cfg.method        = 'surface';
cfg.surffile      = gray;
cfg.funcolormap   = 'jet';
cfg.opacitymap    = 'rampup';
cfg.maskparameter = 'pow';
cfg.camlight      = 'yes';
ft_sourceplot(cfg, source_MEG);

source_MEG actually contains data in the frequency domain for one frequency point only, for sources that are on the “surface” of the gray matter.

It works well for sub-01 but, with the same code, I get the following error for sub-02 :

the input is source data with 10000 brainordinates
the call to "ft_selectdata" took 1 seconds
not plotting anatomy
not using an atlas
not using a region-of-interest
The source functional does not contain a triangulated surface, we may need to interpolate to a surface mesh

The logical indices in position 2 contain a true value outside of the array bounds.

Error in pos2transform (line 33)
transform = pos(:,sel)/ind(:,sel);

Error in ft_sourceplot (line 1137)
      functional.transform = pos2transform(functional.pos);

I looked into it a bit, and I could note that :

  1.  The number of columns in ind is lower than the one in pos for sub-02, and this exactly describes the error.
  2.  There is a problem when computing dim at l.20 of pos2transform.m :dim = pos2dim(pos);
dim = [16,1,625] for sub-01 and dim = [55,1,181.8182] for sub-02. Having a decimal number in dim is incorrect right?
  3.  When replacing dim = [55,1,181.8182] by dim = [16,1,625], when running the script for sub-02, I don’t get any error but I don’t know if it is ok to do that and if I can interpret the results.
  4.  I tried plotting sub-01 results on sub-02 mesh and it worked fine so there is nothing wrong with sub-02 mesh.


I don’t really understand what this part of ft_sourceplot does so I don’t know what to do and how to solve the problem.

Thank you very much for your help!


Manon Châteaux


_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!8x2La1IYmhTMmRfZu62wYsIixbu2dxX6P_AiTrWbh7kQASTJBygwlGl8LP3ky2mdH6vtlUCeSGt3J4GlrTGB_16pjOQGnUsjXdttTQ$

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20211124/8ce7c479/attachment.htm>


More information about the fieldtrip mailing list