<div dir="ltr">Hello Fieldtrip Community,<br>
<br><div>I just pulled the latest version of FieldTrip and my ECoG functional plotting pipeline no longer works. There seems to have been changes to <span style="font-family:monospace">ft_sourceplot</span> 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 <span style="font-family:monospace">ft_sourceinterpolate</span> instead of passing the functional and anatomical data directly to <span style="font-family:monospace">ft_sourceplot</span>, otherwise i get errors. However, my data doesn't seem to play nicely with<span style="font-family:monospace"> ft_sourceinterpolate</span>. I don't get errors, but I do get unexpected results. The resulting interpolated data appears to be in a rotated coordinate space. <br></div><div><br></div><div>I'm using <span style="font-family:monospace">ft_sourceinterpolate</span> to create triangular mesh data, appending it to the functional data structure, then sending it to <span style="font-family:monospace">ft_sourceplot</span>. I then use <span style="font-family:monospace">hold on <font face="arial,sans-serif">and </font>ft_plot_sens <font face="arial,sans-serif">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 </font>ft_sourceinterpolate<font face="arial,sans-serif"> that I haven't been able to track down.</font></span></div><div><span style="font-family:monospace"><font face="arial,sans-serif"><br></font></span></div><div><span style="font-family:monospace"><font face="arial,sans-serif">My code is pasted below.<br></font></span></div><div><span style="font-family:monospace"><font face="arial,sans-serif"><br></font></span></div><div><span style="font-family:monospace"><font face="arial,sans-serif">Any help would be appreciated. I suppose I could just downgrade to a previous version, but I prefer to stay current, if possible. :)</font></span></div><div><span style="font-family:monospace"><font face="arial,sans-serif"><br></font></span></div><div><span style="font-family:monospace"><font face="arial,sans-serif">Thanks!</font></span></div><div><span style="font-family:monospace"><font face="arial,sans-serif">Brian</font></span><br></div><div><br></div><div><div><img src="cid:ii_k2m4ydgi0" alt="image.png" width="546" height="371"></div><div><br></div><div>My code:</div><div>    <span style="font-family:monospace">%% Grab N1 peaks<br></span></div><div><span style="font-family:monospace">    dataN1 = [];<br>    dataN1.peaks = peaks_pairs(:,2,e) .* ~summary.stimpair(stimpair).badchans;<br>    dataN1.elec = summary.elec;<br>    dataN1.label = summary.elec.label;<br>    dataN1.dimord = 'chan';</span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">    %% Interpolate N1 peaks onto surface<br>    cfgInterp.parameter='peaks';<br>    out = ft_sourceinterpolate(cfgInterp,dataN1,pial);<br>    dataN1.coordsys = out.coordsys;<br>    dataN1.pos = out.pos;<br>    dataN1.tri = out.tri;<br>    dataN1.inside = out.inside;<br>    dataN1.peaks = out.peaks;<br></span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">%% 3D plot settings<br>    cfg = [];<br>    cfg.method = 'surface';<br>    cfg.funparameter = 'peaks';<br>    cfg.sphereradius = 7;<br>    cfg.camlight = 'no';<br>    cfg.funcolorlim = [min(peaks_pairs(:,2,e)) 0];<br>    cfg.maskparameter  = cfg.funparameter;<br>    cfg.opacitylim = [-1 0];<br>    cfg.opacitymap = 'rampdown';<br>    cfg.colorbartext = '-log(abs(uV))';</span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace"> %% Plot real peaks and latencies<br>    ft_sourceplot(cfg,dataN1)<br>    colormap(rgbPeak)<br>    hold on;<br>    ft_plot_sens(summary.elec,'facecolor', rgbLat);<br>    view([90*orient 0]);<br>    lighting gouraud;<br>    camlight;</span><br></div></div></div>