Skip to content

Commit

Permalink
option value for interplimits to be sensors, rather than electrodes (#…
Browse files Browse the repository at this point in the history
…2388)

* ENH - changed option value for interplimits to sensors, rather than electrodes

* typo
  • Loading branch information
schoffelen committed Feb 8, 2024
1 parent 4e9fbda commit c2ff193
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
5 changes: 3 additions & 2 deletions ft_databrowser.m
Expand Up @@ -86,7 +86,7 @@
% Additional plotting options for the component viewmode:
% cfg.gridscale = scalar, number of points along both directions for interpolation (default = 45 here)
% cfg.shading = string, 'none', 'flat', 'interp' (default = 'flat')
% cfg.interplimits = string, 'electrodes' or 'mask' (default here = 'mask')
% cfg.interplimits = string, 'sensors' or 'mask' (default here = 'mask')
% cfg.interpolation = string, 'nearest', 'linear', 'natural', 'cubic' or 'v4' (default = 'v4')
% cfg.contournum = topoplot contour lines
%
Expand Down Expand Up @@ -177,6 +177,7 @@
cfg = ft_checkconfig(cfg, 'renamed', {'anonymise', 'anonymize'}); % use North American and Oxford British spelling
cfg = ft_checkconfig(cfg, 'renamed', {'newfigure', 'figure'});
cfg = ft_checkconfig(cfg, 'deprecated', {'selectfeature'}); % please specify cfg.artfctdef.xxx and cfg.artfctdef.yyy for each feature
cfg = ft_checkconfig(cfg, 'renamedval', {'interplimits', 'electrodes' 'sensors'});

% ensure that the preproc specific options are located in the cfg.preproc substructure
cfg = ft_checkconfig(cfg, 'createsubcfg', {'preproc'});
Expand Down Expand Up @@ -225,7 +226,7 @@
cfg.trl = ft_getopt(cfg, 'trl');
cfg.gridscale = ft_getopt(cfg, 'gridscale', 45);
cfg.shading = ft_getopt(cfg, 'shading', 'flat');
cfg.interplimits = ft_getopt(cfg, 'interplim', 'mask');
cfg.interplimits = ft_getopt(cfg, 'interplimits', 'mask');
cfg.interpolation = ft_getopt(cfg, 'interpmethod', 'v4');
cfg.channelclamped = ft_getopt(cfg, 'channelclamped');
% set the defaults for plotting the events
Expand Down
2 changes: 1 addition & 1 deletion ft_multiplotCC.m
Expand Up @@ -126,7 +126,7 @@
catch
tmpcfg.refmarker = strmatch(Lbl(k), data.label);
end
tmpcfg.interplimits = 'electrodes';
tmpcfg.interplimits = 'sensors';
if isfield(cfg, 'xparam')
tmpcfg.xparam = cfg.xparam;
tmpcfg.xlim = xparam;
Expand Down
3 changes: 2 additions & 1 deletion ft_topoplotER.m
Expand Up @@ -50,7 +50,7 @@
% 'WestOutside' outside left
% cfg.colorbartext = string indicating the text next to colorbar
% cfg.interplimits = limits for interpolation (default = 'head')
% 'electrodes' to furthest electrode
% 'sensors' to furthest sensor
% 'head' to edge of head
% cfg.interpolation = 'linear', 'cubic', 'nearest', 'v4' (default = 'v4') see GRIDDATA
% cfg.style = plot style (default = 'both')
Expand Down Expand Up @@ -185,6 +185,7 @@
% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'renamed', {'latency', 'xlim'});
cfg = ft_checkconfig(cfg, 'renamed', {'frequency', 'xlim'});
cfg = ft_checkconfig(cfg, 'renamedval', {'interplimits', 'electrodes', 'sensors'});

% this is needed for the figure title
if isfield(cfg, 'dataname') && ~isempty(cfg.dataname)
Expand Down
5 changes: 3 additions & 2 deletions ft_topoplotIC.m
Expand Up @@ -38,7 +38,7 @@
% 'WestOutside' outside left
% cfg.colorbartext = string indicating the text next to colorbar
% cfg.interplimits = limits for interpolation (default = 'head')
% 'electrodes' to furthest electrode
% 'sensors' to furthest sensor
% 'head' to edge of head
% cfg.interpolation = 'linear','cubic','nearest','v4' (default = 'v4') see GRIDDATA
% cfg.style = plot style (default = 'both')
Expand Down Expand Up @@ -130,7 +130,8 @@

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'required', 'component');
cfg = ft_checkconfig(cfg, 'allowedval', {'parameter' 'topo'});
cfg = ft_checkconfig(cfg, 'allowedval', {'parameter', 'topo'});
cfg = ft_checkconfig(cfg, 'renamedval', {'interplimits', 'electrodes', 'sensors'});

% interactive plotting doesn't work for chan_comp dimord.
if isfield(cfg, 'interactive') && strcmp(cfg.interactive, 'yes')
Expand Down
2 changes: 1 addition & 1 deletion ft_topoplotTFR.m
Expand Up @@ -46,7 +46,7 @@
% 'WestOutside' outside left
% cfg.colorbartext = string indicating the text next to colorbar
% cfg.interplimits = limits for interpolation (default = 'head')
% 'electrodes' to furthest electrode
% 'sensors' to furthest sensor
% 'head' to edge of head
% cfg.interpolation = 'linear','cubic','nearest','v4' (default = 'v4') see GRIDDATA
% cfg.style = plot style (default = 'both')
Expand Down
6 changes: 3 additions & 3 deletions plotting/ft_plot_topo.m
Expand Up @@ -12,7 +12,7 @@
% 'mask' = cell-array with line segments that forms the mask (see FT_PREPARE_LAYOUT)
% 'outline' = cell-array with line segments that for the outline (see FT_PREPARE_LAYOUT)
% 'isolines' = vector with values for isocontour lines (default = [])
% 'interplim' = string, 'electrodes' or 'mask' (default = 'electrodes')
% 'interplim' = string, 'sensors' or 'mask' (default = 'sensors')
% 'interpmethod' = string, 'nearest', 'linear', 'natural', 'cubic' or 'v4' (default = 'v4')
% 'style' = can be 'surf', 'iso', 'isofill', 'surfiso', 'imsat', 'imsatiso', 'colormix'
% 'clim' = [min max], limits for color scaling
Expand Down Expand Up @@ -61,7 +61,7 @@
height = ft_getopt(varargin, 'height', []);
gridscale = ft_getopt(varargin, 'gridscale', 67); % 67 in original
shading = ft_getopt(varargin, 'shading', 'flat');
interplim = ft_getopt(varargin, 'interplim', 'electrodes');
interplim = ft_getopt(varargin, 'interplim', 'sensors');
interpmethod = ft_getopt(varargin, 'interpmethod', 'v4');
style = ft_getopt(varargin, 'style', 'surfiso'); % can be 'surf', 'iso', 'isofill', 'surfiso', 'imsat', 'imsatiso', 'colormix'
tag = ft_getopt(varargin, 'tag', '');
Expand Down Expand Up @@ -132,7 +132,7 @@
chanX = chanX(:) * xScaling + hpos;
chanY = chanY(:) * yScaling + vpos;

if strcmp(interplim, 'electrodes')
if strcmp(interplim, 'sensors')
hlim = [min(chanX) max(chanX)];
vlim = [min(chanY) max(chanY)];
elseif (strcmp(interplim, 'mask') || strcmp(interplim, 'mask_individual')) && ~isempty(mask)
Expand Down

0 comments on commit c2ff193

Please sign in to comment.