[FieldTrip] Error in dim when plotting results with ft_sourceplot

CHATEAUX Manon manon.CHATEAUX at univ-amu.fr
Tue Nov 23 12:11:11 CET 2021


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


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


More information about the fieldtrip mailing list