Skip to content

Commit

Permalink
Display EEG on scalp: Use same smoothing as for the 2D/3D topo figures
Browse files Browse the repository at this point in the history
  • Loading branch information
ftadel committed Jan 27, 2020
1 parent 8551003 commit 87668e2
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions toolbox/gui/panel_surface.m
Expand Up @@ -1725,16 +1725,25 @@ function UpdateSurfaceProperties()
if isempty(TessInfo.DataWmat) || ...
(size(TessInfo.DataWmat,2) ~= length(selChan)) || ...
(size(TessInfo.DataWmat,1) ~= length(Vertices))
switch lower(GlobalData.DataSet(iDS).Figure(iFig).Id.Modality)
case 'eeg', excludeParam = .3;
case 'ecog', excludeParam = -.015;
case 'seeg', excludeParam = -.015;
case 'ecog+seeg', excludeParam = -.015;
case 'meg', excludeParam = .5;
otherwise, excludeParam = 0;
% EEG: Use smoothed display, as in 2D/3D topography
if strcmpi(GlobalData.DataSet(iDS).Figure(iFig).Id.Modality, 'eeg')
TopoInfo.UseSmoothing = 1;
TopoInfo.Modality = GlobalData.DataSet(iDS).Figure(iFig).Id.Modality;
Faces = get(TessInfo.hPatch, 'Faces');
[bfs_center, bfs_radius] = bst_bfs(Vertices);
TessInfo.DataWmat = figure_topo('GetInterpolation', iDS, iFig, TopoInfo, Vertices, Faces, bfs_center, bfs_radius, chan_loc);
else
switch lower(GlobalData.DataSet(iDS).Figure(iFig).Id.Modality)
case 'eeg', excludeParam = .3;
case 'ecog', excludeParam = -.015;
case 'seeg', excludeParam = -.015;
case 'ecog+seeg', excludeParam = -.015;
case 'meg', excludeParam = .5;
otherwise, excludeParam = 0;
end
nbNeigh = 4;
TessInfo.DataWmat = bst_shepards(Vertices, chan_loc, nbNeigh, excludeParam);
end
nbNeigh = 4;
TessInfo.DataWmat = bst_shepards(Vertices, chan_loc, nbNeigh, excludeParam);
end
% Set data for current time frame
TessInfo.Data = TessInfo.DataWmat * TessInfo.Data;
Expand Down

0 comments on commit 87668e2

Please sign in to comment.