When EEG/SEEG/ECOG data are displayed on a surface (head, gray matter, white matter, skull...), the values at the surface vertices are computed from the recordings using a 3D nearest-neighbor interpolation using Shepard's weighting.
This is done in the same way for temporal (EEG recordings), spectral (PSD) and time-frequency data.
The relevant functions:
https://en.wikipedia.org/wiki/Inverse_distance_weighting
disp('BST> All values are null. Please check your input file.');
end
end
% Update surface definition
setappdata(hFig, 'Surface', TessInfo);
% Update colormap
UpdateSurfaceColormap(hFig, iSurfaces);
end
%% ===== COMPUTE SCALP INTERPOLATION =====
function TessInfo = ComputeScalpInterpolation(iDS, iFig, TessInfo)
global GlobalData;
% If surface is not displayed: exit
if isempty(TessInfo.hPatch) || ~ishandle(TessInfo.hPatch)
return;
end
% Get vertices of surface
Vertices = get(TessInfo.hPatch, 'Vertices');
% Get selected channels indices and location
selChan = GlobalData.DataSet(iDS).Figure(iFig).SelectedChannels;
function Wmat = bst_shepards(destLoc, srcLoc, nbNeighbors, excludeParam, expDistance)
% BST_SHEPARDS: 3D nearest-neighbor interpolation using Shepard's weighting.
%
% USAGE: Wmat = bst_shepards(destLoc, srcLoc, nbNeighbors=8, excludeParam=0, expDistance=2)
%
% INPUT:
% - srcLoc : Nx3 array of original locations, or tesselation structure (Faces,Vertices,VertConn)
% - destLoc : NNx3 array of locations onto original data will be interpolated, or tesselation structure (Faces,Vertices,VertConn)
% - nbNeighbors : Number of nearest neighbors to be considered in the interpolation (default is 8)
% - excludeParam : If > 0, the source points that are two far away from the destination surface are ignored.
% Excluded points #i that have: (minDist(i) > mean(minDist) + excludeParam * std(minDist))
% where minDist represents the minimal distance between each source point and the destination surface
% If < 0, exclude the vertices that are further from the absolute distance excludeParam (in millimeters)
% - expDistance : Distance exponent (if higher, influence of a value decreases faster)
%
% OUTPUT:
% - Wmat : Interpolation matrix
% @=============================================================================
% This function is part of the Brainstorm software:
This file has been truncated. show original