Skip to content

Commit

Permalink
explicitly forbid cfg.trial (without "s") to prevent typos affecting …
Browse files Browse the repository at this point in the history
…the analyses
  • Loading branch information
robertoostenveld committed Apr 7, 2021
1 parent 786b527 commit 55772ea
Show file tree
Hide file tree
Showing 52 changed files with 62 additions and 54 deletions.
2 changes: 1 addition & 1 deletion ft_badchannel.m
Expand Up @@ -105,7 +105,7 @@
data = ft_checkdata(data, 'datatype', 'raw', 'feedback', 'yes');

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels', 'trial'}); % prevent accidental typos, see issue 1729
cfg = ft_checkconfig(cfg, 'required', 'metric');

% ensure that the preproc specific options are located in the cfg.preproc substructure
Expand Down
2 changes: 1 addition & 1 deletion ft_badsegment.m
Expand Up @@ -104,7 +104,7 @@
data = ft_checkdata(data, 'datatype', 'raw', 'feedback', 'yes');

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels', 'trial'}); % prevent accidental typos, see issue 1729
cfg = ft_checkconfig(cfg, 'required', 'metric');

% ensure that the preproc specific options are located in the cfg.preproc substructure
Expand Down
2 changes: 1 addition & 1 deletion ft_channelnormalise.m
Expand Up @@ -72,7 +72,7 @@
data = ft_checkdata(data, 'datatype', 'raw', 'feedback', 'yes');

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels', 'trial'}); % prevent accidental typos, see issue 1729

% set the defaults
cfg.channel = ft_getopt(cfg, 'channel', 'all');
Expand Down
1 change: 1 addition & 0 deletions ft_channelrepair.m
Expand Up @@ -85,6 +85,7 @@
end

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'trial'}); % prevent accidental typos, see issue 1729
cfg = ft_checkconfig(cfg, 'renamedval', {'method', 'nearest', 'weighted'});
cfg = ft_checkconfig(cfg, 'renamed', {'elecfile', 'elec'});
cfg = ft_checkconfig(cfg, 'renamed', {'gradfile', 'grad'});
Expand Down
2 changes: 1 addition & 1 deletion ft_componentanalysis.m
Expand Up @@ -185,7 +185,7 @@
data = ft_checkdata(data, 'datatype', 'raw', 'feedback', 'yes');

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels', 'trial'}); % prevent accidental typos, see issue 1729
cfg = ft_checkconfig(cfg, 'forbidden', {'detrend'});
cfg = ft_checkconfig(cfg, 'renamed', {'blc', 'demean'});
cfg = ft_checkconfig(cfg, 'renamedval', {'method', 'predetermined mixing matrix', 'predetermined unmixing matrix'});
Expand Down
2 changes: 1 addition & 1 deletion ft_connectivityanalysis.m
Expand Up @@ -141,7 +141,7 @@
% data = ft_checkdata(data, 'datatype', {'raw', 'timelock', 'freq', 'source'});

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels', 'trial'}); % prevent accidental typos, see issue 1729

% set the defaults
cfg.feedback = ft_getopt(cfg, 'feedback', 'none');
Expand Down
2 changes: 1 addition & 1 deletion ft_connectivityplot.m
Expand Up @@ -62,7 +62,7 @@
end

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'}); % prevent accidental typos, see issue 1729
cfg = ft_checkconfig(cfg, 'renamed', {'zparam', 'parameter'});
cfg = ft_checkconfig(cfg, 'renamed', {'color', 'linecolor'});
cfg = ft_checkconfig(cfg, 'renamed', {'graphcolor', 'linecolor'});
Expand Down
2 changes: 1 addition & 1 deletion ft_crossfrequencyanalysis.m
Expand Up @@ -108,7 +108,7 @@
freqhigh = ft_checkdata(freqhigh, 'datatype', 'freq', 'feedback', 'yes');

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'}); % prevent accidental typos, see issue 1729

% FIXME the below is a bit hacky but it does the trick
if isfield(cfg, 'chanlow') && isfield(cfg, 'chanhigh')
Expand Down
2 changes: 1 addition & 1 deletion ft_databrowser.m
Expand Up @@ -162,7 +162,7 @@
hascomp = hasdata && ft_datatype(data, 'comp'); % can be 'raw+comp' or 'timelock+comp'

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'}); % prevent accidental typos, see issue 1729
cfg = ft_checkconfig(cfg, 'unused', {'comps', 'inputfile', 'outputfile'});
cfg = ft_checkconfig(cfg, 'renamed', {'zscale', 'ylim'});
cfg = ft_checkconfig(cfg, 'renamedval', {'ylim', 'auto', 'maxabs'});
Expand Down
2 changes: 1 addition & 1 deletion ft_denoise_dssp.m
Expand Up @@ -48,7 +48,7 @@
datain = ft_checkdata(datain, 'datatype', {'raw'}); % FIXME how about timelock and freq?

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels', 'trial'}); % prevent accidental typos, see issue 1729
cfg = ft_checkconfig(cfg, 'renamed', {'hdmfile', 'headmodel'});
cfg = ft_checkconfig(cfg, 'renamed', {'vol', 'headmodel'});
cfg = ft_checkconfig(cfg, 'renamed', {'grid', 'sourcemodel'});
Expand Down
2 changes: 1 addition & 1 deletion ft_denoise_pca.m
Expand Up @@ -82,7 +82,7 @@
end

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels', 'trial'}); % prevent accidental typos, see issue 1729

% set the defaults
cfg.refchannel = ft_getopt(cfg, 'refchannel', 'MEGREF');
Expand Down
2 changes: 1 addition & 1 deletion ft_denoise_prewhiten.m
Expand Up @@ -67,7 +67,7 @@
noise = ft_checkdata(noise, 'datatype', { 'timelock' 'freq'}, 'haschantype', 'yes', 'haschanunit', 'yes');

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'}); % prevent accidental typos, see issue 1729

% set the defaults
cfg.channel = ft_getopt(cfg, 'channel', 'all');
Expand Down
3 changes: 2 additions & 1 deletion ft_denoise_synthetic.m
Expand Up @@ -60,7 +60,8 @@
end

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'required', {'gradient'});
cfg = ft_checkconfig(cfg, 'forbidden', {'trial'}); % prevent accidental typos, see issue 1729
cfg = ft_checkconfig(cfg, 'required', {'gradient'});

% set the defaults
cfg.trials = ft_getopt(cfg, 'trials', 'all', 1);
Expand Down
2 changes: 1 addition & 1 deletion ft_denoise_tsr.m
Expand Up @@ -114,7 +114,7 @@
end

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels', 'trial'}); % prevent accidental typos, see issue 1729

% set the defaults
cfg.nfold = ft_getopt(cfg, 'nfold', 1);
Expand Down
2 changes: 1 addition & 1 deletion ft_detect_movement.m
Expand Up @@ -90,7 +90,7 @@
data = ft_checkdata(data, 'datatype', {'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes');

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels', 'trial'}); % prevent accidental typos, see issue 1729

% set the defaults
cfg.method = ft_getopt(cfg, 'method', 'velocity2D');
Expand Down
2 changes: 1 addition & 1 deletion ft_dipolefitting.m
Expand Up @@ -147,7 +147,7 @@
data = ft_checkdata(data, 'datatype', {'comp', 'timelock', 'freq'}, 'feedback', 'yes');

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'}); % prevent accidental typos, see issue 1729
cfg = ft_checkconfig(cfg, 'renamed', {'elecfile', 'elec'});
cfg = ft_checkconfig(cfg, 'renamed', {'gradfile', 'grad'});
cfg = ft_checkconfig(cfg, 'renamed', {'optofile', 'opto'});
Expand Down
2 changes: 1 addition & 1 deletion ft_dipolesimulation.m
Expand Up @@ -100,7 +100,7 @@
end

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'}); % prevent accidental typos, see issue 1729
cfg = ft_checkconfig(cfg, 'renamed', {'elecfile', 'elec'});
cfg = ft_checkconfig(cfg, 'renamed', {'gradfile', 'grad'});
cfg = ft_checkconfig(cfg, 'renamed', {'optofile', 'opto'});
Expand Down
2 changes: 1 addition & 1 deletion ft_electrodeplacement.m
Expand Up @@ -134,7 +134,7 @@
% see http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=2837

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'}); % prevent accidental typos, see issue 1729
cfg = ft_checkconfig(cfg, 'renamed', {'viewdim', 'axisratio'});
cfg = ft_checkconfig(cfg, 'renamedval', {'method', 'mri', 'volume'});
cfg = ft_checkconfig(cfg, 'renamed', {'newfigure', 'figure'});
Expand Down
2 changes: 1 addition & 1 deletion ft_electroderealign.m
Expand Up @@ -172,7 +172,7 @@
end

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'}); % prevent accidental typos, see issue 1729
cfg = ft_checkconfig(cfg, 'forbidden', {'outline'});
cfg = ft_checkconfig(cfg, 'renamed', {'template', 'target'});
cfg = ft_checkconfig(cfg, 'renamedval', {'method', 'realignfiducials', 'fiducial'});
Expand Down
2 changes: 1 addition & 1 deletion ft_electrodermalactivity.m
Expand Up @@ -71,7 +71,7 @@
datain = ft_checkdata(datain, 'datatype', 'raw', 'feedback', 'yes');

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'}); % prevent accidental typos, see issue 1729

% set the default options
cfg.channel = ft_getopt(cfg, 'channel', {});
Expand Down
2 changes: 1 addition & 1 deletion ft_eventtiminganalysis.m
Expand Up @@ -115,7 +115,7 @@
data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes');

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels', 'trial'}); % prevent accidental typos, see issue 1729
cfg = ft_checkconfig(cfg, 'required', {'method'});

% set the defaults
Expand Down
2 changes: 1 addition & 1 deletion ft_freqanalysis.m
Expand Up @@ -229,7 +229,7 @@
data = ft_checkdata(data, 'datatype', {'raw', 'raw+comp', 'mvar'}, 'feedback', 'yes', 'hassampleinfo', 'yes');

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels', 'trial'}); % prevent accidental typos, see issue 1729
cfg = ft_checkconfig(cfg, 'renamed', {'label', 'channel'});
cfg = ft_checkconfig(cfg, 'renamed', {'sgn', 'channel'});
cfg = ft_checkconfig(cfg, 'renamed', {'labelcmb', 'channelcmb'});
Expand Down
2 changes: 1 addition & 1 deletion ft_freqdescriptives.m
Expand Up @@ -88,7 +88,7 @@
freq = ft_checkdata(freq, 'cmbrepresentation', 'sparsewithpow', 'channelcmb', {});

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels', 'trial'}); % prevent accidental typos, see issue 1729
cfg = ft_checkconfig(cfg, 'renamed', {'jacknife', 'jackknife'});

% throw warnings for the deprecated options
Expand Down
2 changes: 1 addition & 1 deletion ft_freqgrandaverage.m
Expand Up @@ -76,7 +76,7 @@
end

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'}); % prevent accidental typos, see issue 1729

% set the defaults
cfg.keepindividual = ft_getopt(cfg, 'keepindividual', 'no');
Expand Down
2 changes: 1 addition & 1 deletion ft_freqstatistics.m
Expand Up @@ -92,7 +92,7 @@
end

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'}); % prevent accidental typos, see issue 1729
cfg = ft_checkconfig(cfg, 'required', {'method', 'design'});
cfg = ft_checkconfig(cfg, 'renamed', {'approach', 'method'});
cfg = ft_checkconfig(cfg, 'forbidden', {'transform'});
Expand Down
2 changes: 1 addition & 1 deletion ft_globalmeanfield.m
Expand Up @@ -79,7 +79,7 @@
datain = ft_checkdata(datain, 'datatype', {'timelock'}, 'feedback', 'yes', 'hassampleinfo', 'yes');

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'}); % prevent accidental typos, see issue 1729

% set the defaults
cfg.method = ft_getopt(cfg, 'method', 'amplitude');
Expand Down
2 changes: 1 addition & 1 deletion ft_heartrate.m
Expand Up @@ -99,7 +99,7 @@
cfg = ft_checkconfig(cfg, 'forbidden', 'medianwindow');

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'}); % prevent accidental typos, see issue 1729
cfg = ft_checkconfig(cfg, 'renamed', {'ectopicbeat_corr', 'ectopicbeatcorrect'}); % for backward compatibility
cfg = ft_checkconfig(cfg, 'renamed', {'corr_threshold', 'ectopicbeatthreshold'}); % for backward compatibility

Expand Down
2 changes: 1 addition & 1 deletion ft_lateralizedpotential.m
Expand Up @@ -91,7 +91,7 @@
avgR = ft_checkdata(avgR, 'datatype', 'timelock');

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'}); % prevent accidental typos, see issue 1729

% set the defaults
if ~isfield(cfg, 'channelcmb')
Expand Down
2 changes: 1 addition & 1 deletion ft_megplanar.m
Expand Up @@ -111,7 +111,7 @@
end

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels', 'trial'}); % prevent accidental typos, see issue 1729
cfg = ft_checkconfig(cfg, 'renamed', {'hdmfile', 'headmodel'});
cfg = ft_checkconfig(cfg, 'renamed', {'vol', 'headmodel'});
cfg = ft_checkconfig(cfg, 'renamed', {'grid', 'sourcemodel'});
Expand Down
2 changes: 1 addition & 1 deletion ft_megrealign.m
Expand Up @@ -122,7 +122,7 @@
data = ft_checkdata(data, 'datatype', 'raw', 'feedback', 'yes', 'hassampleinfo', 'yes', 'ismeg', 'yes');

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels', 'trial'}); % prevent accidental typos, see issue 1729
cfg = ft_checkconfig(cfg, 'renamed', {'plot3d', 'feedback'});
cfg = ft_checkconfig(cfg, 'renamedval', {'headshape', 'headmodel', []});
cfg = ft_checkconfig(cfg, 'required', {'inwardshift', 'template'});
Expand Down
2 changes: 1 addition & 1 deletion ft_multiplotER.m
Expand Up @@ -173,7 +173,7 @@
end

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels', 'trial'}); % prevent accidental typos, see issue 1729
cfg = ft_checkconfig(cfg, 'unused', {'cohtargetchannel'});
cfg = ft_checkconfig(cfg, 'renamed', {'cohrefchannel', 'refchannel'});
cfg = ft_checkconfig(cfg, 'renamed', {'hlim', 'xlim'});
Expand Down
2 changes: 1 addition & 1 deletion ft_multiplotTFR.m
Expand Up @@ -179,7 +179,7 @@
data = ft_checkdata(data, 'datatype', 'freq');

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels', 'trial'}); % prevent accidental typos, see issue 1729
cfg = ft_checkconfig(cfg, 'renamed', {'cohrefchannel', 'refchannel'});
cfg = ft_checkconfig(cfg, 'renamed', {'matrixside', 'directionality'});
cfg = ft_checkconfig(cfg, 'renamed', {'zparam', 'parameter'});
Expand Down
2 changes: 1 addition & 1 deletion ft_mvaranalysis.m
Expand Up @@ -125,7 +125,7 @@
data = ft_checkdata(data, 'datatype', 'raw', 'hassampleinfo', 'yes');

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'}); % prevent accidental typos, see issue 1729
cfg = ft_checkconfig(cfg, 'renamed', {'blc', 'demean'});
cfg = ft_checkconfig(cfg, 'renamed', {'blcwindow', 'baselinewindow'});

Expand Down
2 changes: 1 addition & 1 deletion ft_prepare_layout.m
Expand Up @@ -162,7 +162,7 @@
end

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'}); % prevent accidental typos, see issue 1729
cfg = ft_checkconfig(cfg, 'renamed', {'elecfile', 'elec'});
cfg = ft_checkconfig(cfg, 'renamed', {'gradfile', 'grad'});
cfg = ft_checkconfig(cfg, 'renamed', {'optofile', 'opto'});
Expand Down
2 changes: 1 addition & 1 deletion ft_prepare_leadfield.m
Expand Up @@ -131,7 +131,7 @@
end

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'}); % prevent accidental typos, see issue 1729
cfg = ft_checkconfig(cfg, 'renamed', {'hdmfile', 'headmodel'});
cfg = ft_checkconfig(cfg, 'renamed', {'vol', 'headmodel'});
cfg = ft_checkconfig(cfg, 'renamed', {'grid', 'sourcemodel'});
Expand Down
2 changes: 1 addition & 1 deletion ft_prepare_neighbours.m
Expand Up @@ -105,7 +105,7 @@
end

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'}); % prevent accidental typos, see issue 1729
cfg = ft_checkconfig(cfg, 'required', {'method'});
cfg = ft_checkconfig(cfg, 'renamed', {'elecfile', 'elec'});
cfg = ft_checkconfig(cfg, 'renamed', {'gradfile', 'grad'});
Expand Down
2 changes: 1 addition & 1 deletion ft_preprocessing.m
Expand Up @@ -200,7 +200,7 @@
end

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels', 'trial'}); % prevent accidental typos, see issue 1729
cfg = ft_checkconfig(cfg, 'renamed', {'blc', 'demean'});
cfg = ft_checkconfig(cfg, 'renamed', {'blcwindow', 'baselinewindow'});
cfg = ft_checkconfig(cfg, 'renamed', {'output', 'export'});
Expand Down
14 changes: 8 additions & 6 deletions ft_redefinetrial.m
Expand Up @@ -90,7 +90,14 @@
return
end

% ft_checkdata is done further down
% store original datatype
dtype = ft_datatype(data);

% check if the input data is valid for this function, this will convert it to raw if needed
data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes');

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'trial'}); % prevent accidental typos, see issue 1729

% set the defaults
cfg.offset = ft_getopt(cfg, 'offset', []);
Expand All @@ -104,16 +111,11 @@
cfg.length = ft_getopt(cfg, 'length', []);
cfg.overlap = ft_getopt(cfg, 'overlap', 0);

% store original datatype
dtype = ft_datatype(data);

% deal with the special case of timelock rpt_chan_time with 1 trial
oneRptTimelock = (strcmp(dtype, 'timelock') &&...
strcmp(data.dimord, 'rpt_chan_time') &&...
size(data.trial, 1) == 1);

% check if the input data is valid for this function, this will convert it to raw if needed
data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes');

% select trials of interest
if ~strcmp(cfg.trials, 'all')
Expand Down
2 changes: 1 addition & 1 deletion ft_rejectvisual.m
Expand Up @@ -134,7 +134,7 @@
data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes');

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels', 'trial'}); % prevent accidental typos, see issue 1729
cfg = ft_checkconfig(cfg, 'renamedval', {'metric', 'absmax', 'maxabs'});
cfg = ft_checkconfig(cfg, 'renamedval', {'method', 'absmax', 'maxabs'});

Expand Down
2 changes: 1 addition & 1 deletion ft_removetemplateartifact.m
Expand Up @@ -73,7 +73,7 @@
template = ft_checkdata(template, 'datatype', 'timelock');

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'});
cfg = ft_checkconfig(cfg, 'forbidden', {'channels'}); % prevent accidental typos, see issue 1729

% set the defaults
cfg.channel = ft_getopt(cfg, 'channel', 'all');
Expand Down
1 change: 1 addition & 0 deletions ft_resampledata.m
Expand Up @@ -83,6 +83,7 @@
% ft_checkdata is done further down

% check if the input cfg is valid for this function
cfg = ft_checkconfig(cfg, 'forbidden', {'trial'}); % prevent accidental typos, see issue 1729
cfg = ft_checkconfig(cfg, 'renamed', {'blc', 'demean'});
cfg = ft_checkconfig(cfg, 'renamed', {'resamplemethod', 'method'});
cfg = ft_checkconfig(cfg, 'renamed', {'fsample', 'resamplefs'});
Expand Down

0 comments on commit 55772ea

Please sign in to comment.