[FieldTrip] ft_sourceplot and ft_sourceinterpolate with ECoG data

Brian Silverstein bsilverstein at gmail.com
Tue Nov 5 19:00:11 CET 2019


Hello Fieldtrip Community,

I just pulled the latest version of FieldTrip and my ECoG functional
plotting pipeline no longer works. There seems to have been changes to
ft_sourceplot that aren't reflected in the tutorials/examples. In the past,
I was able to follow the ECoG example workflow without issues, but now I'm
running into a lot of bugs/roadblocks. Specifically, it seems like I now
need to first pass my data through ft_sourceinterpolate instead of passing
the functional and anatomical data directly to ft_sourceplot, otherwise i
get errors. However, my data doesn't seem to play nicely with
ft_sourceinterpolate. I don't get errors, but I do get unexpected results.
The resulting interpolated data appears to be in a rotated coordinate
space.

I'm using ft_sourceinterpolate to create triangular mesh data, appending it
to the functional data structure, then sending it to ft_sourceplot. I then
use hold on and ft_plot_sens to add electrode locations. As you can see in
the left side of the attached plot, the functional data looks like it's
rotated 90 degrees clockwise with respect to the electrode locations (the
electrode locations are correct). Everything starts in the same coordinate
space, so I'm guessing a transformation is being applied in
ft_sourceinterpolate that I haven't been able to track down.

My code is pasted below.

Any help would be appreciated. I suppose I could just downgrade to a
previous version, but I prefer to stay current, if possible. :)

Thanks!
Brian

[image: image.png]

My code:
    %% Grab N1 peaks
    dataN1 = [];
    dataN1.peaks = peaks_pairs(:,2,e) .*
~summary.stimpair(stimpair).badchans;
    dataN1.elec = summary.elec;
    dataN1.label = summary.elec.label;
    dataN1.dimord = 'chan';

    %% Interpolate N1 peaks onto surface
    cfgInterp.parameter='peaks';
    out = ft_sourceinterpolate(cfgInterp,dataN1,pial);
    dataN1.coordsys = out.coordsys;
    dataN1.pos = out.pos;
    dataN1.tri = out.tri;
    dataN1.inside = out.inside;
    dataN1.peaks = out.peaks;

%% 3D plot settings
    cfg = [];
    cfg.method = 'surface';
    cfg.funparameter = 'peaks';
    cfg.sphereradius = 7;
    cfg.camlight = 'no';
    cfg.funcolorlim = [min(peaks_pairs(:,2,e)) 0];
    cfg.maskparameter  = cfg.funparameter;
    cfg.opacitylim = [-1 0];
    cfg.opacitymap = 'rampdown';
    cfg.colorbartext = '-log(abs(uV))';

 %% Plot real peaks and latencies
    ft_sourceplot(cfg,dataN1)
    colormap(rgbPeak)
    hold on;
    ft_plot_sens(summary.elec,'facecolor', rgbLat);
    view([90*orient 0]);
    lighting gouraud;
    camlight;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20191105/6efdb301/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 629148 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20191105/6efdb301/attachment-0001.png>


More information about the fieldtrip mailing list