[FieldTrip] ft_sourceplot

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Tue Aug 8 11:39:02 CEST 2023


Hi Benedikt,

Given that your functional data is very sparse, i.e. it contains a lot of NaNs, I don’t think that you can expect anything miraculous from the interpolation algorithm. With the sphere_avg method I suspect that NaNs are not ignored, and plain averaging of a vector that contain NaNs, will result in a NaN output.

However, it looks as if you have a few functional values computed for a bunch of anatomical parcels. If I would compute and visualize this, I would use a route that combines ft_sourceanalysis with ft_virtualchannel, and then use ft_sourceplot without an explicit call to ft_sourceinterpolate (which will then be applied under the hood).

Best wishes,

Jan-Mathijs

On 26 Jul 2023, at 18:15, Benedikt Wahl via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:

Dear Fieldtrip Community,

I am having some problems getting my interpolated statistic to plot and end up with a strange “swiss cheese” type image (see attached picture).

Specifically, I am trying to interpolate an arbitrary statistic (“Func” below) to the template anatomical.

Func =

  struct with fields:

     stat: [681×1 double]
      pos: [681×3 double]
    label: {681×1 cell}

My functional data has a lower resolution than the MRI and so the “pos” field wont line up with the anatomical. I am thus trying to use ft_sourceinterpolate “sphere_avg” method to thus map between the two:

% load template
templatefile = [ftpath '/template/anatomy/single_subj_T1.nii'];
template_mri = ft_read_mri(templatefile);
template_mri.coordsys = 'spm';

% run interpolation
cfg = [];
cfg.interpmethod = 'sphere_avg';
cfg.parameter = 'stat';
cfg.sphereradius = 20;
cfg.downsample    = 1;
src = ft_sourceinterpolate(cfg, Func, template_mri);

And then plot the resulting statistics overlaid with the anatomical in ortho view:

% plot
cfg              = [];
cfg.method       = 'ortho';
cfg.funparameter = 'stat';
cfg.opacitymap    = 'vup';
ft_sourceplot(cfg,src);

Running the code, the coefficients don’t stretch out over the whole brain (see attached picture). How could I fix that?

The code as well as the necessary variables are attached to this mail.

Thank you very much!

Benedikt Wahl

<sourceplot.png><sourceplot_variables.mat><sourceplot_codepiece.m>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!7Bp5vyw60N11bNuXWTIud02wPAONnBQLjmN-6Kn6mxxDOHZLOE_6gkUZQb0grmhYbATAAngw7CudHtL8b3D1yj7OQ0IOJlWr6ZAxgg$

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


More information about the fieldtrip mailing list