Skip to content

Commit

Permalink
documentation - use consistent comment for ft_checkdata, no functiona…
Browse files Browse the repository at this point in the history
…l changes

git-svn-id: svn+ssh://svn.fcdonders.nl/home/svnroot/fieldtrip/trunk@9521 0cf7c7f0-3615-4144-b4e6-68da3bce3cd0
  • Loading branch information
robertoostenveld committed May 14, 2014
1 parent 7c76e04 commit ac9e5ed
Show file tree
Hide file tree
Showing 21 changed files with 33 additions and 20 deletions.
2 changes: 1 addition & 1 deletion fieldtrip2fiff.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function fieldtrip2fiff(filename, data)
% ensure the mne-toolbox to be on the path
ft_hastoolbox('mne', 1);

% check the input data
% check if the input data is valid for this function
data = ft_checkdata(data, 'datatype', {'raw', 'timelock'}, 'feedback', 'yes');
istlck = ft_datatype(data, 'timelock');
isepch = ft_datatype(data, 'raw');
Expand Down
1 change: 1 addition & 0 deletions ft_appendspike.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
if all(isspike)
spike = {};
for i=1:length(varargin)
% check if the input data is valid for this function
spike{i} = ft_checkdata(varargin{i}, 'datatype', 'spike');
end

Expand Down
7 changes: 4 additions & 3 deletions ft_artifact_zvalue.m
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,11 @@
end

if nargin > 1
% data given as input
isfetch = 1;
hdr = ft_fetch_header(data);
% check if the input data is valid for this function
data = ft_checkdata(data, 'datatype', 'raw', 'hassampleinfo', 'yes');
% data given as input, use ft_fetch_header and ft_fetch_data in the remainder of the code
isfetch = 1;
hdr = ft_fetch_header(data);
elseif nargin == 1
% only cfg given
isfetch = 0;
Expand Down
1 change: 1 addition & 0 deletions ft_connectivityanalysis.m
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
end

% FIXME it should be checked carefully whether the following works
% check if the input data is valid for this function
% data = ft_checkdata(data, 'datatype', {'raw', 'timelock', 'freq', 'source'});

% set the defaults
Expand Down
1 change: 1 addition & 0 deletions ft_denoise_synthetic.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
% store the original type of the input data
dtype = ft_datatype(data);

% check if the input data is valid for this function
% this will convert timelocked input data to a raw data representation if needed
data = ft_checkdata(data, 'datatype', 'raw', 'feedback', 'yes', 'hassampleinfo', 'yes');

Expand Down
4 changes: 1 addition & 3 deletions ft_interpolatenan.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@
return
end

% ensure that the input data is valid for this function, this will also do
% backward-compatibility conversions of old data that for example was
% read from an old *.mat file
% check if the input data is valid for this function
datain = ft_checkdata(datain, 'datatype', {'raw', 'comp'}, 'feedback', 'yes', 'hassampleinfo', 'yes');

% check if the input is valid
Expand Down
1 change: 1 addition & 0 deletions ft_lateralizedpotential.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
return
end

% check if the input data is valid for this function
avgL = ft_checkdata(avgL, 'datatype', 'timelock');
avgR = ft_checkdata(avgR, 'datatype', 'timelock');

Expand Down
2 changes: 1 addition & 1 deletion ft_math.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

type = ft_datatype(varargin{1});
for i=1:length(varargin)
% check that all data types are equal, and update old data structures
% check if the input data is valid for this function, that all data types are equal and update old data structures
varargin{i} = ft_checkdata(varargin{i}, 'datatype', type);
end

Expand Down
3 changes: 2 additions & 1 deletion ft_movieplotTFR.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@
return
end

% check the input dtaa, this function is also called from ft_movieplotER
% check if the input data is valid for this function
% note that this function is also called from ft_movieplotER
data = ft_checkdata(data, 'datatype', {'timelock', 'freq'});

% check if the input cfg is valid for this function
Expand Down
1 change: 1 addition & 0 deletions ft_multiplotER.m
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
end

for i=1:length(varargin)
% check if the input data is valid for this function
varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'timelock', 'freq'});
end

Expand Down
6 changes: 5 additions & 1 deletion ft_neighbourplot.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@
end

hasdata = nargin>1;
if hasdata, data = ft_checkdata(data); end

if hasdata
% check if the input data is valid for this function
data = ft_checkdata(data);
end

cfg.enableedit = ft_getopt(cfg, 'enableedit', 'no');

Expand Down
2 changes: 1 addition & 1 deletion ft_prepare_headmodel.m
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
cfg.smooth = ft_getopt(cfg, 'smooth'); % used for interpolate

if nargin>1,
% ensure that it has the units specified
% check if the input data is valid for this function and ensure that it has the units specified
data = ft_checkdata(data, 'hasunit', 'yes');
else
data = [];
Expand Down
1 change: 1 addition & 0 deletions ft_prepare_leadfield.m
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
% where it would be used for channel selection
data = [];
else
% check if the input data is valid for this function
data = ft_checkdata(data);
end

Expand Down
6 changes: 5 additions & 1 deletion ft_prepare_neighbours.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@
cfg.channel = ft_getopt(cfg, 'channel', 'all');

hasdata = nargin>1;
if hasdata, data = ft_checkdata(data); end

if hasdata
% check if the input data is valid for this function
data = ft_checkdata(data);
end

if strcmp(cfg.method, 'template')
neighbours = [];
Expand Down
2 changes: 1 addition & 1 deletion ft_preprocessing.m
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
% this is used to convert the data back to timelock later
convert = ft_datatype(data);

% the input data must be raw
% check if the input data is valid for this function, the input data must be raw
data = ft_checkdata(data, 'datatype', 'raw', 'hassampleinfo', 'yes');

% check if the input cfg is valid for this function
Expand Down
1 change: 1 addition & 0 deletions ft_rejectartifact.m
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
hasdata = exist('data', 'var');

if hasdata
% check if the input data is valid for this function
data = ft_checkdata(data, 'hassampleinfo', 'yes');
if isfield(data, 'sampleinfo')

Expand Down
1 change: 1 addition & 0 deletions ft_rejectcomponent.m
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
nargin = nargin + exist('data', 'var');

if nargin==3
% check if the input data is valid for this function
data = ft_checkdata(data, 'datatype', 'raw');
label = data.label;
hasdata = 1;
Expand Down
5 changes: 1 addition & 4 deletions ft_removetmsartifact.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
revision = '$Id$';

% do the general setup of the function

ft_defaults % this ensures that the path is correct and that the ft_defaults global variable is available
ft_preamble init % this will show the function help if nargin==0 and return an error
ft_preamble provenance % this records the time and memory usage at teh beginning of the function
Expand All @@ -74,9 +73,7 @@
return
end

% ensure that the input data is valid for this function, this will also do
% backward-compatibility conversions of old data that for example was
% read from an old *.mat file
% check if the input data is valid for this function
data = ft_checkdata(data, 'datatype', {'raw'}, 'feedback', 'yes');

% ensure that the required options are present
Expand Down
1 change: 1 addition & 0 deletions ft_singleplotER.m
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
% ensure that the input is correct, also backward compatibility with old data structures:
dtype = cell(Ndata, 1);
for i=1:Ndata
% check if the input data is valid for this function
varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'timelock', 'freq'});
dtype{i} = ft_datatype(varargin{i});

Expand Down
4 changes: 1 addition & 3 deletions ft_sourcemovie.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@
return
end

% ensure that the input data is valiud for this function, this will also do
% backward-compatibility conversions of old data that for example was
% read from an old *.mat file
% check if the input data is valid for this function
source = ft_checkdata(source, 'datatype', 'source', 'feedback', 'yes');

% check if the input cfg is valid for this function
Expand Down
1 change: 1 addition & 0 deletions ft_sourcewrite.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function ft_sourcewrite(cfg, source)
return
end

% check if the input data is valid for this function
source = ft_checkdata(source, 'datatype', 'source', 'feedback', 'yes');

% ensure that the required options are present
Expand Down

0 comments on commit ac9e5ed

Please sign in to comment.